Mercurial > repos > davidvanzessen > argalaxy_tools
diff report_clonality/r_wrapper.sh @ 26:28fbbdfd7a87 draft
Uploaded
author | davidvanzessen |
---|---|
date | Mon, 13 Feb 2017 09:08:46 -0500 |
parents | 94765af0db1f |
children | b539aeb75980 |
line wrap: on
line diff
--- a/report_clonality/r_wrapper.sh Thu Feb 09 07:20:09 2017 -0500 +++ b/report_clonality/r_wrapper.sh Mon Feb 13 09:08:46 2017 -0500 @@ -222,54 +222,40 @@ for sample in $samples; do echo "${clonality_method}" - if [[ "${clonality_method}" == "old" ]] ; then - echo "in old" - clonalityScore="$(cat $outputDir/ClonalityScore_$sample.csv)" - echo "<div class='tabbertab' title='$sample'><table class='pure-table pure-table-striped'>" >> $outputFile - - if [[ "${clonality_method}" == "boyd" ]] ; then - echo "<thead><tr><th colspan='2'>Clonality Score: $clonalityScore</th></tr></thead>" >> $outputFile - fi - - #replicate,reads,squared - echo "<tr><td>Replicate ID</td><td>Number of Sequences</td></tr>" >> $outputFile - while IFS=, read replicate reads squared - do - echo "<tr><td>$replicate</td><td>$reads</td></tr>" >> $outputFile - done < $outputDir/ReplicateReads_$sample.csv - - #sum of reads and reads squared - while IFS=, read readsSum squaredSum - do - echo "<tr><td>Sum</td><td>$readsSum</td></tr>" >> $outputFile - done < $outputDir/ReplicateSumReads_$sample.csv - - echo "<tr><td></td><td></td></tr>" >> $outputFile - - #overview - echo "<tr><td>Number of replicates containing the coincidence</td><td>Number of sequences shared between replicates</td></tr>" >> $outputFile - while IFS=, read type count weight weightedCount - do - if [[ "$type" -eq "1" ]]; then - echo "<tr><td>$type</td><td>$count</td></tr>" >> $outputFile - else - echo "<tr><td><a href='coincidences_${sample}_${type}.txt'>$type</a></td><td>$count</td></tr>" >> $outputFile - fi - - done < $outputDir/ClonalityOverView_$sample.csv - echo "</table></div>" >> $outputFile - else - echo "in new" + + echo "<div class='tabbertab' title='$sample'><table class='pure-table pure-table-striped'>" >> $outputFile + + if [[ "${clonality_method}" == "boyd" ]] ; then clonalityScore="$(cat $outputDir/lymphclon_clonality_${sample}.txt)" - echo "<div class='tabbertab' title='$sample'>" >> $outputFile - echo "Lymphclon clonality score: <br />$clonalityScore<br /><br />" >> $outputFile - echo "<table border = 1>" >> $outputFile - while read type count - do - echo "<tr><td>$type</td><td>$count</td></tr>" >> $outputFile - done < $outputDir/lymphclon_coincidences_$sample.txt - echo "</table></div>" >> $outputFile + echo "<tr><td>Clonality Score: </td><td>$clonalityScore</td></tr>" >> $outputFile fi + + #replicate,reads,squared + echo "<tr><td>Replicate ID</td><td>Number of Sequences</td></tr>" >> $outputFile + while read replicate reads squared + do + echo "<tr><td>$replicate</td><td>$reads</td></tr>" >> $outputFile + done < $outputDir/ReplicateReads_$sample.txt + + #sum of reads and reads squared + while read readsSum squaredSum + do + echo "<tr><td>Sum</td><td>$readsSum</td></tr>" >> $outputFile + done < $outputDir/ReplicateSumReads_$sample.txt + + echo "<tr><td></td><td></td></tr>" >> $outputFile + + #overview + echo "<tr><td>Number of replicates containing the coincidence</td><td>Number of sequences shared between replicates</td></tr>" >> $outputFile + while read type count weight weightedCount + do + if [[ "$type" -eq "1" ]]; then + echo "<tr><td>$type</td><td>$count</td></tr>" >> $outputFile + else + echo "<tr><td><a href='coincidences_${sample}_${type}.txt'>$type</a></td><td>$count</td></tr>" >> $outputFile + fi + done < $outputDir/ClonalityOverView_$sample.txt + echo "</table></div>" >> $outputFile done cat $dir/naive_clonality.htm >> $outputFile @@ -295,7 +281,7 @@ 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 while 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 + 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 done < $outputDir/junctionAnalysisUnProd_mean_wD.txt echo "</tbody></table>" >> $outputFile @@ -309,7 +295,7 @@ 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 while 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 + 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 done < $outputDir/junctionAnalysisUnProd_median_wD.txt echo "</tbody></table>" >> $outputFile @@ -325,7 +311,7 @@ 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 while read Sample unique VDEL P1 N1 P2 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>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile + 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 done < $outputDir/junctionAnalysisUnProd_mean_nD.txt echo "</tbody></table>" >> $outputFile @@ -339,7 +325,7 @@ 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 while read Sample unique VDEL P1 N1 P2 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>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile + 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 done < $outputDir/junctionAnalysisUnProd_median_nD.txt echo "</tbody></table>" >> $outputFile