comparison r_wrapper.sh @ 3:b850200d4335 draft

Uploaded
author davidvanzessen
date Thu, 15 May 2014 09:30:54 -0400
parents fd1b76816395
children c7d3b68040d7
comparison
equal deleted inserted replaced
2:fd1b76816395 3:b850200d4335
2 2
3 inputFile=$1 3 inputFile=$1
4 outputDir=$3 4 outputDir=$3
5 outputFile=$3/index.html #$2 5 outputFile=$3/index.html #$2
6 clonalType=$4 6 clonalType=$4
7 species=$5
8 locus=$6
9 selection=$7
10 useD="true"
11 if [[ "$species" == "human" && "$locus" = "tra" ]] ; then
12 useD="false"
13 fi
7 dir="$(cd "$(dirname "$0")" && pwd)" 14 dir="$(cd "$(dirname "$0")" && pwd)"
8 mkdir $3 15 mkdir $3
9 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType 2>&1 16 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType $species $locus $selection 2>&1
10 cp $dir/tabber.js $outputDir 17 cp $dir/tabber.js $outputDir
11 cp $dir/style.css $outputDir 18 cp $dir/style.css $outputDir
12 cp $dir/script.js $outputDir 19 cp $dir/script.js $outputDir
13 cp $dir/jquery-1.11.0.min.js $outputDir 20 cp $dir/jquery-1.11.0.min.js $outputDir
14 cp $dir/jquery.tablesorter.min.js $outputDir 21 cp $dir/jquery.tablesorter.min.js $outputDir
24 echo "<link rel='stylesheet' type='text/css' href='style.css'></head>" >> $outputFile 31 echo "<link rel='stylesheet' type='text/css' href='style.css'></head>" >> $outputFile
25 echo "<div class='tabber'><div class='tabbertab' title='Gene frequencies'>" >> $outputFile 32 echo "<div class='tabber'><div class='tabbertab' title='Gene frequencies'>" >> $outputFile
26 33
27 echo "<img src='CDR3LengthPlot.png'/><br />" >> $outputFile 34 echo "<img src='CDR3LengthPlot.png'/><br />" >> $outputFile
28 echo "<img src='VFPlot.png'/>" >> $outputFile 35 echo "<img src='VFPlot.png'/>" >> $outputFile
29 echo "<img src='DFPlot.png'/>" >> $outputFile 36 if [[ "$useD" == "true" ]] ; then
37 echo "<img src='DFPlot.png'/>" >> $outputFile
38 fi
30 echo "<img src='JFPlot.png'/>" >> $outputFile 39 echo "<img src='JFPlot.png'/>" >> $outputFile
31 echo "<img src='VPlot.png'/>" >> $outputFile 40 echo "<img src='VPlot.png'/>" >> $outputFile
32 echo "<img src='DPlot.png'/>" >> $outputFile 41 if [[ "$useD" == "true" ]] ; then
42 echo "<img src='DPlot.png'/>" >> $outputFile
43 fi
33 echo "<img src='JPlot.png'/></div>" >> $outputFile 44 echo "<img src='JPlot.png'/></div>" >> $outputFile
34 45
35 samples=`cat $outputDir/samples.txt` 46 samples=`cat $outputDir/samples.txt`
36 count=1 47 count=1
37 echo "<div class='tabbertab' title='Heatmaps'><div class='tabber'>" >> $outputFile 48 echo "<div class='tabbertab' title='Heatmaps'><div class='tabber'>" >> $outputFile
38 for sample in $samples; do 49 for sample in $samples; do
39 echo "<div class='tabbertab' title='$sample'><table border='1'><tr>" >> $outputFile 50 echo "<div class='tabbertab' title='$sample'><table border='1'><tr>" >> $outputFile
40 echo "<td><img src='HeatmapVD_$sample.png'/></td>" >> $outputFile 51 if [[ "$useD" == "true" ]] ; then
52 echo "<td><img src='HeatmapVD_$sample.png'/></td>" >> $outputFile
53 fi
41 echo "<td><img src='HeatmapVJ_$sample.png'/></td>" >> $outputFile 54 echo "<td><img src='HeatmapVJ_$sample.png'/></td>" >> $outputFile
42 echo "<td><img src='HeatmapDJ_$sample.png'/></td></tr></table></div>" >> $outputFile 55 if [[ "$useD" == "true" ]] ; then
56 echo "<td><img src='HeatmapDJ_$sample.png'/></td>" >> $outputFile
57 fi
58 echo "</tr></table></div>" >> $outputFile
43 count=$((count+1)) 59 count=$((count+1))
44 done 60 done
45 echo "</div></div>" >> $outputFile 61 echo "</div></div>" >> $outputFile
46 62
47 63
108 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 124 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
109 125
110 echo "<tr><td>The dataset used to generate the CDR3 length frequency graph</td><td><a href='CDR3LengthPlot.csv'>Download</a></td></tr>" >> $outputFile 126 echo "<tr><td>The dataset used to generate the CDR3 length frequency graph</td><td><a href='CDR3LengthPlot.csv'>Download</a></td></tr>" >> $outputFile
111 127
112 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 128 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
113 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 129 if [[ "$useD" == "true" ]] ; then
130 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
131 fi
114 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 132 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
115 133
116 echo "<tr><td>The dataset used to generate the V gene frequency graph</td><td><a href='VFrequency.csv'>Download</a></td></tr>" >> $outputFile 134 echo "<tr><td>The dataset used to generate the V gene frequency graph</td><td><a href='VFrequency.csv'>Download</a></td></tr>" >> $outputFile
117 echo "<tr><td>The dataset used to generate the D gene frequency graph</td><td><a href='DFrequency.csv'>Download</a></td></tr>" >> $outputFile 135 if [[ "$useD" == "true" ]] ; then
136 echo "<tr><td>The dataset used to generate the D gene frequency graph</td><td><a href='DFrequency.csv'>Download</a></td></tr>" >> $outputFile
137 fi
118 echo "<tr><td>The dataset used to generate the J gene frequency graph</td><td><a href='JFrequency.csv'>Download</a></td></tr>" >> $outputFile 138 echo "<tr><td>The dataset used to generate the J gene frequency graph</td><td><a href='JFrequency.csv'>Download</a></td></tr>" >> $outputFile
119 139
120 for sample in $samples; do 140 for sample in $samples; do
121 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 141 if [[ "$useD" == "true" ]] ; then
142 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
143 fi
122 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 144 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
123 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 145 if [[ "$useD" == "true" ]] ; then
146 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
147 fi
124 done 148 done
125 149
126 echo "</table>" >> $outputFile 150 echo "</table>" >> $outputFile
127 echo "</div></html>" >> $outputFile 151 echo "</div></html>" >> $outputFile