Mercurial > repos > davidvanzessen > mutation_analysis
comparison wrapper.sh @ 114:e7b550d52eb7 draft
Uploaded
author | davidvanzessen |
---|---|
date | Tue, 09 Aug 2016 07:20:41 -0400 |
parents | ade5cf6fd2dc |
children | 4984c2a06c43 |
comparison
equal
deleted
inserted
replaced
113:b84477f57318 | 114:e7b550d52eb7 |
---|---|
13 naive_output_ca=$9 | 13 naive_output_ca=$9 |
14 naive_output_cg=${10} | 14 naive_output_cg=${10} |
15 naive_output_cm=${11} | 15 naive_output_cm=${11} |
16 filter_unique=${12} | 16 filter_unique=${12} |
17 class_filter=${13} | 17 class_filter=${13} |
18 empty_region_filter=${14} | |
18 mkdir $outdir | 19 mkdir $outdir |
19 | 20 |
20 tar -xzf $dir/style.tar.gz -C $outdir | 21 tar -xzf $dir/style.tar.gz -C $outdir |
21 | 22 |
22 echo "---------------- read parameters ----------------" | 23 echo "---------------- read parameters ----------------" |
78 fi | 79 fi |
79 | 80 |
80 echo "---------------- merge_and_filter.r ----------------" | 81 echo "---------------- merge_and_filter.r ----------------" |
81 echo "---------------- merge_and_filter.r ----------------<br />" >> $log | 82 echo "---------------- merge_and_filter.r ----------------<br />" >> $log |
82 | 83 |
83 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/before_unique_filter.txt $outdir/unmatched.txt $method $functionality $unique ${filter_unique} ${class_filter} 2>&1 | 84 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/before_unique_filter.txt $outdir/unmatched.txt $method $functionality $unique ${filter_unique} ${class_filter} ${empty_region_filter} 2>&1 |
84 | 85 |
85 echo "---------------- creating new IMGT zip ----------------" | 86 echo "---------------- creating new IMGT zip ----------------" |
86 echo "---------------- creating new IMGT zip ----------------<br />" >> $log | 87 echo "---------------- creating new IMGT zip ----------------<br />" >> $log |
87 | 88 |
88 mkdir $outdir/new_IMGT | 89 mkdir $outdir/new_IMGT |
105 cp $outdir/new_IMGT/* $outdir/new_IMGT_cg | 106 cp $outdir/new_IMGT/* $outdir/new_IMGT_cg |
106 | 107 |
107 mkdir $outdir/new_IMGT_cm | 108 mkdir $outdir/new_IMGT_cm |
108 cp $outdir/new_IMGT/* $outdir/new_IMGT_cm | 109 cp $outdir/new_IMGT/* $outdir/new_IMGT_cm |
109 | 110 |
110 Rscript $dir/tmp/igat.r $outdir/new_IMGT/ $outdir/merged.txt "-" 2>&1 | 111 Rscript $dir/new_imgt.r $outdir/new_IMGT/ $outdir/merged.txt "-" 2>&1 |
111 Rscript $dir/tmp/igat.r $outdir/new_IMGT_ca/ $outdir/merged.txt "ca" 2>&1 | 112 Rscript $dir/new_imgt.r $outdir/new_IMGT_ca/ $outdir/merged.txt "ca" 2>&1 |
112 Rscript $dir/tmp/igat.r $outdir/new_IMGT_cg/ $outdir/merged.txt "cg" 2>&1 | 113 Rscript $dir/new_imgt.r $outdir/new_IMGT_cg/ $outdir/merged.txt "cg" 2>&1 |
113 Rscript $dir/tmp/igat.r $outdir/new_IMGT_cm/ $outdir/merged.txt "cm" 2>&1 | 114 Rscript $dir/new_imgt.r $outdir/new_IMGT_cm/ $outdir/merged.txt "cm" 2>&1 |
114 | 115 |
115 | 116 |
116 tmp="$PWD" | 117 tmp="$PWD" |
117 cd $outdir/new_IMGT/ #tar weirdness... | 118 cd $outdir/new_IMGT/ #tar weirdness... |
118 tar -cJf ../new_IMGT.txz * | 119 tar -cJf ../new_IMGT.txz * |
119 cp $dir/tmp/IgAT.xlsm $outdir/new_IMGT/IgAT.xlsm | |
120 zip -r ../IgAT.zip * | |
121 | 120 |
122 cd $outdir/new_IMGT_ca/ | 121 cd $outdir/new_IMGT_ca/ |
123 tar -cJf ../new_IMGT_ca.txz * | 122 tar -cJf ../new_IMGT_ca.txz * |
124 cp $dir/tmp/IgAT.xlsm $outdir/new_IMGT_ca/IgAT.xlsm | |
125 zip -r ../IgAT_ca.zip * | |
126 | 123 |
127 cd $outdir/new_IMGT_cg/ | 124 cd $outdir/new_IMGT_cg/ |
128 tar -cJf ../new_IMGT_cg.txz * | 125 tar -cJf ../new_IMGT_cg.txz * |
129 cp $dir/tmp/IgAT.xlsm $outdir/new_IMGT_cg/IgAT.xlsm | |
130 zip -r ../IgAT_cg.zip * | |
131 | 126 |
132 cd $outdir/new_IMGT_cm/ | 127 cd $outdir/new_IMGT_cm/ |
133 tar -cJf ../new_IMGT_cm.txz * | 128 tar -cJf ../new_IMGT_cm.txz * |
134 cp $dir/tmp/IgAT.xlsm $outdir/new_IMGT_cm/IgAT.xlsm | |
135 zip -r ../IgAT_cm.zip * | |
136 | 129 |
137 cd $tmp | 130 cd $tmp |
138 | 131 |
139 echo "---------------- mutation_analysis.r ----------------" | 132 echo "---------------- mutation_analysis.r ----------------" |
140 echo "---------------- mutation_analysis.r ----------------<br />" >> $log | 133 echo "---------------- mutation_analysis.r ----------------<br />" >> $log |
217 do | 210 do |
218 tmp=`cat $outdir/${gene}_${func}_n.txt` | 211 tmp=`cat $outdir/${gene}_${func}_n.txt` |
219 echo "<th><a href='matched_${gene}_${func}.txt'>${gene} (N = $tmp)</a></th>" >> $output | 212 echo "<th><a href='matched_${gene}_${func}.txt'>${gene} (N = $tmp)</a></th>" >> $output |
220 done | 213 done |
221 | 214 |
215 tmp=`cat $outdir/all_${func}_n.txt` | |
216 echo "<th><a href='matched_all_${func}.txt'>all (N = $tmp)</a></th>" >> $output | |
222 tmp=`cat $outdir/unmatched_${func}_n.txt` | 217 tmp=`cat $outdir/unmatched_${func}_n.txt` |
223 echo "<th><a href='unmatched.txt'>unmatched (N = ${unmatched_count})</a></th>" >> $output | 218 echo "<th><a href='unmatched.txt'>unmatched (N = ${unmatched_count})</a></th>" >> $output |
224 tmp=`cat $outdir/all_${func}_n.txt` | |
225 echo "<th><a href='matched_all_${func}.txt'>all (N = $tmp)</a></th>" >> $output | |
226 | 219 |
227 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 | 220 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 |
228 do | 221 do |
229 if [ "$name" == "FR S/R (ratio)" ] || [ "$name" == "CDR S/R (ratio)" ] ; then #meh | 222 if [ "$name" == "FR S/R (ratio)" ] || [ "$name" == "CDR S/R (ratio)" ] ; then #meh |
230 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 | 223 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 |
231 else | 224 else |
232 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>${unx}/${uny} (${unz}%)</td><td>${allx}/${ally} (${allz}%)</td></tr>" >> $output | 225 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><td>${unx}/${uny} (${unz}%)</td></tr>" >> $output |
233 fi | 226 fi |
234 done < $outdir/data_${func}.txt | 227 done < $outdir/data_${func}.txt |
235 echo "</table>" >> $output | 228 echo "</table>" >> $output |
236 #echo "<a href='data_${func}.txt'>Download data</a>" >> $output | 229 #echo "<a href='data_${func}.txt'>Download data</a>" >> $output |
237 done | 230 done |
257 | 250 |
258 echo "</div>" >> $output #SHM frequency tab end | 251 echo "</div>" >> $output #SHM frequency tab end |
259 | 252 |
260 echo "<div class='tabbertab' title='Transition tables'>" >> $output | 253 echo "<div class='tabbertab' title='Transition tables'>" >> $output |
261 | 254 |
255 echo "<table border='0'>" >> $output | |
256 | |
262 for gene in ${genes[@]} | 257 for gene in ${genes[@]} |
263 do | 258 do |
264 echo "<table border='1'><caption>$gene transition table</caption>" >> $output | 259 echo "<tr>" >> $output |
260 echo "<td><h1>${gene}</h1></td>" >> $output | |
261 echo "<td><img src='transitions_heatmap_${gene}.png' /></td>" >> $output | |
262 echo "<td><img src='transitions_stacked_${gene}.png' /></td>" >> $output | |
263 echo "<td><table border='1'>" >> $output | |
265 while IFS=, read from a c g t | 264 while IFS=, read from a c g t |
266 do | 265 do |
267 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output | 266 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output |
268 done < $outdir/transitions_${gene}_sum.txt | 267 done < $outdir/transitions_${gene}_sum.txt |
269 echo "</table>" >> $output | 268 echo "</table></td>" >> $output |
269 | |
270 echo "</tr>" >> $output | |
270 done | 271 done |
271 | 272 |
272 echo "<table border='1'><caption>All transition table</caption>" >> $output | 273 echo "<tr>" >> $output |
274 echo "<td><h1>All</h1></td>" >> $output | |
275 echo "<td><img src='transitions_heatmap_all.png' /></td>" >> $output | |
276 echo "<td><img src='transitions_stacked_all.png' /></td>" >> $output | |
277 echo "<td><table border='1'>" >> $output | |
273 while IFS=, read from a c g t | 278 while IFS=, read from a c g t |
274 do | 279 do |
275 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output | 280 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output |
276 done < $outdir/transitions_all_sum.txt | 281 done < $outdir/transitions_all_sum.txt |
282 echo "</table></td>" >> $output | |
283 | |
284 echo "</tr>" >> $output | |
285 | |
277 echo "</table>" >> $output | 286 echo "</table>" >> $output |
278 | 287 |
279 echo "</div>" >> $output #transition tables tab end | 288 echo "</div>" >> $output #transition tables tab end |
280 | 289 |
281 echo "<div class='tabbertab' title='Antigen Selection'>" >> $output | 290 echo "<div class='tabbertab' title='Antigen Selection'>" >> $output |
313 | 322 |
314 echo "</div>" >> $output #CSR tab end | 323 echo "</div>" >> $output #CSR tab end |
315 | 324 |
316 echo "<div class='tabbertab' title='Downloads'>" >> $output | 325 echo "<div class='tabbertab' title='Downloads'>" >> $output |
317 | 326 |
318 echo "<a href='unmatched.txt'>unmatched</a><br />" >> $output | 327 echo "<table border='1' width='700px'>" >> $output |
319 echo "<a href='motif_per_seq.txt'>motif per sequence</a><br />" >> $output | 328 echo "<tr><td>The complete dataset</td><td><a href='merged.txt'>Download</a></td></tr>" >> $output |
320 echo "<a href='merged.txt'>all data</a><br />" >> $output | 329 echo "<tr><td>The alignment info on the unmatched sequences</td><td><a href='unmatched.txt'>Download</a></td></tr>" >> $output |
321 echo "<a href='mutation_by_id.txt'>mutations by id</a><br />" >> $output | 330 echo "<tr><td>Motif data per sequence ID</td><td><a href='motif_per_seq.txt'>Download</a></td></tr>" >> $output |
322 echo "<a href='aa_id_mutations.txt'>AA mutations location by id</a><br />" >> $output | 331 echo "<tr><td>Mutation data per sequence ID</td><td><a href='mutation_by_id.txt'>Download</a></td></tr>" >> $output |
323 echo "<a href='absent_aa_id.txt'>Absant AA locations by id</a><br />" >> $output | 332 echo "<tr><td>AA mutation data per sequence ID</td><td><a href='aa_id_mutations.txt'>Download</a></td></tr>" >> $output |
324 echo "<a href='sequence_overview/index.html'>Sequence Overview</a><br />" >> $output | 333 echo "<tr><td>Absent AA location data per sequence ID</td><td><a href='absent_aa_id.txt'>Download</a></td></tr>" >> $output |
325 echo "<a href='base_overview.html'>Base overview</a><br />" >> $output | 334 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 |
326 echo "<a href='baseline.pdf'>Baseline PDF</a><br />" >> $output | 335 echo "<tr><td>Base count for every sequence</td><td><a href='base_overview.html'>Download</a></td></tr>" >> $output |
327 echo "<a href='baseline.txt'>Baseline Table</a><br />" >> $output | 336 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 |
328 echo "<a href='baseline_ca.pdf'>Baseline ca PDF</a><br />" >> $output | 337 echo "<tr><td>Baseline data</td><td><a href='baseline.txt'>Download</a></td></tr>" >> $output |
329 echo "<a href='baseline_ca.txt'>Baseline ca Table</a><br />" >> $output | 338 echo "<tr><td>Baseline ca PDF</td><td><a href='baseline_ca.pdf'>Download</a></td></tr>" >> $output |
330 echo "<a href='baseline_cg.pdf'>Baseline cg PDF</a><br />" >> $output | 339 echo "<tr><td>Baseline ca data</td><td><a href='baseline_ca.txt'>Download</a></td></tr>" >> $output |
331 echo "<a href='baseline_cg.txt'>Baseline cg Table</a><br />" >> $output | 340 echo "<tr><td>Baseline cg PDF</td><td><a href='baseline_cg.pdf'>Download</a></td></tr>" >> $output |
332 echo "<a href='baseline_cm.pdf'>Baseline cm PDF</a><br />" >> $output | 341 echo "<tr><td>Baseline cg data</td><td><a href='baseline_cg.txt'>Download</a></td></tr>" >> $output |
333 echo "<a href='baseline_cm.txt'>Baseline cm Table</a><br />" >> $output | 342 echo "<tr><td>Baseline cm PDF</td><td><a href='baseline_cm.pdf'>Download</a></td></tr>" >> $output |
334 echo "<a href='IgAT.zip'>IgAT zip</a><br />" >> $output | 343 echo "<tr><td>Baseline cm data</td><td><a href='baseline_cm.txt'>Download</a></td></tr>" >> $output |
335 echo "<a href='IgAT_ca.zip'>IgAT ca zip</a><br />" >> $output | 344 #echo "<tr><td></td><td><a href='IgAT.zip'>IgAT zip</a></td></tr>" >> $output |
336 echo "<a href='IgAT_cg.zip'>IgAT cg zip</a><br />" >> $output | 345 #echo "<tr><td></td><td><a href='IgAT_ca.zip'>IgAT ca zip</a></td></tr>" >> $output |
337 echo "<a href='IgAT_cm.zip'>IgAT cm zip</a><br />" >> $output | 346 #echo "<tr><td></td><td><a href='IgAT_cg.zip'>IgAT cg zip</a></td></tr>" >> $output |
338 echo "<a href='new_IMGT.txz'>Filtered IMGT zip</a><br />" >> $output | 347 #echo "<tr><td></td><td><a href='IgAT_cm.zip'>IgAT cm zip</a></td></tr>" >> $output |
339 echo "<a href='new_IMGT_ca.txz'>Filtered ca IMGT zip</a><br />" >> $output | 348 echo "<tr><td>An IMGT archive with just the matched and filtered sequences</td><td><a href='new_IMGT.txz'>Download</a></td></tr>" >> $output |
340 echo "<a href='new_IMGT_cg.txz'>Filtered cg IMGT zip</a><br />" >> $output | 349 echo "<tr><td>An IMGT archive with just the matched and filtered ca sequences</td><td><a href='new_IMGT_ca.txz'>Download</a></td></tr>" >> $output |
341 echo "<a href='new_IMGT_cm.txz'>Filtered cm IMGT zip</a><br />" >> $output | 350 echo "<tr><td>An IMGT archive with just the matched and filtered cg sequences</td><td><a href='new_IMGT_cg.txz'>Download</a></td></tr>" >> $output |
351 echo "<tr><td>An IMGT archive with just the matched and filtered cm sequences</td><td><a href='new_IMGT_cm.txz'>Download</a></td></tr>" >> $output | |
352 echo "</table>" >> $output | |
342 | 353 |
343 echo "</div>" >> $output #downloads tab end | 354 echo "</div>" >> $output #downloads tab end |
344 | 355 |
345 echo "</div>" >> $output #tabs end | 356 echo "</div>" >> $output #tabs end |
346 | 357 |
354 | 365 |
355 | 366 |
356 mkdir $outdir/baseline/ca_cg_cm | 367 mkdir $outdir/baseline/ca_cg_cm |
357 if [[ $(wc -l < $outdir/new_IMGT/1_Summary.txt) -gt "1" ]]; then | 368 if [[ $(wc -l < $outdir/new_IMGT/1_Summary.txt) -gt "1" ]]; then |
358 cd $outdir/baseline/ca_cg_cm | 369 cd $outdir/baseline/ca_cg_cm |
359 bash $dir/tmp/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT.txz "ca_cg_cm" "$dir/tmp/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline.pdf" "Sequence.ID" "$outdir/baseline.txt" | 370 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT.txz "ca_cg_cm" "$dir/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline.pdf" "Sequence.ID" "$outdir/baseline.txt" |
360 else | 371 else |
361 echo "No sequences" > "$outdir/baseline.txt" | 372 echo "No sequences" > "$outdir/baseline.txt" |
362 fi | 373 fi |
363 | 374 |
364 mkdir $outdir/baseline/ca | 375 mkdir $outdir/baseline/ca |
365 if [[ $(wc -l < $outdir/new_IMGT_ca/1_Summary.txt) -gt "1" ]]; then | 376 if [[ $(wc -l < $outdir/new_IMGT_ca/1_Summary.txt) -gt "1" ]]; then |
366 cd $outdir/baseline/ca | 377 cd $outdir/baseline/ca |
367 bash $dir/tmp/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT_ca.txz "ca" "$dir/tmp/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline_ca.pdf" "Sequence.ID" "$outdir/baseline_ca.txt" | 378 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT_ca.txz "ca" "$dir/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline_ca.pdf" "Sequence.ID" "$outdir/baseline_ca.txt" |
368 else | 379 else |
369 echo "No ca sequences" > "$outdir/baseline_ca.txt" | 380 echo "No ca sequences" > "$outdir/baseline_ca.txt" |
370 fi | 381 fi |
371 | 382 |
372 mkdir $outdir/baseline/cg | 383 mkdir $outdir/baseline/cg |
373 if [[ $(wc -l < $outdir/new_IMGT_cg/1_Summary.txt) -gt "1" ]]; then | 384 if [[ $(wc -l < $outdir/new_IMGT_cg/1_Summary.txt) -gt "1" ]]; then |
374 cd $outdir/baseline/cg | 385 cd $outdir/baseline/cg |
375 bash $dir/tmp/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT_cg.txz "cg" "$dir/tmp/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline_cg.pdf" "Sequence.ID" "$outdir/baseline_cg.txt" | 386 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT_cg.txz "cg" "$dir/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline_cg.pdf" "Sequence.ID" "$outdir/baseline_cg.txt" |
376 else | 387 else |
377 echo "No cg sequences" > "$outdir/baseline_cg.txt" | 388 echo "No cg sequences" > "$outdir/baseline_cg.txt" |
378 fi | 389 fi |
379 | 390 |
380 mkdir $outdir/baseline/cm | 391 mkdir $outdir/baseline/cm |
381 if [[ $(wc -l < $outdir/new_IMGT_cm/1_Summary.txt) -gt "1" ]]; then | 392 if [[ $(wc -l < $outdir/new_IMGT_cm/1_Summary.txt) -gt "1" ]]; then |
382 cd $outdir/baseline/cm | 393 cd $outdir/baseline/cm |
383 bash $dir/tmp/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT_cm.txz "cm" "$dir/tmp/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline_cm.pdf" "Sequence.ID" "$outdir/baseline_cm.txt" | 394 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT_cm.txz "cm" "$dir/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline_cm.pdf" "Sequence.ID" "$outdir/baseline_cm.txt" |
384 else | 395 else |
385 echo "No cm sequences" > "$outdir/baseline_cm.txt" | 396 echo "No cm sequences" > "$outdir/baseline_cm.txt" |
386 fi | 397 fi |
387 | 398 |
388 cd $tmp | 399 cd $tmp |
390 echo "---------------- naive_output.r ----------------" | 401 echo "---------------- naive_output.r ----------------" |
391 echo "---------------- naive_output.r ----------------<br />" >> $log | 402 echo "---------------- naive_output.r ----------------<br />" >> $log |
392 | 403 |
393 if [[ "$naive_output" != "None" ]] | 404 if [[ "$naive_output" != "None" ]] |
394 then | 405 then |
395 echo "---------------- imgt_loader.r ----------------" | 406 #echo "---------------- imgt_loader.r ----------------" |
396 echo "---------------- imgt_loader.r ----------------<br />" >> $log | 407 #echo "---------------- imgt_loader.r ----------------<br />" >> $log |
397 #python $dir/imgt_loader.py --summ $PWD/summary.txt --aa $PWD/aa.txt --junction $PWD/junction.txt --output $naive_output | 408 #python $dir/imgt_loader.py --summ $PWD/summary.txt --aa $PWD/aa.txt --junction $PWD/junction.txt --output $naive_output |
398 Rscript --verbose $dir/imgt_loader.r $PWD/summary.txt $PWD/aa.txt $PWD/junction.txt $outdir/loader_output.txt 2>&1 | 409 #Rscript --verbose $dir/imgt_loader.r $PWD/summary.txt $PWD/aa.txt $PWD/junction.txt $outdir/loader_output.txt 2>&1 |
399 | 410 |
400 echo "---------------- naive_output.r ----------------" | 411 #echo "---------------- naive_output.r ----------------" |
401 echo "---------------- naive_output.r ----------------<br />" >> $log | 412 #echo "---------------- naive_output.r ----------------<br />" >> $log |
402 Rscript $dir/naive_output.r $outdir/loader_output.txt $outdir/merged.txt ${naive_output_ca} ${naive_output_cg} ${naive_output_cm} $outdir/ntoverview.txt $outdir/ntsum.txt 2>&1 | 413 #Rscript $dir/naive_output.r $outdir/loader_output.txt $outdir/merged.txt ${naive_output_ca} ${naive_output_cg} ${naive_output_cm} $outdir/ntoverview.txt $outdir/ntsum.txt 2>&1 |
414 | |
415 cp $outdir/new_IMGT_ca.txz ${naive_output_ca} | |
416 cp $outdir/new_IMGT_cg.txz ${naive_output_cg} | |
417 cp $outdir/new_IMGT_cm.txz ${naive_output_cm} | |
403 fi | 418 fi |
404 | 419 |
405 echo "</table>" >> $outdir/base_overview.html | 420 echo "</table>" >> $outdir/base_overview.html |
406 | 421 |
407 mv $log $outdir/log.html | 422 mv $log $outdir/log.html |