comparison report_clonality/r_wrapper.sh @ 19:3ef457aa5df6 draft

Uploaded
author davidvanzessen
date Thu, 22 Dec 2016 03:43:02 -0500
parents 5d11c9139a55
children c28da767799f
comparison
equal deleted inserted replaced
18:5d11c9139a55 19:3ef457aa5df6
35 cp $dir/IGH_junctie_analyse.png $outputDir 35 cp $dir/IGH_junctie_analyse.png $outputDir
36 samples=`cat $outputDir/samples.txt` 36 samples=`cat $outputDir/samples.txt`
37 37
38 echo "<html><center><h1><a href='index.html'>Click here for the results</a></h1>Tip: Open it in a new tab (middle mouse button or right mouse button -> 'open in new tab' on the link above)<br />" > $2 38 echo "<html><center><h1><a href='index.html'>Click here for the results</a></h1>Tip: Open it in a new tab (middle mouse button or right mouse button -> 'open in new tab' on the link above)<br />" > $2
39 echo "<table border = 1>" >> $2 39 echo "<table border = 1>" >> $2
40 echo "<thead><tr><th>Sample/Replicate</th><th>All</th><th>Productive</th><th>Unique Productive</th><th>Unproductive</th><th>Unique Unproductive</th></tr></thead>" >> $2 40 echo "<thead><tr><th>Donor/Replicate</th><th>All</th><th>Productive</th><th>Unique Productive</th><th>Unproductive</th><th>Unique Unproductive</th></tr></thead>" >> $2
41 while IFS=, read sample all productive perc_prod productive_unique perc_prod_un unproductive perc_unprod unproductive_unique perc_unprod_un 41 while IFS=, read sample all productive perc_prod productive_unique perc_prod_un unproductive perc_unprod unproductive_unique perc_unprod_un
42 do 42 do
43 echo "<tr><td>$sample</td>" >> $2 43 echo "<tr><td>$sample</td>" >> $2
44 echo "<td>$all</td>" >> $2 44 echo "<td>$all</td>" >> $2
45 echo "<td>$productive (${perc_prod}%)</td>" >> $2 45 echo "<td>$productive (${perc_prod}%)</td>" >> $2
46 echo "<td>$productive_unique (${perc_prod_un}%)</td>" >> $2 46 echo "<td>$productive_unique (${perc_prod_un}%)</td>" >> $2
47 echo "<td>$unproductive (${perc_unprod}%)</td>" >> $2 47 echo "<td>$unproductive (${perc_unprod}%)</td>" >> $2
48 echo "<td>$unproductive_unique (${perc_unprod_un}%)</td></tr>" >> $2 48 echo "<td>$unproductive_unique (${perc_unprod_un}%)</td></tr>" >> $2
49 done < $outputDir/productive_counting.txt 49 done < $outputDir/productive_counting.txt
50 echo "</table><br />" >> $2 50 echo "</table><br />" >> $2
51 echo "Table showing the number and percentage of (unique) productive and unproductive sequences per sample and per replicate. <br />" >> $2 51 echo "Table showing the number and percentage of (unique) productive and unproductive sequences per donor and per replicate. <br />" >> $2
52 echo "The definition of unique sequences is based on the clonal type definition filter setting chosen. " >> $2 52 echo "The definition of unique sequences is based on the clonal type definition filter setting chosen. " >> $2
53 echo "</center></html>" >> $2 53 echo "</center></html>" >> $2
54 54
55 echo "<html><head><title>Report on:" >> $outputFile 55 echo "<html><head><title>Report on:" >> $outputFile
56 56
136 echo "<img src='CDR3LengthPlot.png'/><br />" >> $outputFile 136 echo "<img src='CDR3LengthPlot.png'/><br />" >> $outputFile
137 echo "<img src='AAComposition.png'/>" >> $outputFile 137 echo "<img src='AAComposition.png'/>" >> $outputFile
138 echo "<img src='DReadingFrame.png'/>" >> $outputFile 138 echo "<img src='DReadingFrame.png'/>" >> $outputFile
139 139
140 echo "<table class='pure-table pure-table-striped'>" >> $outputFile 140 echo "<table class='pure-table pure-table-striped'>" >> $outputFile
141 echo "<thead><tr><th>Sample</th><th>Median CDR3 Length</th></tr></thead>" >> $outputFile 141 echo "<thead><tr><th>Donor</th><th>Median CDR3 Length</th></tr></thead>" >> $outputFile
142 while IFS=, read Sample median 142 while IFS=, read Sample median
143 do 143 do
144 echo "<tr><td>$Sample</td><td>$median</td></tr>" >> $outputFile 144 echo "<tr><td>$Sample</td><td>$median</td></tr>" >> $outputFile
145 done < $outputDir/AAMedianBySample.csv 145 done < $outputDir/AAMedianBySample.csv
146 echo "</table>" >> $outputFile 146 echo "</table>" >> $outputFile
239 #sum of reads and reads squared 239 #sum of reads and reads squared
240 while IFS=, read readsSum squaredSum 240 while IFS=, read readsSum squaredSum
241 do 241 do
242 echo "<tr><td>Sum</td><td>$readsSum</td></tr>" >> $outputFile 242 echo "<tr><td>Sum</td><td>$readsSum</td></tr>" >> $outputFile
243 done < $outputDir/ReplicateSumReads_$sample.csv 243 done < $outputDir/ReplicateSumReads_$sample.csv
244
245 echo "<tr><td></td><td></td></tr>" >> $outputFile
244 246
245 #overview 247 #overview
246 echo "<tr><td>Number of replicates containing the coincidence</td><td>Number of sequences shared between replicates</td></tr>" >> $outputFile 248 echo "<tr><td>Number of replicates containing the coincidence</td><td>Number of sequences shared between replicates</td></tr>" >> $outputFile
247 while IFS=, read type count weight weightedCount 249 while IFS=, read type count weight weightedCount
248 do 250 do
278 #if [[ "$hasJunctionData" == "Yes" ]] ; then 280 #if [[ "$hasJunctionData" == "Yes" ]] ; then
279 if [ -a "$outputDir/junctionAnalysisProd_mean.csv" ] ; then 281 if [ -a "$outputDir/junctionAnalysisProd_mean.csv" ] ; then
280 echo "<div class='tabbertab' title='Junction Analysis'>" >> $outputFile 282 echo "<div class='tabbertab' title='Junction Analysis'>" >> $outputFile
281 echo "<img src='IGH_junctie_analyse.png' />" >> $outputFile 283 echo "<img src='IGH_junctie_analyse.png' />" >> $outputFile
282 284
283 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 285 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive mean</caption><thead><tr><th>Donor</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
284 while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median 286 while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
285 do 287 do
286 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 288 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
287 done < $outputDir/junctionAnalysisProd_mean.csv 289 done < $outputDir/junctionAnalysisProd_mean.csv
288 echo "</tbody></table>" >> $outputFile 290 echo "</tbody></table>" >> $outputFile
289 291
290 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 292 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive mean</caption><thead><tr><th>Donor</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
291 while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median 293 while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
292 do 294 do
293 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 295 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
294 done < $outputDir/junctionAnalysisUnProd_mean.csv 296 done < $outputDir/junctionAnalysisUnProd_mean.csv
295 echo "</tbody></table>" >> $outputFile 297 echo "</tbody></table>" >> $outputFile
296 298
297 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 299 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive median</caption><thead><tr><th>Donor</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
298 while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median 300 while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
299 do 301 do
300 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 302 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
301 done < $outputDir/junctionAnalysisProd_median.csv 303 done < $outputDir/junctionAnalysisProd_median.csv
302 echo "</tbody></table>" >> $outputFile 304 echo "</tbody></table>" >> $outputFile
303 305
304 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 306 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive median</caption><thead><tr><th>Donor</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
305 while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median 307 while IFS=, read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
306 do 308 do
307 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 309 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
308 done < $outputDir/junctionAnalysisUnProd_median.csv 310 done < $outputDir/junctionAnalysisUnProd_median.csv
309 echo "</tbody></table>" >> $outputFile 311 echo "</tbody></table>" >> $outputFile