diff report_clonality/r_wrapper.sh @ 18:5d11c9139a55 draft

Uploaded
author davidvanzessen
date Wed, 21 Dec 2016 11:53:03 -0500
parents da95be204ebc
children 3ef457aa5df6
line wrap: on
line diff
--- a/report_clonality/r_wrapper.sh	Wed Dec 21 05:57:31 2016 -0500
+++ b/report_clonality/r_wrapper.sh	Wed Dec 21 11:53:03 2016 -0500
@@ -47,7 +47,10 @@
 		echo "<td>$unproductive (${perc_unprod}%)</td>" >> $2
 		echo "<td>$unproductive_unique (${perc_unprod_un}%)</td></tr>" >> $2
 done < $outputDir/productive_counting.txt
-echo "</table border></center></html>" >> $2
+echo "</table><br />" >> $2
+echo "Table showing the number and percentage of (unique) productive and unproductive sequences per sample and per replicate. <br />" >> $2
+echo "The definition of unique sequences is based on the clonal type definition filter setting chosen. " >> $2
+echo "</center></html>" >> $2
 
 echo "<html><head><title>Report on:" >> $outputFile
 
@@ -124,6 +127,9 @@
 	echo "<img src='DPlot.png'/>" >> $outputFile
 fi
 echo "<img src='JPlot.png'/>" >> $outputFile
+
+cat $dir/naive_gene_freq.htm >> $outputFile
+
 echo "</div>" >> $outputFile
 
 echo "<div class='tabbertab' title='CDR3 Characteristics'>" >> $outputFile
@@ -139,6 +145,8 @@
 done < $outputDir/AAMedianBySample.csv
 echo "</table>" >> $outputFile
 
+cat $dir/naive_cdr3_char.htm >> $outputFile
+
 echo "</div>" >> $outputFile
 
 #Heatmaps
@@ -157,8 +165,25 @@
 	echo "</tr></table></div>" >> $outputFile
 	count=$((count+1))
 done
+
+cat $dir/naive_heatmap.htm >> $outputFile
+
 echo "</div></div>" >> $outputFile
 
+echo "<div class='tabbertab' title='Compare Heatmaps'><table class='pure-table pure-table-striped'><thead><tr><th>ID</th><th>Include</th></tr></thead>" >> $outputFile
+for sample in $samples; do
+	echo "<tr><td>$sample</td><td><input type='checkbox' onchange=\"javascript:compareAdd('$sample')\" id='compare_checkbox_$sample'/></td></tr>" >> $outputFile
+done
+echo "</table><div name='comparisonarea'>" >> $outputFile
+echo "<table><tr id='comparison_table_vd'></tr></table>" >> $outputFile
+echo "<table><tr id='comparison_table_vj'></tr></table>" >> $outputFile
+echo "<table><tr id='comparison_table_dj'></tr></table>" >> $outputFile
+
+cat $dir/naive_compare.htm >> $outputFile
+
+echo "</div></div>" >> $outputFile
+
+
 #circos
 
 if [[ "$USECIRCOS" == "yes" ]]; then
@@ -176,6 +201,9 @@
 		echo "<center></table></div>" >> $outputFile
 		count=$((count+1))
 	done
+	
+	cat $dir/naive_circos.htm >> $outputFile
+	
 	echo "</div></div>" >> $outputFile
 fi
 #echo "<div class='tabbertab' title='Interactive'><svg class='chart'></svg><script src='http://d3js.org/d3.v3.min.js'></script></div>" >> $outputFile
@@ -239,6 +267,9 @@
 			echo "</table></div>" >> $outputFile
 		fi
 	done
+	
+	cat $dir/naive_clonality.htm >> $outputFile
+	
 	echo "</div></div>" >> $outputFile
 fi
 
@@ -249,66 +280,58 @@
 	echo "<div class='tabbertab' title='Junction Analysis'>" >> $outputFile
 	echo "<img src='IGH_junctie_analyse.png' />" >> $outputFile
 	
-	echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive mean</caption><thead><tr><th>Sample</th><th>count</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>Median.CDR3</th><thead></tr><tbody>" >> $outputFile
+	echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive mean</caption><thead><tr><th>Sample</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>Median.CDR3</th><thead></tr><tbody>" >> $outputFile
 	while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
 	do
 		echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELD</td><td>$DDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile
 	done < $outputDir/junctionAnalysisProd_mean.csv
 	echo "</tbody></table>" >> $outputFile
 	
-	echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive mean</caption><thead><tr><th>Sample</th><th>count</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>Median.CDR3</th><thead></tr><tbody>" >> $outputFile
+	echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive mean</caption><thead><tr><th>Sample</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>Median.CDR3</th><thead></tr><tbody>" >> $outputFile
 	while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
 	do
 		echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELD</td><td>$DDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile
 	done < $outputDir/junctionAnalysisUnProd_mean.csv
 	echo "</tbody></table>" >> $outputFile
 	
-	echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive median</caption><thead><tr><th>Sample</th><th>count</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>Median.CDR3</th><thead></tr><tbody>" >> $outputFile
+	echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive median</caption><thead><tr><th>Sample</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>Median.CDR3</th><thead></tr><tbody>" >> $outputFile
 	while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
 	do
 		echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELD</td><td>$DDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile
 	done < $outputDir/junctionAnalysisProd_median.csv
 	echo "</tbody></table>" >> $outputFile
 	
-	echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive median</caption><thead><tr><th>Sample</th><th>count</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>Median.CDR3</th><thead></tr><tbody>" >> $outputFile
+	echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive median</caption><thead><tr><th>Sample</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>Median.CDR3</th><thead></tr><tbody>" >> $outputFile
 	while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
 	do
 		echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELD</td><td>$DDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile
 	done < $outputDir/junctionAnalysisUnProd_median.csv
 	echo "</tbody></table>" >> $outputFile
 	
+	cat $dir/naive_junction.htm >> $outputFile
+	
 	echo "</div>" >> $outputFile
 fi
 
-echo "<div class='tabbertab' title='Comparison'><table class='pure-table pure-table-striped'><thead><tr><th>ID</th><th>Include</th></tr></thead>" >> $outputFile
-for sample in $samples; do
-	echo "<tr><td>$sample</td><td><input type='checkbox' onchange=\"javascript:compareAdd('$sample')\" id='compare_checkbox_$sample'/></td></tr>" >> $outputFile
-done
-echo "</table><div name='comparisonarea'>" >> $outputFile
-echo "<table><tr id='comparison_table_vd'></tr></table>" >> $outputFile
-echo "<table><tr id='comparison_table_vj'></tr></table>" >> $outputFile
-echo "<table><tr id='comparison_table_dj'></tr></table>" >> $outputFile
-echo "</div></div>" >> $outputFile
-
 echo "<div class='tabbertab' title='Downloads'>" >> $outputFile
 echo "<table class='pure-table pure-table-striped'>" >> $outputFile
 echo "<thead><tr><th>Description</th><th>Link</th></tr></thead>" >> $outputFile
-echo "<tr><td>The dataset used to generate the frequency graphs and the heatmaps (Unique based on clonaltype, $clonalType)</td><td><a href='allUnique.csv'>Download</a></td></tr>" >> $outputFile
-echo "<tr><td>The dataset used to calculate clonality score (Unique based on clonaltype, $clonalType)</td><td><a href='clonalityComplete.csv'>Download</a></td></tr>" >> $outputFile
+echo "<tr><td>The filtered dataset</td><td><a href='allUnique.txt'>Download</a></td></tr>" >> $outputFile
+echo "<tr><td>The dataset used to calculate clonality score (Unique based on clonaltype, $clonalType)</td><td><a href='clonalityComplete.txt'>Download</a></td></tr>" >> $outputFile
 
 echo "<tr><td>The dataset used to generate the CDR3 length frequency graph</td><td><a href='CDR3LengthPlot.csv'>Download</a></td></tr>" >> $outputFile
 
-echo "<tr><td>The dataset used to generate the V gene family frequency graph</td><td><a href='VFFrequency.csv'>Download</a></td></tr>" >> $outputFile
+echo "<tr><td>The dataset used to generate the distribution of V gene families graph</td><td><a href='VFFrequency.txt'>Download</a></td></tr>" >> $outputFile
 if [[ "$useD" == "true" ]] ; then
-	echo "<tr><td>The dataset used to generate the D gene family frequency graph</td><td><a href='DFFrequency.csv'>Download</a></td></tr>" >> $outputFile
+	echo "<tr><td>The dataset used to generate  the distribution of D gene families graph</td><td><a href='DFFrequency.txt'>Download</a></td></tr>" >> $outputFile
 fi
 
-echo "<tr><td>The dataset used to generate the V gene frequency graph</td><td><a href='VFrequency.csv'>Download</a></td></tr>" >> $outputFile
+echo "<tr><td>The dataset used to generate the relative frequency of V gene usage graph</td><td><a href='VFrequency.txt'>Download</a></td></tr>" >> $outputFile
 if [[ "$useD" == "true" ]] ; then
-	echo "<tr><td>The dataset used to generate the D gene frequency graph</td><td><a href='DFrequency.csv'>Download</a></td></tr>" >> $outputFile
+	echo "<tr><td>The dataset used to generate the relative frequency of D gene usage graph</td><td><a href='DFrequency.txt'>Download</a></td></tr>" >> $outputFile
 fi
-echo "<tr><td>The dataset used to generate the J gene frequency graph</td><td><a href='JFrequency.csv'>Download</a></td></tr>" >> $outputFile
-echo "<tr><td>The dataset used to generate the AA composition graph</td><td><a href='AAComposition.csv'>Download</a></td></tr>" >> $outputFile
+echo "<tr><td>The dataset used to generate the relative frequency of J gene usage graph</td><td><a href='JFrequency.txt'>Download</a></td></tr>" >> $outputFile
+echo "<tr><td>The dataset used to generate the Amino Acid Composition in the CDR3 graph</td><td><a href='AAComposition.txt'>Download</a></td></tr>" >> $outputFile
 
 for sample in $samples; do
 	if [[ "$useD" == "true" ]] ; then
@@ -323,4 +346,7 @@
 echo "<tr><td>A frequency count of V Gene + J Gene + CDR3</td><td><a href='VJCDR3_count.txt'>Download</a></td></tr>" >> $outputFile
 
 echo "</table>" >> $outputFile
+
+cat $dir/naive_downloads.htm >> $outputFile
+
 echo "</div></html>" >> $outputFile