comparison wrapper.sh @ 53:7290a88ea202 draft

Uploaded
author davidvanzessen
date Mon, 29 Feb 2016 10:49:39 -0500
parents d3542f87a304
children d8daf8ed39e1
comparison
equal deleted inserted replaced
52:d3542f87a304 53:7290a88ea202
31 cat $PWD/files/*/6_* > $PWD/junction.txt 31 cat $PWD/files/*/6_* > $PWD/junction.txt
32 cat $PWD/files/*/7_* > $PWD/mutationanalysis.txt 32 cat $PWD/files/*/7_* > $PWD/mutationanalysis.txt
33 cat $PWD/files/*/8_* > $PWD/mutationstats.txt 33 cat $PWD/files/*/8_* > $PWD/mutationstats.txt
34 cat $PWD/files/*/10_* > $PWD/hotspots.txt 34 cat $PWD/files/*/10_* > $PWD/hotspots.txt
35 35
36 cp $dir/tabber.js $outdir
37
36 #BLASTN_DIR="/home/galaxy/tmp/blast/ncbi-blast-2.2.30+/bin" 38 #BLASTN_DIR="/home/galaxy/tmp/blast/ncbi-blast-2.2.30+/bin"
37 39
38 echo "${BLASTN_DIR}" 40 echo "${BLASTN_DIR}"
39 41
40 echo "identification ($method)" 42 echo "identification ($method)"
61 Rscript $dir/merge_and_filter.r $PWD/summary.txt $PWD/sequences.txt $PWD/mutationanalysis.txt $PWD/mutationstats.txt $PWD/hotspots.txt $outdir/identified_genes.txt $outdir/merged.txt $outdir/unmatched.txt $method $functionality $unique ${filter_unique} 63 Rscript $dir/merge_and_filter.r $PWD/summary.txt $PWD/sequences.txt $PWD/mutationanalysis.txt $PWD/mutationstats.txt $PWD/hotspots.txt $outdir/identified_genes.txt $outdir/merged.txt $outdir/unmatched.txt $method $functionality $unique ${filter_unique}
62 64
63 genes="ca,ca1,ca2,cg,cg1,cg2,cg3,cg4,cm" 65 genes="ca,ca1,ca2,cg,cg1,cg2,cg3,cg4,cm"
64 echo "R mutation analysis" 66 echo "R mutation analysis"
65 Rscript $dir/mutation_analysis.r $outdir/merged.txt $genes $outdir ${include_fr1} 2>&1 67 Rscript $dir/mutation_analysis.r $outdir/merged.txt $genes $outdir ${include_fr1} 2>&1
68
69 #echo "." > $output
70 #exit 0
71
66 echo "python mutation analysis" 72 echo "python mutation analysis"
67 python $dir/mutation_analysis.py --input $outdir/merged.txt --genes $genes --includefr1 "${include_fr1}" --output $outdir/hotspot_analysis.txt 73 python $dir/mutation_analysis.py --input $outdir/merged.txt --genes $genes --includefr1 "${include_fr1}" --output $outdir/hotspot_analysis.txt
68 echo "R AA histogram" 74 echo "R AA histogram"
69 Rscript $dir/aa_histogram.r $outdir/aa_mutations.txt $outdir/aa_histogram.png 2>&1 75 Rscript $dir/aa_histogram.r $outdir/aa_mutations.txt $outdir/aa_histogram.png 2>&1
70 cat $outdir/mutations.txt $outdir/hotspot_analysis.txt > $outdir/result.txt
71 76
72 genes=(ca ca1 ca2 cg cg1 cg2 cg3 cg4 cm) 77 genes=(ca ca1 ca2 cg cg1 cg2 cg3 cg4 cm)
73 78
79 funcs=(sum mean median)
74 80
75 echo "<html><center><h1>$title</h1></center><table border='1'>" > $output 81
76 echo "<tr><th>info</th>" >> $output 82 echo "<html><center><h1>$title</h1></center>" >> $output
77 for gene in ${genes[@]} 83
84 for func in ${funcs[@]}
78 do 85 do
79 tmp=`cat $outdir/${gene}_n.txt` 86 cat $outdir/mutations_${func}.txt $outdir/hotspot_analysis_${func}.txt > $outdir/result.txt
80 echo "<th><a href='matched_${gene}.txt'>${gene} (N = $tmp)</a></th>" >> $output 87
88 echo "<table border='1' width='100%'><caption><h3>${func} table</h3></caption>" >> $output
89 echo "<tr><th'>info</th>" >> $output
90 for gene in ${genes[@]}
91 do
92 tmp=`cat $outdir/${gene}_${func}_n.txt`
93 echo "<th><a href='matched_${gene}_${func}.txt'>${gene} (N = $tmp)</a></th>" >> $output
94 done
95 tmp=`cat $outdir/all_${func}_n.txt`
96 echo "<th><a href='matched_all.txt'>all (N = $tmp)</a></th>" >> $output
97
98 while IFS=, read name cax cay caz ca1x ca1y ca1z ca2x ca2y ca2z cgx cgy cgz cg1x cg1y cg1z cg2x cg2y cg2z cg3x cg3y cg3z cg4x cg4y cg4z cmx cmy cmz allx ally allz
99 do
100 if [ "$name" == "FR S/R (ratio)" ] || [ "$name" == "CDR S/R (ratio)" ] ; then #meh
101 echo "<tr><td>$name</td><td>${cax}/${cay} (${caz})</td><td>${ca1x}/${ca1y} (${ca1z})</td><td>${ca2x}/${ca2y} (${ca2z})</td><td>${cgx}/${cgy} (${cgz})</td><td>${cg1x}/${cg1y} (${cg1z})</td><td>${cg2x}/${cg2y} (${cg2z})</td><td>${cg3x}/${cg3y} (${cg3z})</td><td>${cg4x}/${cg4y} (${cg4z})</td><td>${cmx}/${cmy} (${cmz})</td><td>${allx}/${ally} (${allz})</td></tr>" >> $output
102 else
103 echo "<tr><td>$name</td><td>${cax}/${cay} (${caz}%)</td><td>${ca1x}/${ca1y} (${ca1z}%)</td><td>${ca2x}/${ca2y} (${ca2z}%)</td><td>${cgx}/${cgy} (${cgz}%)</td><td>${cg1x}/${cg1y} (${cg1z}%)</td><td>${cg2x}/${cg2y} (${cg2z}%)</td><td>${cg3x}/${cg3y} (${cg3z}%)</td><td>${cg4x}/${cg4y} (${cg4z}%)</td><td>${cmx}/${cmy} (${cmz}%)</td><td>${allx}/${ally} (${allz}%)</td></tr>" >> $output
104 fi
105 done < $outdir/result.txt
106
81 done 107 done
82 tmp=`cat $outdir/total_n.txt`
83 echo "<th><a href='matched_all.txt'>all (N = $tmp)</a></th>" >> $output
84 108
85 while IFS=, read name cax cay caz ca1x ca1y ca1z ca2x ca2y ca2z cgx cgy cgz cg1x cg1y cg1z cg2x cg2y cg2z cg3x cg3y cg3z cg4x cg4y cg4z cmx cmy cmz allx ally allz
86 do
87 if [ "$name" == "FR S/R (ratio)" ] || [ "$name" == "CDR S/R (ratio)" ] ; then #meh
88 echo "<tr><td>$name</td><td>${cax}/${cay} (${caz})</td><td>${ca1x}/${ca1y} (${ca1z})</td><td>${ca2x}/${ca2y} (${ca2z})</td><td>${cgx}/${cgy} (${cgz})</td><td>${cg1x}/${cg1y} (${cg1z})</td><td>${cg2x}/${cg2y} (${cg2z})</td><td>${cg3x}/${cg3y} (${cg3z})</td><td>${cg4x}/${cg4y} (${cg4z})</td><td>${cmx}/${cmy} (${cmz})</td><td>${allx}/${ally} (${allz})</td></tr>" >> $output
89 else
90 echo "<tr><td>$name</td><td>${cax}/${cay} (${caz}%)</td><td>${ca1x}/${ca1y} (${ca1z}%)</td><td>${ca2x}/${ca2y} (${ca2z}%)</td><td>${cgx}/${cgy} (${cgz}%)</td><td>${cg1x}/${cg1y} (${cg1z}%)</td><td>${cg2x}/${cg2y} (${cg2z}%)</td><td>${cg3x}/${cg3y} (${cg3z}%)</td><td>${cg4x}/${cg4y} (${cg4z}%)</td><td>${cmx}/${cmy} (${cmz}%)</td><td>${allx}/${ally} (${allz}%)</td></tr>" >> $output
91 fi
92 done < $outdir/result.txt
93 echo "</table>" >> $output 109 echo "</table>" >> $output
94 echo "<a href='unmatched.txt'>unmatched</a><br /><a href='motif_per_seq.txt'>motif per sequence</a><br /><a href='merged.txt'>all data</a><br /><a href='mutation_by_id.txt'>mutations by id</a><br /><a href='aa_id_mutations.txt'>AA mutations location by id</a><br /><a href='absent_aa_id.txt'>Absant AA locations by id</a><br />" >> $output 110 echo "<a href='unmatched.txt'>unmatched</a><br />" >> $output
95 111 echo "<a href='motif_per_seq.txt'>motif per sequence</a><br />" >> $output
112 echo "<a href='merged.txt'>all data</a><br />" >> $output
113 echo "<a href='mutation_by_id.txt'>mutations by id</a><br />" >> $output
114 echo "<a href='aa_id_mutations.txt'>AA mutations location by id</a><br />" >> $output
115 echo "<a href='absent_aa_id.txt'>Absant AA locations by id</a><br />" >> $output
96 116
97 echo "<img src='all.png'/><br />" >> $output 117 echo "<img src='all.png'/><br />" >> $output
98 echo "<a href='all.txt'>download data</a><br />" >> $output 118 echo "<a href='all.txt'>download data</a><br />" >> $output
99 if [ -a $outdir/ca.png ] 119 if [ -a $outdir/ca.png ]
100 then 120 then
127 do 147 do
128 echo "<table border='1'><caption>$gene transition table</caption>" >> $output 148 echo "<table border='1'><caption>$gene transition table</caption>" >> $output
129 while IFS=, read from a c g t 149 while IFS=, read from a c g t
130 do 150 do
131 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output 151 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output
132 done < $outdir/transitions_${gene}.txt 152 done < $outdir/transitions_${gene}_sum.txt
133 echo "</table>" >> $output 153 echo "</table>" >> $output
134 done 154 done
135 155
136 echo "<table border='1'><caption>All transition table</caption>" >> $output 156 echo "<table border='1'><caption>All transition table</caption>" >> $output
137 while IFS=, read from a c g t 157 while IFS=, read from a c g t
138 do 158 do
139 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output 159 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output
140 done < $outdir/transitions.txt 160 done < $outdir/transitions_all_sum.txt
141 echo "</table>" >> $output 161 echo "</table>" >> $output
142 162
143 echo "</html>" >> $output 163 echo "</html>" >> $output
144 164
145 165