comparison r_wrapper.sh @ 6:18ac92a69ef1 draft

Uploaded
author davidvanzessen
date Tue, 18 Mar 2014 09:03:54 -0400
parents 99834201251f
children 1d0ed31089c6
comparison
equal deleted inserted replaced
5:99834201251f 6:18ac92a69ef1
8 mkdir $3 8 mkdir $3
9 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType 2>&1 9 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType 2>&1
10 cp $dir/tabber.js $outputDir 10 cp $dir/tabber.js $outputDir
11 cp $dir/style.css $outputDir 11 cp $dir/style.css $outputDir
12 cp $dir/script.js $outputDir 12 cp $dir/script.js $outputDir
13 cp $dir/jquery-1.11.0.min.js $outputDir
14 cp $dir/jquery.tablesorter.min.js $outputDir
15 cp $dir/asc.gif $outputDir
16 cp $dir/desc.gif $outputDir
17 cp $dir/bg.gif $outputDir
13 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)</center></html>" > $2 18 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)</center></html>" > $2
14 echo "<html><script type='text/javascript' src='tabber.js'></script><script type='text/javascript' src='script.js'></script><link rel='stylesheet' type='text/css' href='style.css'><div class='tabber'><div class='tabbertab' title='Gene frequencies'>" >> $outputFile 19 echo "<html<head>" >> $outputFile
20 echo "<script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $outputFile
21 echo "<script type='text/javascript' src='tabber.js'></script>" >> $outputFile
22 echo "<script type='text/javascript' src='script.js'></script>" >> $outputFile
23 echo "<script type='text/javascript' src='jquery.tablesorter.min.js'></script>" >> $outputFile
24 echo "<link rel='stylesheet' type='text/css' href='style.css'></head>" >> $outputFile
25 echo "<div class='tabber'><div class='tabbertab' title='Gene frequencies'>" >> $outputFile
26
27 echo "<img src='VFPlot.png'/>" >> $outputFile
28 echo "<img src='DFPlot.png'/>" >> $outputFile
29 echo "<img src='JFPlot.png'/>" >> $outputFile
15 echo "<img src='VPlot.png'/>" >> $outputFile 30 echo "<img src='VPlot.png'/>" >> $outputFile
16 echo "<img src='DPlot.png'/>" >> $outputFile 31 echo "<img src='DPlot.png'/>" >> $outputFile
17 echo "<img src='JPlot.png'/></div>" >> $outputFile 32 echo "<img src='JPlot.png'/></div>" >> $outputFile
18 33
19 samples=`cat $outputDir/samples.txt` 34 samples=`cat $outputDir/samples.txt`
20 count=1 35 count=1
21 echo "<div class='tabbertab' title='Heatmaps'><div class='tabber'>" >> $outputFile 36 echo "<div class='tabbertab' title='Heatmaps'><div class='tabber'>" >> $outputFile
22 for sample in $samples; do 37 for sample in $samples; do
23 echo "<div class='tabbertab' title='$sample'><table border='1'><tr>" >> $outputFile 38 echo "<div class='tabbertab' title='$sample'><table border='1'><tr>" >> $outputFile
24 39 echo "<td><img src='HeatmapVD_$sample.png'/></td>" >> $outputFile
25 mv "$outputDir/HeatmapVD_$sample.png" "$outputDir/VD_$sample.png" 40 echo "<td><img src='HeatmapVJ_$sample.png'/></td>" >> $outputFile
26 echo "<td><img src='VD_$sample.png'/></td>" >> $outputFile 41 echo "<td><img src='HeatmapDJ_$sample.png'/></td></tr></table></div>" >> $outputFile
27 mv "$outputDir/HeatmapVJ_$sample.png" "$outputDir/VJ_$sample.png"
28 echo "<td><img src='VJ_$sample.png'/></td>" >> $outputFile
29 mv "$outputDir/HeatmapDJ_$sample.png" "$outputDir/DJ_$sample.png"
30 echo "<td><img src='DJ_$sample.png'/></td></tr></table></div>" >> $outputFile
31 count=$((count+1)) 42 count=$((count+1))
32 done 43 done
33 echo "</div></div>" >> $outputFile 44 echo "</div></div>" >> $outputFile
34 45
35 46
67 done 78 done
68 echo "</div></div>" >> $outputFile 79 echo "</div></div>" >> $outputFile
69 fi 80 fi
70 81
71 if [[ "$hasReplicateColumn" == "Yes" ]] ; then 82 if [[ "$hasReplicateColumn" == "Yes" ]] ; then
72 echo "<div class='tabbertab' title='Junction Analysis'><table border='1'><tr><th>Sample</th><th>unique</th><th>VH.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.DH</th><th>DH.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.JH</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th></tr>" >> $outputFile 83 echo "<div class='tabbertab' title='Junction Analysis'><table border='1' id='junction_table' class='tablesorter'><thead><tr><th>Sample</th><th>unique</th><th>VH.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.DH</th><th>DH.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.JH</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><thead></tr><tbody>" >> $outputFile
73 while IFS=, read Sample unique VHDEL P1 N1 P2 DELDH DHDEL P3 N2 P4 DELJH TotalDel TotalN TotalP 84 while IFS=, read Sample unique VHDEL P1 N1 P2 DELDH DHDEL P3 N2 P4 DELJH TotalDel TotalN TotalP
74 do 85 do
75 echo "<tr><td>$Sample</td><td>$unique</td><td>$VHDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELDH</td><td>$DHDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJH</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td></tr>" >> $outputFile 86 echo "<tr><td>$Sample</td><td>$unique</td><td>$VHDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELDH</td><td>$DHDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJH</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td></tr>" >> $outputFile
76 done < $outputDir/junctionAnalysis.csv 87 done < $outputDir/junctionAnalysis.csv
77 echo "</table></div>" >> $outputFile 88 echo "</tbody></table></div>" >> $outputFile
78 fi 89 fi
79 90
80 echo "<div class='tabbertab' title='Comparison'><table border='1'><tr><th>ID</th><th>Include</th></tr>" >> $outputFile 91 echo "<div class='tabbertab' title='Comparison'><table border='1'><tr><th>ID</th><th>Include</th></tr>" >> $outputFile
81 for sample in $samples; do 92 for sample in $samples; do
82 echo "<tr><td>$sample</td><td><input type='checkbox' onchange=\"javascript:compareAdd('$sample')\" id='compare_checkbox_$sample'/></td></tr>" >> $outputFile 93 echo "<tr><td>$sample</td><td><input type='checkbox' onchange=\"javascript:compareAdd('$sample')\" id='compare_checkbox_$sample'/></td></tr>" >> $outputFile
88 echo "</div></div>" >> $outputFile 99 echo "</div></div>" >> $outputFile
89 100
90 echo "<div class='tabbertab' title='Downloads'>" >> $outputFile 101 echo "<div class='tabbertab' title='Downloads'>" >> $outputFile
91 echo "<table border='1'>" >> $outputFile 102 echo "<table border='1'>" >> $outputFile
92 echo "<tr><th>Description</th><th>Link</th></tr>" >> $outputFile 103 echo "<tr><th>Description</th><th>Link</th></tr>" >> $outputFile
93 echo "<tr><td>The dataset used to generate the frequency graphs and the heatmaps (Unique based on clonaltype, $clonalType)</td><td><a href='allUnique.tsv'>Download</a></td></tr>" >> $outputFile 104 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
94 echo "<tr><td>The dataset used to calculate clonality score (Unique based on clonaltype, $clonalType)</td><td><a href='clonalityComplete.tsv'>Download</a></td></tr>" >> $outputFile 105 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
106
107 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
108 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
109 echo "<tr><td>The dataset used to generate the J gene family frequency graph</td><td><a href='JFFrequency.csv'>Download</a></td></tr>" >> $outputFile
110
111 echo "<tr><td>The dataset used to generate the V gene frequency graph</td><td><a href='VFrequency.csv'>Download</a></td></tr>" >> $outputFile
112 echo "<tr><td>The dataset used to generate the D gene frequency graph</td><td><a href='DFrequency.csv'>Download</a></td></tr>" >> $outputFile
113 echo "<tr><td>The dataset used to generate the J gene frequency graph</td><td><a href='JFrequency.csv'>Download</a></td></tr>" >> $outputFile
114
115 for sample in $samples; do
116 echo "<tr><td>The data used to generate the VD heatmap for $sample.</td><td><a href='HeatmapVD_$sample.csv'>Download</a></td></tr>" >> $outputFile
117 echo "<tr><td>The data used to generate the VJ heatmap for $sample.</td><td><a href='HeatmapVJ_$sample.csv'>Download</a></td></tr>" >> $outputFile
118 echo "<tr><td>The data used to generate the DJ heatmap for $sample.</td><td><a href='HeatmapDJ_$sample.csv'>Download</a></td></tr>" >> $outputFile
119 done
120
95 echo "</table>" >> $outputFile 121 echo "</table>" >> $outputFile
96 echo "</div>" >> $outputFile 122 echo "</div></html>" >> $outputFile