diff wrapper.sh @ 2:8d562506f4f9 draft

Uploaded
author davidvanzessen
date Mon, 25 Aug 2014 03:38:07 -0400
parents c0110597898e
children f9316f7676cc
line wrap: on
line diff
--- a/wrapper.sh	Thu Jun 19 11:12:44 2014 -0400
+++ b/wrapper.sh	Mon Aug 25 03:38:07 2014 -0400
@@ -38,13 +38,15 @@
 	echo "<div class='tabbertab' title='Data frequency'>" >> $html
 	echo "<table><tr><td style='vertical-align:top;'>" >> $html
 	echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_freq'>" >> $html
-	echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_Both</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Sum number of sequences $patient</th><th>Percentage of sequences ${patient}_both</th></thead>" >> $html
+	echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_Both</th><th>Number of sequences_$sample1</th><th>Normalized Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Normalized Read Count $sample2</th><th>Sum number of sequences $patient</th><th>Percentage of sequences ${patient}_both</th></thead>" >> $html
 	echo "<tbody>" >> $html
-	while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent
+	readsumtable="<table class='result_table summary_table'><thead><tr><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Total normalized read count for $sample1</th><th>Total normalized read count for $sample2</th></tr></thead>"
+	while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2
 	do
 		if [ "$locus" != "$oldLocus" ] ; then
 			echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> $html
 			echo "<tr><td><b>$locus</b></td>" >> $html
+			readsumtable="${readsumtable}<tr><td>$locus</td><td>$v_segment</td><td>$j_segment</td><td>$locusreadsum1</td><td>$locusreadsum2</td></tr>"
 		else
 			echo "<td></td>" >> $html
 		fi
@@ -71,10 +73,11 @@
 		echo "<td>$sum</td>" >> $html
 		echo "<td>${percent}&#37;</td>" >> $html
 		echo "</tr>" >> $html
-		oldLocus="$locus"
+		oldLocus="$locus"	
 	done < tmp.txt
 	echo "</tbody></table>" >> $html
-	echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_freq'></div></td></tr></table></div>" >> $html
+	echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_freq'></div></td></tr></table>" >> $html
+	echo "${readsumtable}</table></div>" >> $html
 	echo "<div class='tabbertab' title='Graphs frequency'>" >> $html
 	echo "<a href='${patient}_freq.png'><img src='${patient}_freq.png' width='1280' height='720' /></a><br />" >> $html
 	echo "<a href='${patient}_freq_both.png'><img src='${patient}_freq_both.png' width='1280' height='720' /></a><br />" >> $html
@@ -86,11 +89,13 @@
 	echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_reads'>" >> $html
 	echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_Both</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Sum number of sequences $patient</th><th>Percentage of sequences ${patient}_both</th></thead>" >> $html
 	echo "<tbody>" >> $html
-	while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent
+	readsumtable="<table class='result_table summary_table'><thead><tr><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Total normalized read count for $sample1</th><th>Total normalized read count for $sample2</th></tr></thead>"
+	while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2
 	do
 		if [ "$locus" != "$oldLocus" ] ; then
 			echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> $html
 			echo "<tr><td><b>$locus</b></td>" >> $html
+			readsumtable="${readsumtable}<tr><td>$locus</td><td>$v_segment</td><td>$j_segment</td><td>$locusreadsum1</td><td>$locusreadsum2</td></tr>"
 		else
 			echo "<td></td>" >> $html
 		fi
@@ -120,12 +125,13 @@
 		oldLocus="$locus"
 	done < tmp.txt
 	echo "</tbody></table>" >> $html
-	echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_reads'></div></td></tr></table></div>" >> $html
+	echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_reads'></div></td></tr></table>" >> $html
+	echo "${readsumtable}</table></div>" >> $html
 	echo "<div class='tabbertab' title='Graphs reads'>" >> $html
 	echo "<a href='${patient}_reads.png'><img src='${patient}_reads.png' width='1280' height='720' /></a><br />" >> $html
 	echo "<a href='${patient}_reads_both.png'><img src='${patient}_reads_both.png' width='1280' height='720' /></a><br />" >> $html
 	echo "<a href='${patient}_percent_reads.png'><img src='${patient}_percent_reads.png' width='1280' height='720' /></a></div>" >> $html
-	echo "</div>" >> $html	
+	echo "</div>" >> $html
 	echo "</div>" >> $html
 done < patients.txt
 echo "</div></html>" >> $html