comparison report_clonality/r_wrapper.sh @ 26:28fbbdfd7a87 draft

Uploaded
author davidvanzessen
date Mon, 13 Feb 2017 09:08:46 -0500
parents 94765af0db1f
children b539aeb75980
comparison
equal deleted inserted replaced
25:94765af0db1f 26:28fbbdfd7a87
220 echo "<div class='tabbertab' title='Shared Clonal Types'><div class='tabber'>" >> $outputFile 220 echo "<div class='tabbertab' title='Shared Clonal Types'><div class='tabber'>" >> $outputFile
221 fi 221 fi
222 222
223 for sample in $samples; do 223 for sample in $samples; do
224 echo "${clonality_method}" 224 echo "${clonality_method}"
225 if [[ "${clonality_method}" == "old" ]] ; then 225
226 echo "in old" 226 echo "<div class='tabbertab' title='$sample'><table class='pure-table pure-table-striped'>" >> $outputFile
227 clonalityScore="$(cat $outputDir/ClonalityScore_$sample.csv)" 227
228 echo "<div class='tabbertab' title='$sample'><table class='pure-table pure-table-striped'>" >> $outputFile 228 if [[ "${clonality_method}" == "boyd" ]] ; then
229
230 if [[ "${clonality_method}" == "boyd" ]] ; then
231 echo "<thead><tr><th colspan='2'>Clonality Score: $clonalityScore</th></tr></thead>" >> $outputFile
232 fi
233
234 #replicate,reads,squared
235 echo "<tr><td>Replicate ID</td><td>Number of Sequences</td></tr>" >> $outputFile
236 while IFS=, read replicate reads squared
237 do
238 echo "<tr><td>$replicate</td><td>$reads</td></tr>" >> $outputFile
239 done < $outputDir/ReplicateReads_$sample.csv
240
241 #sum of reads and reads squared
242 while IFS=, read readsSum squaredSum
243 do
244 echo "<tr><td>Sum</td><td>$readsSum</td></tr>" >> $outputFile
245 done < $outputDir/ReplicateSumReads_$sample.csv
246
247 echo "<tr><td></td><td></td></tr>" >> $outputFile
248
249 #overview
250 echo "<tr><td>Number of replicates containing the coincidence</td><td>Number of sequences shared between replicates</td></tr>" >> $outputFile
251 while IFS=, read type count weight weightedCount
252 do
253 if [[ "$type" -eq "1" ]]; then
254 echo "<tr><td>$type</td><td>$count</td></tr>" >> $outputFile
255 else
256 echo "<tr><td><a href='coincidences_${sample}_${type}.txt'>$type</a></td><td>$count</td></tr>" >> $outputFile
257 fi
258
259 done < $outputDir/ClonalityOverView_$sample.csv
260 echo "</table></div>" >> $outputFile
261 else
262 echo "in new"
263 clonalityScore="$(cat $outputDir/lymphclon_clonality_${sample}.txt)" 229 clonalityScore="$(cat $outputDir/lymphclon_clonality_${sample}.txt)"
264 echo "<div class='tabbertab' title='$sample'>" >> $outputFile 230 echo "<tr><td>Clonality Score: </td><td>$clonalityScore</td></tr>" >> $outputFile
265 echo "Lymphclon clonality score: <br />$clonalityScore<br /><br />" >> $outputFile
266 echo "<table border = 1>" >> $outputFile
267 while read type count
268 do
269 echo "<tr><td>$type</td><td>$count</td></tr>" >> $outputFile
270 done < $outputDir/lymphclon_coincidences_$sample.txt
271 echo "</table></div>" >> $outputFile
272 fi 231 fi
232
233 #replicate,reads,squared
234 echo "<tr><td>Replicate ID</td><td>Number of Sequences</td></tr>" >> $outputFile
235 while read replicate reads squared
236 do
237 echo "<tr><td>$replicate</td><td>$reads</td></tr>" >> $outputFile
238 done < $outputDir/ReplicateReads_$sample.txt
239
240 #sum of reads and reads squared
241 while read readsSum squaredSum
242 do
243 echo "<tr><td>Sum</td><td>$readsSum</td></tr>" >> $outputFile
244 done < $outputDir/ReplicateSumReads_$sample.txt
245
246 echo "<tr><td></td><td></td></tr>" >> $outputFile
247
248 #overview
249 echo "<tr><td>Number of replicates containing the coincidence</td><td>Number of sequences shared between replicates</td></tr>" >> $outputFile
250 while read type count weight weightedCount
251 do
252 if [[ "$type" -eq "1" ]]; then
253 echo "<tr><td>$type</td><td>$count</td></tr>" >> $outputFile
254 else
255 echo "<tr><td><a href='coincidences_${sample}_${type}.txt'>$type</a></td><td>$count</td></tr>" >> $outputFile
256 fi
257 done < $outputDir/ClonalityOverView_$sample.txt
258 echo "</table></div>" >> $outputFile
273 done 259 done
274 260
275 cat $dir/naive_clonality.htm >> $outputFile 261 cat $dir/naive_clonality.htm >> $outputFile
276 262
277 echo "</div></div>" >> $outputFile 263 echo "</div></div>" >> $outputFile
293 echo "</tbody></table>" >> $outputFile 279 echo "</tbody></table>" >> $outputFile
294 280
295 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 281 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
296 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median 282 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
297 do 283 do
298 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 284 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>-</td></tr>" >> $outputFile
299 done < $outputDir/junctionAnalysisUnProd_mean_wD.txt 285 done < $outputDir/junctionAnalysisUnProd_mean_wD.txt
300 echo "</tbody></table>" >> $outputFile 286 echo "</tbody></table>" >> $outputFile
301 287
302 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 288 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
303 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median 289 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
307 echo "</tbody></table>" >> $outputFile 293 echo "</tbody></table>" >> $outputFile
308 294
309 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 295 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
310 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median 296 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
311 do 297 do
312 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 298 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>-</td></tr>" >> $outputFile
313 done < $outputDir/junctionAnalysisUnProd_median_wD.txt 299 done < $outputDir/junctionAnalysisUnProd_median_wD.txt
314 echo "</tbody></table>" >> $outputFile 300 echo "</tbody></table>" >> $outputFile
315 301
316 # again for no-d 302 # again for no-d
317 echo "<center><p style='font-size: 20;'>Unique rearrangements with only a V and J gene assigned</p></center>" >> $outputFile 303 echo "<center><p style='font-size: 20;'>Unique rearrangements with only a V and J gene assigned</p></center>" >> $outputFile
323 echo "</tbody></table>" >> $outputFile 309 echo "</tbody></table>" >> $outputFile
324 310
325 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>N</th><th>P2</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 311 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>N</th><th>P2</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
326 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median 312 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
327 do 313 do
328 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile 314 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>-</td></tr>" >> $outputFile
329 done < $outputDir/junctionAnalysisUnProd_mean_nD.txt 315 done < $outputDir/junctionAnalysisUnProd_mean_nD.txt
330 echo "</tbody></table>" >> $outputFile 316 echo "</tbody></table>" >> $outputFile
331 317
332 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>N</th><th>P2</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 318 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>N</th><th>P2</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
333 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median 319 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
337 echo "</tbody></table>" >> $outputFile 323 echo "</tbody></table>" >> $outputFile
338 324
339 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>N</th><th>P2</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 325 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>N</th><th>P2</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
340 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median 326 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
341 do 327 do
342 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile 328 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>-/td></tr>" >> $outputFile
343 done < $outputDir/junctionAnalysisUnProd_median_nD.txt 329 done < $outputDir/junctionAnalysisUnProd_median_nD.txt
344 echo "</tbody></table>" >> $outputFile 330 echo "</tbody></table>" >> $outputFile
345 331
346 cat $dir/naive_junction.htm >> $outputFile 332 cat $dir/naive_junction.htm >> $outputFile
347 333