Mercurial > repos > davidvanzessen > plotting_merged
comparison r_wrapper.sh @ 50:e6209052aaf4 draft
Uploaded
author | davidvanzessen |
---|---|
date | Mon, 09 Dec 2013 05:46:53 -0500 |
parents | dea2d3353a42 |
children |
comparison
equal
deleted
inserted
replaced
49:3da85f1a7f42 | 50:e6209052aaf4 |
---|---|
15 echo "<img src='DPlot.png'/>" >> $2 | 15 echo "<img src='DPlot.png'/>" >> $2 |
16 echo "<img src='JPlot.png'/>" >> $2 | 16 echo "<img src='JPlot.png'/>" >> $2 |
17 | 17 |
18 samples=`cat $outputDir/samples.txt` | 18 samples=`cat $outputDir/samples.txt` |
19 count=1 | 19 count=1 |
20 echo "<table border='1'><caption><h3>$clonalType</h3></caption>" >> $outputFile | 20 echo "<table border='1'><caption><a href='allUnique.tsv'><h3>$clonalType</h3></a></caption>" >> $outputFile |
21 hasReplicateColumn="$(if head -n 1 $inputFile | grep -q 'Replicate'; then echo 'Yes'; else echo 'No'; fi)" | |
21 for sample in $samples; do | 22 for sample in $samples; do |
22 clonalityScore="$(cat $outputDir/ClonalityScore_$sample.csv)" | 23 clonalityScore="$(cat $outputDir/ClonalityScore_$sample.csv)" |
23 echo "<tr><td colspan='3' height='100'></td></tr>" >> $outputFile | 24 echo "<tr><td colspan='3' height='100'></td></tr>" >> $outputFile |
24 echo "<tr><td colspan='3'><h1>$sample</h1></td></tr>" >> $outputFile | 25 echo "<tr><td colspan='3'><h1>$sample</h1></td></tr>" >> $outputFile |
25 | 26 |
27 echo "$hasReplicateColumn" | |
26 #if its a 'new' merged file with replicate info | 28 #if its a 'new' merged file with replicate info |
27 if head -n 1 $inputFile | grep -q "Replicate" | 29 if [[ "$hasReplicateColumn" == "Yes" ]] ; then |
28 then | 30 echo "<tr><td colspan='3'><a href='clonality_$sample.tsv'><h2>Clonality Score: $clonalityScore</h2></a></td></tr>" >> $outputFile |
29 echo "<tr><td colspan='3'><h2>Clonality Score: $clonalityScore</h2></td></tr>" >> $outputFile | |
30 | 31 |
31 #replicate,reads,squared | 32 #replicate,reads,squared |
32 echo "<tr><td colspan='3'><table border='1'><tr><th>Replicate ID</th><th>Number of Reads</th><th>Reads Squared</th></tr>" >> $outputFile | 33 echo "<tr><td colspan='3'><table border='1'><tr><th>Replicate ID</th><th>Number of Reads</th><th>Reads Squared</th></tr>" >> $outputFile |
33 while IFS=, read replicate reads squared | 34 while IFS=, read replicate reads squared |
34 do | 35 do |
35 | 36 |
36 echo "<tr><td>$replicate</td><td>$reads</td><td>$squared</td></tr>" >> $outputFile | 37 echo "<tr><td><a href='clonality_${sample}_$replicate.tsv'>$replicate</a></td><td>$reads</td><td>$squared</td></tr>" >> $outputFile |
37 done < $outputDir/ReplicateReads_$sample.csv | 38 done < $outputDir/ReplicateReads_$sample.csv |
38 | 39 |
39 #sum of reads and reads squared | 40 #sum of reads and reads squared |
40 while IFS=, read readsSum squaredSum | 41 while IFS=, read readsSum squaredSum |
41 do | 42 do |