Mercurial > repos > davidvanzessen > mutation_analysis
comparison wrapper.sh @ 121:31cca6d3722a draft
Uploaded
author | davidvanzessen |
---|---|
date | Wed, 17 Aug 2016 07:30:32 -0400 |
parents | 613278c1bde0 |
children | 3d64b3efd352 |
comparison
equal
deleted
inserted
replaced
120:613278c1bde0 | 121:31cca6d3722a |
---|---|
193 echo "---------------- sequence_overview.r ----------------" | 193 echo "---------------- sequence_overview.r ----------------" |
194 echo "---------------- sequence_overview.r ----------------<br />" >> $log | 194 echo "---------------- sequence_overview.r ----------------<br />" >> $log |
195 | 195 |
196 mkdir $outdir/sequence_overview | 196 mkdir $outdir/sequence_overview |
197 | 197 |
198 #Rscript $dir/sequence_overview.r $outdir/identified_genes.txt $PWD/sequences.txt $outdir/merged.txt $outdir/sequence_overview $classes $outdir/hotspot_analysis_sum.txt 2>&1 | |
199 Rscript $dir/sequence_overview.r $outdir/before_unique_filter.txt $outdir/merged.txt $outdir/sequence_overview $classes $outdir/hotspot_analysis_sum.txt 2>&1 | 198 Rscript $dir/sequence_overview.r $outdir/before_unique_filter.txt $outdir/merged.txt $outdir/sequence_overview $classes $outdir/hotspot_analysis_sum.txt 2>&1 |
200 | 199 |
201 echo "<table border='1'>" > $outdir/base_overview.html | 200 echo "<table border='1'>" > $outdir/base_overview.html |
202 | 201 |
203 while IFS=$'\t' read ID class seq A C G T | 202 while IFS=$'\t' read ID class seq A C G T |
204 do | 203 do |
205 echo "<tr><td>$ID</td><td>$seq</td><td>$class</td><td>$A</td><td>$C</td><td>$G</td><td>$T</td></tr>" >> $outdir/base_overview.html | 204 echo "<tr><td>$ID</td><td>$seq</td><td>$class</td><td>$A</td><td>$C</td><td>$G</td><td>$T</td></tr>" >> $outdir/base_overview.html |
206 done < $outdir/sequence_overview/ntoverview.txt | 205 done < $outdir/sequence_overview/ntoverview.txt |
207 | 206 |
208 echo "<html><center><h1>$title</h1></center>" > $output | 207 echo "<html><center><h1>$title</h1></center>" > $output |
208 echo "<meta name='viewport' content='width=device-width, initial-scale=1'>" >> $output | |
209 echo "<script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $output | 209 echo "<script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $output |
210 echo "<script type='text/javascript' src='tabber.js'></script>" >> $output | 210 echo "<script type='text/javascript' src='tabber.js'></script>" >> $output |
211 echo "<script type='text/javascript' src='script.js'></script>" >> $output | 211 echo "<script type='text/javascript' src='script.js'></script>" >> $output |
212 echo "<link rel='stylesheet' type='text/css' href='style.css'>" >> $output | 212 echo "<link rel='stylesheet' type='text/css' href='style.css'>" >> $output |
213 | 213 echo "<link rel='stylesheet' href='http://yui.yahooapis.com/pure/0.6.0/pure-min.css'>" >> $output |
214 #display the matched/unmatched for clearity | |
215 | 214 |
216 matched_count="`cat $outdir/merged.txt | grep -v 'unmatched' | tail -n +2 | wc -l`" | 215 matched_count="`cat $outdir/merged.txt | grep -v 'unmatched' | tail -n +2 | wc -l`" |
217 unmatched_count="`cat $outdir/unmatched.txt | tail -n +2 | wc -l`" | 216 unmatched_count="`cat $outdir/unmatched.txt | tail -n +2 | wc -l`" |
218 total_count=$((matched_count + unmatched_count)) | 217 total_count=$((matched_count + unmatched_count)) |
219 perc_count=$((unmatched_count / total_count * 100)) | 218 perc_count=$((unmatched_count / total_count * 100)) |
236 echo "---------------- $func table ----------------" | 235 echo "---------------- $func table ----------------" |
237 echo "---------------- $func table ----------------<br />" >> $log | 236 echo "---------------- $func table ----------------<br />" >> $log |
238 | 237 |
239 cat $outdir/mutations_${func}.txt $outdir/hotspot_analysis_${func}.txt > $outdir/data_${func}.txt | 238 cat $outdir/mutations_${func}.txt $outdir/hotspot_analysis_${func}.txt > $outdir/data_${func}.txt |
240 | 239 |
241 echo "<table border='1' width='100%'><caption><h3><a href='data_${func}.txt'>${func} table</a></h3></caption>" >> $output | 240 echo "<table class='pure-table pure-table-striped'>" >> $output |
242 echo "<tr><th>info</th>" >> $output | 241 echo "<thead><tr><th>info</th>" >> $output |
243 for gene in ${genes[@]} | 242 for gene in ${genes[@]} |
244 do | 243 do |
245 tmp=`cat $outdir/${gene}_${func}_n.txt` | 244 tmp=`cat $outdir/${gene}_${func}_n.txt` |
246 echo "<th><a href='matched_${gene}_${func}.txt'>${gene} (N = $tmp)</a></th>" >> $output | 245 echo "<th><a href='matched_${gene}_${func}.txt'>${gene} (N = $tmp)</a></th>" >> $output |
247 done | 246 done |
248 | 247 |
249 tmp=`cat $outdir/all_${func}_n.txt` | 248 tmp=`cat $outdir/all_${func}_n.txt` |
250 echo "<th><a href='matched_all_${func}.txt'>all (N = $tmp)</a></th>" >> $output | 249 echo "<th><a href='matched_all_${func}.txt'>all (N = $tmp)</a></th>" >> $output |
251 tmp=`cat $outdir/unmatched_${func}_n.txt` | 250 tmp=`cat $outdir/unmatched_${func}_n.txt` |
252 echo "<th><a href='unmatched.txt'>unmatched (N = ${unmatched_count})</a></th>" >> $output | 251 echo "<th><a href='unmatched.txt'>unmatched (N = ${unmatched_count})</a></th><tr></thead>" >> $output |
253 | 252 |
254 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 unx uny unz allx ally allz | 253 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 unx uny unz allx ally allz |
255 do | 254 do |
256 if [ "$name" == "FR S/R (ratio)" ] || [ "$name" == "CDR S/R (ratio)" ] ; then #meh | 255 if [ "$name" == "FR S/R (ratio)" ] || [ "$name" == "CDR S/R (ratio)" ] ; then #meh |
257 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 | 256 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 |
292 do | 291 do |
293 echo "<tr>" >> $output | 292 echo "<tr>" >> $output |
294 echo "<td><h1>${gene}</h1></td>" >> $output | 293 echo "<td><h1>${gene}</h1></td>" >> $output |
295 echo "<td><img src='transitions_heatmap_${gene}.png' /></td>" >> $output | 294 echo "<td><img src='transitions_heatmap_${gene}.png' /></td>" >> $output |
296 echo "<td><img src='transitions_stacked_${gene}.png' /></td>" >> $output | 295 echo "<td><img src='transitions_stacked_${gene}.png' /></td>" >> $output |
297 echo "<td><table border='1'>" >> $output | 296 echo "<td><table class='pure-table transition-table pure-table-bordered'>" >> $output |
298 while IFS=, read from a c g t | 297 while IFS=, read from a c g t |
299 do | 298 do |
300 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output | 299 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output |
301 done < $outdir/transitions_${gene}_sum.txt | 300 done < $outdir/transitions_${gene}_sum.txt |
302 echo "</table></td>" >> $output | 301 echo "</table></td>" >> $output |
306 | 305 |
307 echo "<tr>" >> $output | 306 echo "<tr>" >> $output |
308 echo "<td><h1>All</h1></td>" >> $output | 307 echo "<td><h1>All</h1></td>" >> $output |
309 echo "<td><img src='transitions_heatmap_all.png' /></td>" >> $output | 308 echo "<td><img src='transitions_heatmap_all.png' /></td>" >> $output |
310 echo "<td><img src='transitions_stacked_all.png' /></td>" >> $output | 309 echo "<td><img src='transitions_stacked_all.png' /></td>" >> $output |
311 echo "<td><table border='1'>" >> $output | 310 echo "<td><table class='pure-table transition-table pure-table-bordered'>" >> $output |
312 while IFS=, read from a c g t | 311 while IFS=, read from a c g t |
313 do | 312 do |
314 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output | 313 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output |
315 done < $outdir/transitions_all_sum.txt | 314 done < $outdir/transitions_all_sum.txt |
316 echo "</table></td>" >> $output | 315 echo "</table></td>" >> $output |
356 | 355 |
357 echo "</div>" >> $output #CSR tab end | 356 echo "</div>" >> $output #CSR tab end |
358 | 357 |
359 echo "<div class='tabbertab' title='Downloads'>" >> $output | 358 echo "<div class='tabbertab' title='Downloads'>" >> $output |
360 | 359 |
361 echo "<table border='1' width='700px'>" >> $output | 360 echo "<table class='pure-table pure-table-striped'>" >> $output |
361 echo "<thead><tr><th>info</th><th>link</th></tr></thead>" >> $output | |
362 echo "<tr><td>The complete dataset</td><td><a href='merged.txt'>Download</a></td></tr>" >> $output | 362 echo "<tr><td>The complete dataset</td><td><a href='merged.txt'>Download</a></td></tr>" >> $output |
363 echo "<tr><td>The alignment info on the unmatched sequences</td><td><a href='unmatched.txt'>Download</a></td></tr>" >> $output | 363 echo "<tr><td>The alignment info on the unmatched sequences</td><td><a href='unmatched.txt'>Download</a></td></tr>" >> $output |
364 echo "<tr><td>Motif data per sequence ID</td><td><a href='motif_per_seq.txt'>Download</a></td></tr>" >> $output | 364 echo "<tr><td>Motif data per sequence ID</td><td><a href='motif_per_seq.txt'>Download</a></td></tr>" >> $output |
365 echo "<tr><td>Mutation data per sequence ID</td><td><a href='mutation_by_id.txt'>Download</a></td></tr>" >> $output | 365 echo "<tr><td>Mutation data per sequence ID</td><td><a href='mutation_by_id.txt'>Download</a></td></tr>" >> $output |
366 echo "<tr><td>AA mutation data per sequence ID</td><td><a href='aa_id_mutations.txt'>Download</a></td></tr>" >> $output | 366 echo "<tr><td>AA mutation data per sequence ID</td><td><a href='aa_id_mutations.txt'>Download</a></td></tr>" >> $output |
367 echo "<tr><td>Absent AA location data per sequence ID</td><td><a href='absent_aa_id.txt'>Download</a></td></tr>" >> $output | 367 echo "<tr><td>Absent AA location data per sequence ID</td><td><a href='absent_aa_id.txt'>Download</a></td></tr>" >> $output |
368 echo "<tr><td>CDR1+FR2+CDR2+FR3+CDR3 sequences that show up more than once</td><td><a href='sequence_overview/index.html'>Download</a></td></tr>" >> $output | 368 echo "<tr><td>CDR1+FR2+CDR2+FR3+CDR3 sequences that show up more than once</td><td><a href='sequence_overview/index.html'>Download</a></td></tr>" >> $output |
369 echo "<tr><td>Base count for every sequence</td><td><a href='base_overview.html'>Download</a></td></tr>" >> $output | 369 echo "<tr><td>Base count for every sequence</td><td><a href='base_overview.html'>Download</a></td></tr>" >> $output |
370 echo "<tr><td>Baseline PDF (<href a='http://selection.med.yale.edu/baseline/'>http://selection.med.yale.edu/baseline/</a>)</td><td><a href='baseline.pdf'>Download</a></td></tr>" >> $output | 370 echo "<tr><td>Baseline PDF (<a href='http://selection.med.yale.edu/baseline/'>http://selection.med.yale.edu/baseline/</a>)</td><td><a href='baseline.pdf'>Download</a></td></tr>" >> $output |
371 echo "<tr><td>Baseline data</td><td><a href='baseline.txt'>Download</a></td></tr>" >> $output | 371 echo "<tr><td>Baseline data</td><td><a href='baseline.txt'>Download</a></td></tr>" >> $output |
372 echo "<tr><td>Baseline ca PDF</td><td><a href='baseline_ca.pdf'>Download</a></td></tr>" >> $output | 372 echo "<tr><td>Baseline ca PDF</td><td><a href='baseline_ca.pdf'>Download</a></td></tr>" >> $output |
373 echo "<tr><td>Baseline ca data</td><td><a href='baseline_ca.txt'>Download</a></td></tr>" >> $output | 373 echo "<tr><td>Baseline ca data</td><td><a href='baseline_ca.txt'>Download</a></td></tr>" >> $output |
374 echo "<tr><td>Baseline cg PDF</td><td><a href='baseline_cg.pdf'>Download</a></td></tr>" >> $output | 374 echo "<tr><td>Baseline cg PDF</td><td><a href='baseline_cg.pdf'>Download</a></td></tr>" >> $output |
375 echo "<tr><td>Baseline cg data</td><td><a href='baseline_cg.txt'>Download</a></td></tr>" >> $output | 375 echo "<tr><td>Baseline cg data</td><td><a href='baseline_cg.txt'>Download</a></td></tr>" >> $output |