Working cantilever-data generation into the Makefile
authorW. Trevor King <wking@drexel.edu>
Mon, 15 Mar 2010 13:07:15 +0000 (09:07 -0400)
committerW. Trevor King <wking@drexel.edu>
Mon, 15 Mar 2010 13:07:15 +0000 (09:07 -0400)
tex/src/figures/cantilever-data/Makefile
tex/src/figures/cantilever-data/README [deleted file]
tex/src/figures/cantilever-data/avg_data.py
tex/src/figures/cantilever-data/data/raw [moved from tex/src/figures/cantilever-data/data with 100% similarity]
tex/src/figures/cantilever-data/get_loading_rates.py
tex/src/figures/cantilever-data/loading-rate.asy
tex/src/figures/cantilever-data/make_plots.sh
tex/src/figures/cantilever-data/makeplotsplits.sh [deleted file]

index 02e8e7678596eda2ee2a34ac048be71f1f279d05..4a8bea23deb9609e90bd9a2efbe25681760c99e1 100644 (file)
@@ -4,11 +4,47 @@ ASYPROCESS = ../asy/asyprocess \
   --
 
 FIGS = plot-splits loading-rate 
+DATA =         plot-splits.d/v_dep_131.98.dat \
+       plot-splits.d/v_dep_131.98.fit \
+       plot-splits.d/v_dep_24.33.dat \
+       plot-splits.d/v_dep_24.33.fit \
+       loading-rate.d/loading_rate_131.98 \
+       loading-rate.d/loading_rate_24.33
+DATA_DIRS = data plot-splits.d loading-rate.d
 
 all : $(FIGS:%=%_.tex)
 
 clean :
-       rm -f $(FIGS:%=%_*) $(FIGS:%=%-*)
+       rm -f $(FIGS:%=%_*) $(FIGS:%=%-*) *.pyc
+       #rm -rf $(DATA_DIRS)
 
-%_.tex : %.asy
+%_.tex : %.asy $(DATA)
        $(ASYPROCESS) $(patsubst %.asy, %, $<)
+
+$(DATA_DIRS) :
+       mkdir $@
+
+data/raw : extract_f_v_k_data.sh $(DATA_DIRS)
+       ./$< > $@
+
+data/spring-constants data/averaged-data : avg_data.py data/raw
+       python $<
+
+plot-splits.asy plot-splits.gp plot-splits.d/v_dep_%.dat : \
+               make_plots.sh data/spring-constants data/averaged-data
+       ./$<
+
+plot-splits.d/v_dep_%.fit : fit_data.py plot-splits.d/v_dep_%.dat
+       python $^ > $@
+
+plot-splits.pdf : plot-splits.gp plot-splits.d/v_dep_*
+       gnuplot $<
+
+plot-splits.eps : plot-splits.pdf
+       pdftoeps $<
+
+plot-splits-rotated.pdf : plot-splits.pdf
+       pdftk $< cat 1E output $@
+
+loading-rate.d/loading_rate_% : get_loading_rates.py avg_data.py data/raw
+       python $<
diff --git a/tex/src/figures/cantilever-data/README b/tex/src/figures/cantilever-data/README
deleted file mode 100644 (file)
index 5c49101..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-./extract_f_v_k_data.sh > data
-./avg_data.py
-./make_plots.sh
-./get_loading_rates
-./makeplotsplits.sh
index b1bb276c7996e5ee545a301394eae74d7938d575..b422291d453fc473644c188c319ef1602a613029 100755 (executable)
@@ -2,9 +2,9 @@
 
 import numpy, sys
 
-DATAFILE='./data'
-KFILE='./spring_constants'
-AVGFILE='./averaged_data'
+DATAFILE='./data/raw'
+KFILE='./data/spring-constants'
+AVGFILE='./data/averaged-data'
 
 KCUTS=[45, 90]
 
index 80109100da15db11ef0baca6f847c13056e643ae..bf3c569a8a2f9c8df427a6ccd89e21e0650e4488 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-DATA="./data"
+DATA="./data/raw"
 UNFOLD_FORCE_COL=0
 UNFOLD_RATE_COL=1
 SPRING_CONST_COL=2
@@ -14,7 +14,7 @@ OFILEs = [None, None, None]
 for i,K in enumerate(Ks):
     if K == None:
         continue
-    OFILEs[i] = file('loading_rate_%.2f' % K, 'w')
+    OFILEs[i] = file('loading-rate.d/loading_rate_%.2f' % K, 'w')
 
 for line in file(DATA, 'r'):
     if line[0] == '#':
index 7b0c0b362f576abad4ad9e331441ebc7429e60e2..114c548b3023a0559be6a657aed496c5c9685d6d 100644 (file)
@@ -6,8 +6,10 @@ scale(Log, Linear);
 real xscale=1;
 real yscale=1;
 
-graphFile("loading-rate.d/loading_rate_131.98", xscale, yscale, phard, m8, t=units("131.98","pN/nm"), dots=true);
-graphFile("loading-rate.d/loading_rate_24.33", xscale, yscale, red, m8, t=units("24.33","pN/nm"), dots=true);
+graphFile("loading-rate.d/loading_rate_131.98", xscale, yscale, phard, m8,
+         t=units("131.98","pN/nm"), dots=true);
+graphFile("loading-rate.d/loading_rate_24.33", xscale, yscale, red, m8,
+         t=units("24.33","pN/nm"), dots=true);
 
 xlimits(1,3e3);
 ylimits(90,620);
index 43baa965e8a3e786e7b483cbeeb2c01f70a38285..081dae676e39c7ff4a99e355508a1194acbf9d9e 100755 (executable)
@@ -1,19 +1,20 @@
 #!/bin/bash
 
-KFILE='./spring_constants'
-AVGFILE='./averaged_data'
-GPSPLIT='./plot_splits.gp'
+KFILE='./data/spring-constants'
+AVGFILE='./data/averaged-data'
+ASYSPLIT='./plot-splits.asy'
+GPSPLIT='./plot-splits.gp'
 
 PLOTS=""
 while read LINE
 do
     Kprecise=`echo "$LINE" | sed 's/.*= \([0-9.]*\) +.*/\1/'`
     K=`python -c "print '%.2f' % $Kprecise"`
-    FILE="v_dep_$K"
+    FILE="plot-splits.d/v_dep_$K"
     echo "clearing $FILE"
-    > "$FILE"
-    rm "$FILE.fit"
-    PLOTS="$PLOTS, '$FILE' using 1:2:(sqrt(\$4)) with points pt 6 pointsize variable t '$K (pN/nm)'"
+    > "$FILE.dat"
+    rm -f "$FILE.fit"
+    PLOTS="$PLOTS, '$FILE.dat' using 1:2:(sqrt(\$4)) with points pt 6 pointsize variable t '$K (pN/nm)'"
     PLOTS="$PLOTS, '$FILE.fit' using 1:2 with lines notitle"
 done < <(tac "$KFILE")
 PLOTS="${PLOTS:2}" # remove leading ' ,'
@@ -25,17 +26,38 @@ do
     F=`echo "$DATA" | awk '{print $3}'`
     Fstd=`echo "$DATA" | awk '{print $4}'`
     N=`echo "$DATA" | awk '{print $5}'`
-    FILE="v_dep_$K"
-    echo "adding $V, $F, $Fstd, $N to $FILE"
-    echo -e "$V\t$F\t$Fstd\t$N" >> "$FILE"
+    FILE="plot-splits.d/v_dep_$K"
+    echo "adding $V, $F, $Fstd, $N to $FILE.dat"
+    echo -e "$V\t$F\t$Fstd\t$N" >> "$FILE.dat"
 done < <(cat "$AVGFILE" | grep -v '^#')
 
-for FILE in v_dep_*
-do
-    ./fit_data.py "$FILE" > "$FILE.fit"
-done
+cat > "$ASYSPLIT" <<HEREDOC
+import wtk_graph;
+
+size(15cm,10cm,IgnoreAspect);
+
+scale(Log, Linear);
+real xscale=1;
+real yscale=1;
+
+graphFile("loading-rate.d/loading_rate_131.98", xscale, yscale, phard, m8,
+          t=units("131.98","pN/nm"), dots=true);
+graphFile("loading-rate.d/loading_rate_24.33", xscale, yscale, red, m8,
+          t=units("24.33","pN/nm"), dots=true);
+
+xlimits(1,3e3);
+ylimits(90,620);
+
+label(sLabel("Loading rate dependence"), point(N),N);
+xaxis(sLabel("Loading rate (pN/s)"),BottomTop,LeftTicks);
+yaxis(sLabel("Unfolding force (pN)"),LeftRight,RightTicks);
+
+add(legend(),point(E),20E,UnFill);
+HEREDOC
 
-echo "set xlabel 'Pulling speed (nm/s)'
+cat > "GPSPLIT" <<HEREDOC
+set xlabel 'Pulling speed (nm/s)'
 set ylabel 'Unfolding force (pN)'
 set logscale x;
-plot $PLOTS" > "$GPSPLIT"
+plot $PLOTS
+HEREDOC
diff --git a/tex/src/figures/cantilever-data/makeplotsplits.sh b/tex/src/figures/cantilever-data/makeplotsplits.sh
deleted file mode 100755 (executable)
index 38d148e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-gnuplot plot_splits.gp 
-epstopdf plot_splits.eps 
-pdftk plot_splits.pdf cat 1E output plot_splits_rotated.pdf
-cp plot_splits_rotated.pdf ../../posters/2009_biophysical_society_poster/plot_splits.pdf