comparison wrapper.sh @ 39:a24f8c93583a draft

Uploaded
author davidvanzessen
date Thu, 22 Dec 2016 09:39:27 -0500
parents 767dd9327009
children ca2512e1e3ab
comparison
equal deleted inserted replaced
38:05c62efdc393 39:a24f8c93583a
245 cat $outdir/mutations_${func}.txt $outdir/hotspot_analysis_${func}.txt > $outdir/data_${func}.txt 245 cat $outdir/mutations_${func}.txt $outdir/hotspot_analysis_${func}.txt > $outdir/data_${func}.txt
246 246
247 echo "---------------- pattern_plots.r ----------------" 247 echo "---------------- pattern_plots.r ----------------"
248 echo "---------------- pattern_plots.r ----------------<br />" >> $log 248 echo "---------------- pattern_plots.r ----------------<br />" >> $log
249 249
250 Rscript $dir/pattern_plots.r $outdir/data_${func}.txt $outdir/plot1 $outdir/plot2 $outdir/plot3 $outdir/shm_overview.txt 2>&1 250 Rscript $dir/pattern_plots.r $outdir/data_${func}.txt $outdir/aid_motives $outdir/relative_mutations $outdir/abolute_mutations $outdir/shm_overview.txt 2>&1
251 251
252 echo "<table class='pure-table pure-table-striped'>" >> $output 252 echo "<table class='pure-table pure-table-striped'>" >> $output
253 echo "<thead><tr><th>info</th>" >> $output 253 echo "<thead><tr><th>info</th>" >> $output
254 254
255 if [ "${class_filter}" != "101_101" ] ; then 255 if [ "${class_filter}" != "101_101" ] ; then
294 fi 294 fi
295 echo "</table>" >> $output 295 echo "</table>" >> $output
296 #echo "<a href='data_${func}.txt'>Download data</a>" >> $output 296 #echo "<a href='data_${func}.txt'>Download data</a>" >> $output
297 done 297 done
298 298
299 echo "<img src='plot1.png' /><br />" >> $output 299 echo "<img src='aid_motives.png' /><br />" >> $output
300 echo "<img src='plot2.png' /><br />" >> $output 300 echo "<img src='relative_mutations.png' /><br />" >> $output
301 echo "<img src='plot3.png' /><br />" >> $output 301 echo "<img src='abolute_mutations.png' /><br />" >> $output
302 302 echo "<br />" >> $output
303 cat $dir/shm_overview.htm >> $output
303 echo "</div>" >> $output #SHM overview tab end 304 echo "</div>" >> $output #SHM overview tab end
304 305
305 echo "---------------- images ----------------" 306 echo "---------------- images ----------------"
306 echo "---------------- images ----------------<br />" >> $log 307 echo "---------------- images ----------------<br />" >> $log
307 308
313 fi 314 fi
314 if [ -a $outdir/frequency_ranges.png ] 315 if [ -a $outdir/frequency_ranges.png ]
315 then 316 then
316 echo "<img src='frequency_ranges.png'/><br />" >> $output 317 echo "<img src='frequency_ranges.png'/><br />" >> $output
317 fi 318 fi
319
320 echo "<br />" >> $output
321 cat $dir/shm_frequency.htm >> $output
318 322
319 echo "</div>" >> $output #SHM frequency tab end 323 echo "</div>" >> $output #SHM frequency tab end
320 324
321 echo "<div class='tabbertab' title='Transition tables' style='width: 3000px;'>" >> $output 325 echo "<div class='tabbertab' title='Transition tables' style='width: 3000px;'>" >> $output
322 326
378 382
379 echo "</tr>" >> $output 383 echo "</tr>" >> $output
380 384
381 echo "</table>" >> $output 385 echo "</table>" >> $output
382 386
387 echo "<br />" >> $output
388 cat $dir/shm_transition.htm >> $output
389
383 echo "</div>" >> $output #transition tables tab end 390 echo "</div>" >> $output #transition tables tab end
384 391
385 echo "<div class='tabbertab' title='Antigen Selection'>" >> $output 392 echo "<div class='tabbertab' title='Antigen Selection'>" >> $output
386 393
387 if [ -e $outdir/aa_histogram.png ] 394 if [ -e $outdir/aa_histogram.png ]
426 fi 433 fi
427 434
428 mkdir $outdir/baseline/IGA_IGG_IGM 435 mkdir $outdir/baseline/IGA_IGG_IGM
429 if [[ $(wc -l < $outdir/new_IMGT/1_Summary.txt) -gt "1" ]]; then 436 if [[ $(wc -l < $outdir/new_IMGT/1_Summary.txt) -gt "1" ]]; then
430 cd $outdir/baseline/IGA_IGG_IGM 437 cd $outdir/baseline/IGA_IGG_IGM
431 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "${baseline_boundaries}" $outdir/new_IMGT.txz "IGA_IGG_IGM" "$dir/baseline/IMGTVHreferencedataset20161215.fa" "$outdir/baseline.pdf" "Sequence.ID" "$outdir/baseline.txt" 438 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "${baseline_boundaries}" $outdir/new_IMGT.txz "IGA_IGG_IGM_IGE" "$dir/baseline/IMGTVHreferencedataset20161215.fa" "$outdir/baseline.pdf" "Sequence.ID" "$outdir/baseline.txt"
432 else 439 else
433 echo "No sequences" > "$outdir/baseline.txt" 440 echo "No sequences" > "$outdir/baseline.txt"
434 fi 441 fi
435 442
436 mkdir $outdir/baseline/IGA 443 mkdir $outdir/baseline/IGA
494 then 501 then
495 echo "<embed src='baseline_IGE.pdf' width='700px' height='1000px'>" >> $output 502 echo "<embed src='baseline_IGE.pdf' width='700px' height='1000px'>" >> $output
496 fi 503 fi
497 fi 504 fi
498 505
506 echo "<br />" >> $output
507 cat $dir/shm_selection.htm >> $output
508
499 echo "</div>" >> $output #antigen selection tab end 509 echo "</div>" >> $output #antigen selection tab end
500 510
501 echo "<div class='tabbertab' title='CSR'>" >> $output #CSR tab 511 echo "<div class='tabbertab' title='CSR'>" >> $output #CSR tab
502 512
503 if [ -e $outdir/IGA.png ] 513 if [ -e $outdir/IGA.png ]
506 fi 516 fi
507 if [ -e $outdir/IGG.png ] 517 if [ -e $outdir/IGG.png ]
508 then 518 then
509 echo "<img src='IGG.png'/><br />" >> $output 519 echo "<img src='IGG.png'/><br />" >> $output
510 fi 520 fi
521
522 echo "<br />" >> $output
523 cat $dir/shm_csr.htm >> $output
511 524
512 echo "</div>" >> $output #CSR tab end 525 echo "</div>" >> $output #CSR tab end
513 526
514 if [[ "$fast" == "no" ]] ; then 527 if [[ "$fast" == "no" ]] ; then
515 528
560 echo "No IGE sequences" > "$outdir/change_o/change-o-defined_clones-summary-IGE.txt" 573 echo "No IGE sequences" > "$outdir/change_o/change-o-defined_clones-summary-IGE.txt"
561 fi 574 fi
562 575
563 PWD="$tmp" 576 PWD="$tmp"
564 577
565 echo "<div class='tabbertab' title='Clonality'>" >> $output #clonality tab 578 echo "<div class='tabbertab' title='Clonal Relation' style='width: 7000px;'>" >> $output #clonality tab
566 579
567 function clonality_table { 580 function clonality_table {
568 local infile=$1 581 local infile=$1
569 local outfile=$2 582 local outfile=$2
570 583
604 617
605 echo "<div class='tabbertab' title='IGE'>" >> $output 618 echo "<div class='tabbertab' title='IGE'>" >> $output
606 clonality_table $outdir/change_o/change-o-defined_clones-summary-IGM.txt $output 619 clonality_table $outdir/change_o/change-o-defined_clones-summary-IGM.txt $output
607 echo "</div>" >> $output 620 echo "</div>" >> $output
608 621
609 echo "<div class='tabbertab' title='Overlap'>" >> $output 622 echo "<div class='tabbertab' title='Overlap' style='width: 7000px;'>" >> $output
610 cat "$outdir/sequence_overview/index.html" | sed "s%href='\(.*\).html%href='sequence_overview/\1.html%g" >> $output # rewrite href to 'sequence_overview/..." 623 cat "$outdir/sequence_overview/index.html" | sed -e 's:</td>:</td>\n:g' | sed "s:href='\(.*\).html:href='sequence_overview/\1.html:g" >> $output # rewrite href to 'sequence_overview/..."
611 echo "</div>" >> $output 624 echo "</div>" >> $output
612 625
613
614 echo "</div>" >> $output #clonality tabber end 626 echo "</div>" >> $output #clonality tabber end
615 627
628 echo "<br />" >> $output
629 cat $dir/shm_clonality.htm >> $output
630
616 echo "</div>" >> $output #clonality tab end 631 echo "</div>" >> $output #clonality tab end
617 632
618 fi 633 fi
619 634
620 echo "<div class='tabbertab' title='Downloads'>" >> $output 635 echo "<div class='tabbertab' title='Downloads'>" >> $output
628 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>SHM Overview</td></tr>" >> $output 643 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>SHM Overview</td></tr>" >> $output
629 echo "<tr><td>The SHM Overview table as a dataset</td><td><a href='shm_overview.txt' download='shm_overview.txt' >Download</a></td></tr>" >> $output 644 echo "<tr><td>The SHM Overview table as a dataset</td><td><a href='shm_overview.txt' download='shm_overview.txt' >Download</a></td></tr>" >> $output
630 echo "<tr><td>Motif data per sequence ID</td><td><a href='motif_per_seq.txt' download='motif_per_seq.txt' >Download</a></td></tr>" >> $output 645 echo "<tr><td>Motif data per sequence ID</td><td><a href='motif_per_seq.txt' download='motif_per_seq.txt' >Download</a></td></tr>" >> $output
631 echo "<tr><td>Mutation data per sequence ID</td><td><a href='mutation_by_id.txt' download='mutation_by_id.txt' >Download</a></td></tr>" >> $output 646 echo "<tr><td>Mutation data per sequence ID</td><td><a href='mutation_by_id.txt' download='mutation_by_id.txt' >Download</a></td></tr>" >> $output
632 echo "<tr><td>Base count for every sequence</td><td><a href='base_overview.html'>View</a></td></tr>" >> $output 647 echo "<tr><td>Base count for every sequence</td><td><a href='base_overview.html'>View</a></td></tr>" >> $output
633 echo "<tr><td>The data used to generate the RGYW/WRCY and TW/WA plot</td><td><a href='plot1.txt' download='plot1.txt' >Download</a></td></tr>" >> $output 648 echo "<tr><td>The data used to generate the percentage of mutations in AID and pol eta motives plot</td><td><a href='aid_motives.txt' download='aid_motives.txt' >Download</a></td></tr>" >> $output
634 echo "<tr><td>The data used to generate the relative transition and transversion plot</td><td><a href='plot2.txt' download='plot2.txt' >Download</a></td></tr>" >> $output 649 echo "<tr><td>The data used to generate the relative mutation patterns plot</td><td><a href='relative_mutations.txt' download='relative_mutations.txt' >Download</a></td></tr>" >> $output
635 echo "<tr><td>The data used to generate the absolute transition and transversion plot</td><td><a href='plot3.txt' download='plot3.txt' >Download</a></td></tr>" >> $output 650 echo "<tr><td>The data used to generate the absolute mutation patterns plot</td><td><a href='absolute_mutations.txt' download='abolute_mutations.txt' >Download</a></td></tr>" >> $output
636 651
637 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>SHM Frequency</td></tr>" >> $output 652 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>SHM Frequency</td></tr>" >> $output
638 echo "<tr><td>The data generate the frequency scatter plot</td><td><a href='scatter.txt' download='scatter.txt' >Download</a></td></tr>" >> $output 653 echo "<tr><td>The data generate the frequency scatter plot</td><td><a href='scatter.txt' download='scatter.txt' >Download</a></td></tr>" >> $output
639 echo "<tr><td>The data used to generate the frequency by class plot</td><td><a href='frequency_ranges_classes.txt' download='frequency_ranges_classes.txt' >Download</a></td></tr>" >> $output 654 echo "<tr><td>The data used to generate the frequency by class plot</td><td><a href='frequency_ranges_classes.txt' download='frequency_ranges_classes.txt' >Download</a></td></tr>" >> $output
640 echo "<tr><td>The data for frequency by subclass</td><td><a href='frequency_ranges_subclasses.txt' download='frequency_ranges_subclasses.txt' >Download</a></td></tr>" >> $output 655 echo "<tr><td>The data for frequency by subclass</td><td><a href='frequency_ranges_subclasses.txt' download='frequency_ranges_subclasses.txt' >Download</a></td></tr>" >> $output
652 echo "<tr><td>The data for the 'IGM' transition plot</td><td><a href='transitions_IGM_sum.txt' download='transitions_IGM_sum.txt' >Download</a></td></tr>" >> $output 667 echo "<tr><td>The data for the 'IGM' transition plot</td><td><a href='transitions_IGM_sum.txt' download='transitions_IGM_sum.txt' >Download</a></td></tr>" >> $output
653 echo "<tr><td>The data for the 'IGE' transition plot</td><td><a href='transitions_IGE_sum.txt' download='transitions_IGE_sum.txt' >Download</a></td></tr>" >> $output 668 echo "<tr><td>The data for the 'IGE' transition plot</td><td><a href='transitions_IGE_sum.txt' download='transitions_IGE_sum.txt' >Download</a></td></tr>" >> $output
654 669
655 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Antigen Selection</td></tr>" >> $output 670 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Antigen Selection</td></tr>" >> $output
656 echo "<tr><td>AA mutation data per sequence ID</td><td><a href='aa_id_mutations.txt' download='aa_id_mutations.txt' >Download</a></td></tr>" >> $output 671 echo "<tr><td>AA mutation data per sequence ID</td><td><a href='aa_id_mutations.txt' download='aa_id_mutations.txt' >Download</a></td></tr>" >> $output
657 echo "<tr><td>Absent AA location data per sequence ID</td><td><a href='absent_aa_id.txt' download='absent_aa_id.txt' >Download</a></td></tr>" >> $output 672 echo "<tr><td>Presence of AA per sequence ID</td><td><a href='absent_aa_id.txt' download='absent_aa_id.txt' >Download</a></td></tr>" >> $output
658 673
659 echo "<tr><td>The data used to generate the aa mutation frequency plot</td><td><a href='aa_histogram_sum.txt' download='aa_histogram_sum.txt' >Download</a></td></tr>" >> $output 674 echo "<tr><td>The data used to generate the aa mutation frequency plot</td><td><a href='aa_histogram_sum.txt' download='aa_histogram_sum.txt' >Download</a></td></tr>" >> $output
660 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGA</td><td><a href='aa_histogram_sum_IGA.txt' download='aa_histogram_sum_IGA.txt' >Download</a></td></tr>" >> $output 675 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGA</td><td><a href='aa_histogram_sum_IGA.txt' download='aa_histogram_sum_IGA.txt' >Download</a></td></tr>" >> $output
661 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGG</td><td><a href='aa_histogram_sum_IGG.txt' download='aa_histogram_sum_IGG.txt' >Download</a></td></tr>" >> $output 676 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGG</td><td><a href='aa_histogram_sum_IGG.txt' download='aa_histogram_sum_IGG.txt' >Download</a></td></tr>" >> $output
662 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGM</td><td><a href='aa_histogram_sum_IGM.txt' download='aa_histogram_sum_IGM.txt' >Download</a></td></tr>" >> $output 677 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGM</td><td><a href='aa_histogram_sum_IGM.txt' download='aa_histogram_sum_IGM.txt' >Download</a></td></tr>" >> $output
672 echo "<tr><td>Baseline IGM data</td><td><a href='baseline_IGM.txt' download='baseline_IGM.txt' >Download</a></td></tr>" >> $output 687 echo "<tr><td>Baseline IGM data</td><td><a href='baseline_IGM.txt' download='baseline_IGM.txt' >Download</a></td></tr>" >> $output
673 echo "<tr><td>Baseline IGE PDF</td><td><a href='baseline_IGE.pdf' download='baseline_IGE.pdf' >Download</a></td></tr>" >> $output 688 echo "<tr><td>Baseline IGE PDF</td><td><a href='baseline_IGE.pdf' download='baseline_IGE.pdf' >Download</a></td></tr>" >> $output
674 echo "<tr><td>Baseline IGE data</td><td><a href='baseline_IGE.txt' download='baseline_IGE.txt' >Download</a></td></tr>" >> $output 689 echo "<tr><td>Baseline IGE data</td><td><a href='baseline_IGE.txt' download='baseline_IGE.txt' >Download</a></td></tr>" >> $output
675 690
676 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>CSR</td></tr>" >> $output 691 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>CSR</td></tr>" >> $output
677 echo "<tr><td>The data for the CSR IGA pie plot</td><td><a href='IGA_pie.txt' download='IGA_pie.txt' >Download</a></td></tr>" >> $output 692 echo "<tr><td>The data for the IGA subclass distribution plot</td><td><a href='IGA_pie.txt' download='IGA_pie.txt' >Download</a></td></tr>" >> $output
678 echo "<tr><td>The data for the CSR IGG pie plot</td><td><a href='IGG_pie.txt' download='IGG_pie.txt' >Download</a></td></tr>" >> $output 693 echo "<tr><td>The data for the IGG subclass distribution plot</td><td><a href='IGG_pie.txt' download='IGG_pie.txt' >Download</a></td></tr>" >> $output
679 694
680 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Clonality</td></tr>" >> $output 695 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Clonal Relation</td></tr>" >> $output
681 echo "<tr><td>Sequence overlap between subclasses</td><td><a href='sequence_overview/index.html'>View</a></td></tr>" >> $output 696 echo "<tr><td>Sequence overlap between subclasses</td><td><a href='sequence_overview/index.html'>View</a></td></tr>" >> $output
682 echo "<tr><td>The Change-O DB file with defined clones and subclass annotation</td><td><a href='change_o/change-o-db-defined_clones.txt' download='change_o/change-o-db-defined_clones.txt' >Download</a></td></tr>" >> $output 697 echo "<tr><td>The Change-O DB file with defined clones and subclass annotation</td><td><a href='change_o/change-o-db-defined_clones.txt' download='change_o/change-o-db-defined_clones.txt' >Download</a></td></tr>" >> $output
683 echo "<tr><td>The Change-O DB defined clones summary file</td><td><a href='change_o/change-o-defined_clones-summary.txt' download='change_o/change-o-defined_clones-summary.txt' >Download</a></td></tr>" >> $output 698 echo "<tr><td>The Change-O DB defined clones summary file</td><td><a href='change_o/change-o-defined_clones-summary.txt' download='change_o/change-o-defined_clones-summary.txt' >Download</a></td></tr>" >> $output
684 echo "<tr><td>The Change-O DB file with defined clones of IGA</td><td><a href='change_o/change-o-db-defined_clones-IGA.txt' download='change_o/change-o-db-defined_clones-IGA.txt' >Download</a></td></tr>" >> $output 699 echo "<tr><td>The Change-O DB file with defined clones of IGA</td><td><a href='change_o/change-o-db-defined_clones-IGA.txt' download='change_o/change-o-db-defined_clones-IGA.txt' >Download</a></td></tr>" >> $output
685 echo "<tr><td>The Change-O DB defined clones summary file of IGA</td><td><a href='change_o/change-o-defined_clones-summary-IGA.txt' download='change_o/change-o-defined_clones-summary-IGA.txt' >Download</a></td></tr>" >> $output 700 echo "<tr><td>The Change-O DB defined clones summary file of IGA</td><td><a href='change_o/change-o-defined_clones-summary-IGA.txt' download='change_o/change-o-defined_clones-summary-IGA.txt' >Download</a></td></tr>" >> $output
702 echo "<tr><td>An IMGT archive with just the matched and filtered IGG4 sequences</td><td><a href='new_IMGT_IGG4.txz' download='new_IMGT_IGG4.txz' >Download</a></td></tr>" >> $output 717 echo "<tr><td>An IMGT archive with just the matched and filtered IGG4 sequences</td><td><a href='new_IMGT_IGG4.txz' download='new_IMGT_IGG4.txz' >Download</a></td></tr>" >> $output
703 echo "<tr><td>An IMGT archive with just the matched and filtered IGM sequences</td><td><a href='new_IMGT_IGM.txz' download='new_IMGT_IGM.txz' >Download</a></td></tr>" >> $output 718 echo "<tr><td>An IMGT archive with just the matched and filtered IGM sequences</td><td><a href='new_IMGT_IGM.txz' download='new_IMGT_IGM.txz' >Download</a></td></tr>" >> $output
704 echo "<tr><td>An IMGT archive with just the matched and filtered IGE sequences</td><td><a href='new_IMGT_IGE.txz' download='new_IMGT_IGE.txz' >Download</a></td></tr>" >> $output 719 echo "<tr><td>An IMGT archive with just the matched and filtered IGE sequences</td><td><a href='new_IMGT_IGE.txz' download='new_IMGT_IGE.txz' >Download</a></td></tr>" >> $output
705 720
706 echo "</table>" >> $output 721 echo "</table>" >> $output
722
723 echo "<br />" >> $output
724 cat $dir/shm_downloads.htm >> $output
707 725
708 echo "</div>" >> $output #downloads tab end 726 echo "</div>" >> $output #downloads tab end
709 727
710 echo "</div>" >> $output #tabs end 728 echo "</div>" >> $output #tabs end
711 729
746 echo "<td>$step</td>" >> $log 764 echo "<td>$step</td>" >> $log
747 echo "<td>$seq</td>" >> $log 765 echo "<td>$seq</td>" >> $log
748 echo "<td>${perc}%</td>" >> $log 766 echo "<td>${perc}%</td>" >> $log
749 echo "</tr>" >> $log 767 echo "</tr>" >> $log
750 done < $outdir/filtering_steps.txt 768 done < $outdir/filtering_steps.txt
751 echo "</table border></center></html>" >> $log 769 echo "</table>" >> $log
770 echo "<br />" >> $log
771 cat $dir/shm_first.htm >> $log
772 echo "</center></html>" >> $log
752 773
753 IFS="$tIFS" 774 IFS="$tIFS"
754 775
755 776
756 echo "---------------- Done! ----------------" 777 echo "---------------- Done! ----------------"