5
|
1 #!/bin/bash
|
|
2
|
|
3 inputFile=$1
|
|
4 outputDir=$3
|
|
5 outputFile=$3/index.html #$2
|
|
6 clonalType=$4
|
|
7 species=$5
|
|
8 locus=$6
|
|
9 filterproductive=$7
|
|
10 clonality_method=$8
|
|
11
|
|
12 dir="$(cd "$(dirname "$0")" && pwd)"
|
|
13 useD="false"
|
|
14 if grep -q "$species.*${locus}D" "$dir/genes.txt" ; then
|
|
15 echo "species D region in reference db"
|
|
16 useD="true"
|
|
17 fi
|
|
18 echo "$species"
|
|
19 if [[ "$species" == *"custom"* ]] ; then
|
|
20 loci=(${locus//;/ })
|
|
21 useD="true"
|
|
22 echo "${loci[@]}"
|
|
23 if [[ "${#loci[@]}" -eq "2" ]] ; then
|
|
24 useD="false"
|
|
25 fi
|
|
26 fi
|
|
27 mkdir $3
|
|
28 cp $dir/genes.txt $outputDir
|
|
29 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType "$species" "$locus" $filterproductive ${clonality_method} 2>&1
|
|
30 cp $dir/tabber.js $outputDir
|
|
31 cp $dir/style.css $outputDir
|
|
32 cp $dir/script.js $outputDir
|
|
33 cp $dir/jquery-1.11.0.min.js $outputDir
|
|
34 cp $dir/pure-min.css $outputDir
|
17
|
35 cp $dir/IGH_junctie_analyse.png $outputDir
|
5
|
36 samples=`cat $outputDir/samples.txt`
|
|
37
|
|
38 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)<br />" > $2
|
|
39 echo "<table border = 1>" >> $2
|
19
|
40 echo "<thead><tr><th>Donor/Replicate</th><th>All</th><th>Productive</th><th>Unique Productive</th><th>Unproductive</th><th>Unique Unproductive</th></tr></thead>" >> $2
|
5
|
41 while IFS=, read sample all productive perc_prod productive_unique perc_prod_un unproductive perc_unprod unproductive_unique perc_unprod_un
|
|
42 do
|
|
43 echo "<tr><td>$sample</td>" >> $2
|
|
44 echo "<td>$all</td>" >> $2
|
40
|
45 if [[ "$productive" != "0" ]] ; then
|
|
46 echo "<td>$productive (${perc_prod}%)</td>" >> $2
|
|
47 echo "<td>$productive_unique (${perc_prod_un}%)</td>" >> $2
|
|
48 echo "<td>$unproductive (${perc_unprod}%)</td>" >> $2
|
|
49 echo "<td>$unproductive_unique (${perc_unprod_un}%)</td></tr>" >> $2
|
|
50 else
|
|
51 echo "<td colspan='4' style='background-color: red;'>No productive sequences!</td>" >> $2
|
|
52 fi
|
5
|
53 done < $outputDir/productive_counting.txt
|
18
|
54 echo "</table><br />" >> $2
|
19
|
55 echo "Table showing the number and percentage of (unique) productive and unproductive sequences per donor and per replicate. <br />" >> $2
|
18
|
56 echo "The definition of unique sequences is based on the clonal type definition filter setting chosen. " >> $2
|
|
57 echo "</center></html>" >> $2
|
5
|
58
|
|
59 echo "<html><head><title>Report on:" >> $outputFile
|
|
60
|
|
61 mkdir $outputDir/circos
|
|
62 cp $dir/circos/* $outputDir/circos/
|
|
63 #CIRCOSTOOLS="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/circos-tools-0.21/tools"
|
|
64 #CIRCOSDIR="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/"
|
|
65
|
|
66 #CIRCOSTOOLS="/home/galaxy/circos/circos-tools-0.22/tools"
|
|
67 #CIRCOSDIR="/home/galaxy/Anaconda3/bin"
|
|
68
|
|
69 USECIRCOS="no"
|
|
70 if [ -d "$CIRCOSDIR" ]; then
|
|
71 USECIRCOS="yes"
|
|
72 else
|
12
|
73 if [ -d "/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/" ]; then #hopefully temporary fix
|
5
|
74 USECIRCOS="yes"
|
|
75 CIRCOSTOOLS="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/circos-tools-0.21/tools"
|
|
76 CIRCOSDIR="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/"
|
|
77 fi
|
12
|
78
|
24
|
79 if [ -d "/home/galaxy/Anaconda3/bin" ]; then #hopefully temporary fix #or not
|
12
|
80 USECIRCOS="yes"
|
|
81 CIRCOSTOOLS="/home/galaxy/circos/circos-tools-0.22/tools"
|
|
82 CIRCOSDIR="/home/galaxy/Anaconda3/bin"
|
|
83 fi
|
44
|
84
|
|
85 if [ -d "/media/galaxy/data/other_backup/circos/galaxian-circos//bin" ]; then #hopefully temporary fix #or not #really not
|
|
86 USECIRCOS="yes"
|
|
87 CIRCOSTOOLS="/media/galaxy/data/other_backup/circos/galaxian-circos/tools"
|
|
88 CIRCOSDIR="/media/galaxy/data/other_backup/circos/galaxian-circos/bin"
|
|
89 fi
|
5
|
90 fi
|
12
|
91
|
5
|
92 echo "Using Circos: $USECIRCOS"
|
|
93 sed -i "s%DATA_DIR%$outputDir/circos%" $outputDir/circos/circos.conf
|
|
94 for sample in $samples; do #output the samples to a file and create the circos plots with the R script output
|
|
95 echo " $sample" >> $outputFile
|
|
96
|
|
97 if [[ "$USECIRCOS" != "yes" ]]; then
|
|
98 continue
|
|
99 fi
|
|
100
|
|
101 circos_file="$outputDir/${sample}_VJ_circos.txt"
|
45
|
102 sed -i -- 's%/%:%g' $circos_file
|
5
|
103 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
|
44
|
104 echo "Circos tools command:"
|
|
105 echo "cat \"${circos_file}\" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/"
|
5
|
106 cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/
|
45
|
107
|
44
|
108 echo "Circos command:"
|
|
109 echo "$CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1"
|
5
|
110 $CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1
|
|
111 mv $outputDir/circos/circos.png $outputDir/circosVJ_${sample}.png
|
36
|
112 mv $outputDir/circos/circos.svg $outputDir/circosVJ_${sample}.svg
|
5
|
113
|
|
114
|
|
115 if [[ "$useD" == "true" ]] ; then
|
|
116 circos_file="$outputDir/${sample}_VD_circos.txt"
|
45
|
117 sed -i -- 's%/%:%g' $circos_file
|
5
|
118 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
|
|
119 cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/
|
44
|
120 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt
|
5
|
121 $CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1
|
|
122 mv $outputDir/circos/circos.png $outputDir/circosVD_${sample}.png
|
36
|
123 mv $outputDir/circos/circos.svg $outputDir/circosVD_${sample}.svg
|
5
|
124
|
|
125 circos_file="$outputDir/${sample}_DJ_circos.txt"
|
45
|
126 sed -i -- 's%/%:%g' $circos_file
|
5
|
127 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
|
|
128 cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/
|
44
|
129 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt
|
5
|
130 $CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1
|
|
131 mv $outputDir/circos/circos.png $outputDir/circosDJ_${sample}.png
|
36
|
132 mv $outputDir/circos/circos.svg $outputDir/circosDJ_${sample}.svg
|
5
|
133 fi
|
|
134 done
|
|
135 echo "</title><script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $outputFile
|
|
136 echo "<link rel='stylesheet' type='text/css' href='pure-min.css'>" >> $outputFile
|
|
137 echo "<script type='text/javascript' src='tabber.js'></script>" >> $outputFile
|
|
138 echo "<script type='text/javascript' src='script.js'></script>" >> $outputFile
|
|
139 echo "<link rel='stylesheet' type='text/css' href='style.css'></head>" >> $outputFile
|
|
140 echo "<div class='tabber'><div class='tabbertab' title='Gene frequencies'>" >> $outputFile
|
|
141
|
8
|
142
|
32
|
143 echo "<a href='VFPlot.pdf'><img src='VFPlot.png'/></a>" >> $outputFile
|
5
|
144 if [[ "$useD" == "true" ]] ; then
|
32
|
145 echo "<a href='DFPlot.pdf'><img src='DFPlot.png'/></a>" >> $outputFile
|
5
|
146 fi
|
32
|
147 echo "<a href='VPlot.pdf'><img src='VPlot.png'/></a>" >> $outputFile
|
5
|
148 if [[ "$useD" == "true" ]] ; then
|
32
|
149 echo "<a href='DPlot.pdf'><img src='DPlot.png'/></a>" >> $outputFile
|
5
|
150 fi
|
32
|
151 echo "<a href='JPlot.pdf'><img src='JPlot.png'/></a> <br />" >> $outputFile
|
24
|
152
|
32
|
153 echo "<a href='DReadingFrame.pdf'><img src='DReadingFrame.png'/></a>" >> $outputFile
|
18
|
154
|
|
155 cat $dir/naive_gene_freq.htm >> $outputFile
|
|
156
|
8
|
157 echo "</div>" >> $outputFile
|
|
158
|
|
159 echo "<div class='tabbertab' title='CDR3 Characteristics'>" >> $outputFile
|
32
|
160 echo "<a href='CDR3LengthPlot.pdf'><img src='CDR3LengthPlot.png'/></a><br />" >> $outputFile
|
|
161 echo "<a href='AAComposition.pdf'><img src='AAComposition.png'/></a>" >> $outputFile
|
24
|
162
|
8
|
163
|
|
164 echo "<table class='pure-table pure-table-striped'>" >> $outputFile
|
19
|
165 echo "<thead><tr><th>Donor</th><th>Median CDR3 Length</th></tr></thead>" >> $outputFile
|
24
|
166 while read Sample median
|
8
|
167 do
|
|
168 echo "<tr><td>$Sample</td><td>$median</td></tr>" >> $outputFile
|
24
|
169 done < $outputDir/AAMedianBySample.txt
|
8
|
170 echo "</table>" >> $outputFile
|
|
171
|
18
|
172 cat $dir/naive_cdr3_char.htm >> $outputFile
|
|
173
|
5
|
174 echo "</div>" >> $outputFile
|
|
175
|
|
176 #Heatmaps
|
|
177
|
|
178 count=1
|
|
179 echo "<div class='tabbertab' title='Heatmaps'><div class='tabber'>" >> $outputFile
|
|
180 for sample in $samples; do
|
|
181 echo "<div class='tabbertab' title='$sample'><table border='1'><tr>" >> $outputFile
|
|
182 if [[ "$useD" == "true" ]] ; then
|
32
|
183 echo "<td><a href='HeatmapVD_$sample.pdf'><img src='HeatmapVD_$sample.png'/></a></td>" >> $outputFile
|
5
|
184 fi
|
32
|
185 echo "<td><a href='HeatmapVJ_$sample.pdf'><img src='HeatmapVJ_$sample.png'/></a></td>" >> $outputFile
|
5
|
186 if [[ "$useD" == "true" ]] ; then
|
32
|
187 echo "<td><a href='HeatmapDJ_$sample.pdf'><img src='HeatmapDJ_$sample.png'/></a></td>" >> $outputFile
|
5
|
188 fi
|
|
189 echo "</tr></table></div>" >> $outputFile
|
|
190 count=$((count+1))
|
|
191 done
|
18
|
192
|
|
193 cat $dir/naive_heatmap.htm >> $outputFile
|
|
194
|
5
|
195 echo "</div></div>" >> $outputFile
|
|
196
|
18
|
197 echo "<div class='tabbertab' title='Compare Heatmaps'><table class='pure-table pure-table-striped'><thead><tr><th>ID</th><th>Include</th></tr></thead>" >> $outputFile
|
|
198 for sample in $samples; do
|
|
199 echo "<tr><td>$sample</td><td><input type='checkbox' onchange=\"javascript:compareAdd('$sample')\" id='compare_checkbox_$sample'/></td></tr>" >> $outputFile
|
|
200 done
|
|
201 echo "</table><div name='comparisonarea'>" >> $outputFile
|
|
202 echo "<table><tr id='comparison_table_vd'></tr></table>" >> $outputFile
|
|
203 echo "<table><tr id='comparison_table_vj'></tr></table>" >> $outputFile
|
|
204 echo "<table><tr id='comparison_table_dj'></tr></table>" >> $outputFile
|
|
205
|
|
206 cat $dir/naive_compare.htm >> $outputFile
|
|
207
|
|
208 echo "</div></div>" >> $outputFile
|
|
209
|
|
210
|
5
|
211 #circos
|
|
212
|
|
213 if [[ "$USECIRCOS" == "yes" ]]; then
|
|
214
|
|
215 echo "<div class='tabbertab' title='Circos'><div class='tabber'>" >> $outputFile
|
|
216 for sample in $samples; do
|
|
217 echo "<div class='tabbertab' title='$sample'><table border='1'><center>" >> $outputFile
|
|
218 if [[ "$useD" == "true" ]] ; then
|
35
|
219 echo "<tr><td>V-D</td><td><a href='circosVD_${sample}.svg'><img src='circosVD_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
|
5
|
220 fi
|
35
|
221 echo "<tr><td>V-J</td><td><a href='circosVJ_${sample}.svg'><img src='circosVJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
|
5
|
222 if [[ "$useD" == "true" ]] ; then
|
35
|
223 echo "<tr><td>D-J</td><td><a href='circosDJ_${sample}.svg'><img src='circosDJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
|
5
|
224 fi
|
|
225 echo "<center></table></div>" >> $outputFile
|
|
226 count=$((count+1))
|
|
227 done
|
18
|
228
|
|
229 cat $dir/naive_circos.htm >> $outputFile
|
|
230
|
5
|
231 echo "</div></div>" >> $outputFile
|
|
232 fi
|
|
233 #echo "<div class='tabbertab' title='Interactive'><svg class='chart'></svg><script src='http://d3js.org/d3.v3.min.js'></script></div>" >> $outputFile
|
|
234
|
|
235 hasReplicateColumn="$(if head -n 1 $inputFile | grep -q 'Replicate'; then echo 'Yes'; else echo 'No'; fi)"
|
|
236 echo "$hasReplicateColumn"
|
|
237 #if its a 'new' merged file with replicate info
|
17
|
238 if [[ "$hasReplicateColumn" == "Yes" && "${clonality_method}" != "none" ]] ; then
|
|
239 if [[ "${clonality_method}" == "boyd" ]] ; then
|
|
240 echo "<div class='tabbertab' title='Clonality'><div class='tabber'>" >> $outputFile
|
|
241 else
|
|
242 echo "<div class='tabbertab' title='Shared Clonal Types'><div class='tabber'>" >> $outputFile
|
|
243 fi
|
|
244
|
5
|
245 for sample in $samples; do
|
|
246 echo "${clonality_method}"
|
26
|
247
|
|
248 echo "<div class='tabbertab' title='$sample'><table class='pure-table pure-table-striped'>" >> $outputFile
|
|
249
|
|
250 if [[ "${clonality_method}" == "boyd" ]] ; then
|
22
|
251 clonalityScore="$(cat $outputDir/lymphclon_clonality_${sample}.txt)"
|
26
|
252 echo "<tr><td>Clonality Score: </td><td>$clonalityScore</td></tr>" >> $outputFile
|
5
|
253 fi
|
26
|
254
|
|
255 #replicate,reads,squared
|
|
256 echo "<tr><td>Replicate ID</td><td>Number of Sequences</td></tr>" >> $outputFile
|
|
257 while read replicate reads squared
|
|
258 do
|
|
259 echo "<tr><td>$replicate</td><td>$reads</td></tr>" >> $outputFile
|
|
260 done < $outputDir/ReplicateReads_$sample.txt
|
|
261
|
|
262 #sum of reads and reads squared
|
|
263 while read readsSum squaredSum
|
|
264 do
|
|
265 echo "<tr><td>Sum</td><td>$readsSum</td></tr>" >> $outputFile
|
|
266 done < $outputDir/ReplicateSumReads_$sample.txt
|
|
267
|
|
268 echo "<tr><td></td><td></td></tr>" >> $outputFile
|
|
269
|
|
270 #overview
|
|
271 echo "<tr><td>Number of replicates containing the coincidence</td><td>Number of sequences shared between replicates</td></tr>" >> $outputFile
|
|
272 while read type count weight weightedCount
|
|
273 do
|
|
274 if [[ "$type" -eq "1" ]]; then
|
|
275 echo "<tr><td>$type</td><td>$count</td></tr>" >> $outputFile
|
|
276 else
|
|
277 echo "<tr><td><a href='coincidences_${sample}_${type}.txt'>$type</a></td><td>$count</td></tr>" >> $outputFile
|
|
278 fi
|
|
279 done < $outputDir/ClonalityOverView_$sample.txt
|
|
280 echo "</table></div>" >> $outputFile
|
5
|
281 done
|
18
|
282
|
|
283 cat $dir/naive_clonality.htm >> $outputFile
|
|
284
|
5
|
285 echo "</div></div>" >> $outputFile
|
|
286 fi
|
|
287
|
|
288 #hasJunctionData="$(if head -n 1 $inputFile | grep -qE '3V.REGION.trimmed.nt.nb'; then echo 'Yes'; else echo 'No'; fi)"
|
|
289
|
|
290 #if [[ "$hasJunctionData" == "Yes" ]] ; then
|
24
|
291 if [ -a "$outputDir/junctionAnalysisProd_mean_wD.txt" ] ; then
|
5
|
292 echo "<div class='tabbertab' title='Junction Analysis'>" >> $outputFile
|
17
|
293 echo "<img src='IGH_junctie_analyse.png' />" >> $outputFile
|
|
294
|
24
|
295 echo "<center><p style='font-size: 20;'>Unique rearrangements with a V, D and J gene assigned</p></center>" >> $outputFile
|
38
|
296 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive 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>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
|
24
|
297 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
|
5
|
298 do
|
|
299 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
|
24
|
300 done < $outputDir/junctionAnalysisProd_mean_wD.txt
|
5
|
301 echo "</tbody></table>" >> $outputFile
|
|
302
|
38
|
303 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>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
|
24
|
304 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
|
5
|
305 do
|
26
|
306 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
|
24
|
307 done < $outputDir/junctionAnalysisUnProd_mean_wD.txt
|
5
|
308 echo "</tbody></table>" >> $outputFile
|
|
309
|
38
|
310 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>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
|
24
|
311 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
|
5
|
312 do
|
|
313 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
|
24
|
314 done < $outputDir/junctionAnalysisProd_median_wD.txt
|
5
|
315 echo "</tbody></table>" >> $outputFile
|
|
316
|
38
|
317 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>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
|
24
|
318 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
|
5
|
319 do
|
26
|
320 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
|
24
|
321 done < $outputDir/junctionAnalysisUnProd_median_wD.txt
|
|
322 echo "</tbody></table>" >> $outputFile
|
|
323
|
|
324 # again for no-d
|
|
325 echo "<center><p style='font-size: 20;'>Unique rearrangements with only a V and J gene assigned</p></center>" >> $outputFile
|
38
|
326 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive 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>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
|
24
|
327 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
|
|
328 do
|
|
329 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
|
|
330 done < $outputDir/junctionAnalysisProd_mean_nD.txt
|
|
331 echo "</tbody></table>" >> $outputFile
|
|
332
|
38
|
333 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>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
|
24
|
334 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
|
|
335 do
|
26
|
336 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
|
24
|
337 done < $outputDir/junctionAnalysisUnProd_mean_nD.txt
|
|
338 echo "</tbody></table>" >> $outputFile
|
|
339
|
38
|
340 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>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
|
24
|
341 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
|
|
342 do
|
|
343 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
|
|
344 done < $outputDir/junctionAnalysisProd_median_nD.txt
|
|
345 echo "</tbody></table>" >> $outputFile
|
|
346
|
38
|
347 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>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
|
24
|
348 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
|
|
349 do
|
27
|
350 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
|
24
|
351 done < $outputDir/junctionAnalysisUnProd_median_nD.txt
|
5
|
352 echo "</tbody></table>" >> $outputFile
|
|
353
|
18
|
354 cat $dir/naive_junction.htm >> $outputFile
|
|
355
|
5
|
356 echo "</div>" >> $outputFile
|
|
357 fi
|
|
358
|
|
359 echo "<div class='tabbertab' title='Downloads'>" >> $outputFile
|
|
360 echo "<table class='pure-table pure-table-striped'>" >> $outputFile
|
|
361 echo "<thead><tr><th>Description</th><th>Link</th></tr></thead>" >> $outputFile
|
18
|
362 echo "<tr><td>The filtered dataset</td><td><a href='allUnique.txt'>Download</a></td></tr>" >> $outputFile
|
24
|
363 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Gene frequencies</td></tr>" >> $outputFile
|
5
|
364
|
18
|
365 echo "<tr><td>The dataset used to generate the distribution of V gene families graph</td><td><a href='VFFrequency.txt'>Download</a></td></tr>" >> $outputFile
|
5
|
366 if [[ "$useD" == "true" ]] ; then
|
18
|
367 echo "<tr><td>The dataset used to generate the distribution of D gene families graph</td><td><a href='DFFrequency.txt'>Download</a></td></tr>" >> $outputFile
|
5
|
368 fi
|
|
369
|
18
|
370 echo "<tr><td>The dataset used to generate the relative frequency of V gene usage graph</td><td><a href='VFrequency.txt'>Download</a></td></tr>" >> $outputFile
|
5
|
371 if [[ "$useD" == "true" ]] ; then
|
18
|
372 echo "<tr><td>The dataset used to generate the relative frequency of D gene usage graph</td><td><a href='DFrequency.txt'>Download</a></td></tr>" >> $outputFile
|
5
|
373 fi
|
18
|
374 echo "<tr><td>The dataset used to generate the relative frequency of J gene usage graph</td><td><a href='JFrequency.txt'>Download</a></td></tr>" >> $outputFile
|
24
|
375 echo "<tr><td>The dataset used to generate the relative frequency of the D reading frame graph</td><td><a href='DReadingFrame.txt'>Download</a></td></tr>" >> $outputFile
|
|
376
|
|
377 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>CDR3 Characteristics</td></tr>" >> $outputFile
|
|
378 echo "<tr><td>The dataset used to generate the CDR3 length frequency graph</td><td><a href='CDR3LengthPlot.txt'>Download</a></td></tr>" >> $outputFile
|
18
|
379 echo "<tr><td>The dataset used to generate the Amino Acid Composition in the CDR3 graph</td><td><a href='AAComposition.txt'>Download</a></td></tr>" >> $outputFile
|
5
|
380
|
24
|
381 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Heatmaps</td></tr>" >> $outputFile
|
5
|
382 for sample in $samples; do
|
|
383 if [[ "$useD" == "true" ]] ; then
|
24
|
384 echo "<tr><td>The data used to generate the VD heatmap for $sample.</td><td><a href='HeatmapVD_$sample.txt'>Download</a></td></tr>" >> $outputFile
|
5
|
385 fi
|
24
|
386 echo "<tr><td>The data used to generate the VJ heatmap for $sample.</td><td><a href='HeatmapVJ_$sample.txt'>Download</a></td></tr>" >> $outputFile
|
5
|
387 if [[ "$useD" == "true" ]] ; then
|
24
|
388 echo "<tr><td>The data used to generate the DJ heatmap for $sample.</td><td><a href='HeatmapDJ_$sample.txt'>Download</a></td></tr>" >> $outputFile
|
5
|
389 fi
|
|
390 done
|
|
391
|
24
|
392 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Circos</td></tr>" >> $outputFile
|
|
393 for sample in $samples; do
|
|
394 if [[ "$useD" == "true" ]] ; then
|
|
395 echo "<tr><td>The data used to generate the VD Circos plots for $sample.</td><td><a href='${sample}_VD_circos.txt'>Download</a></td></tr>" >> $outputFile
|
|
396 fi
|
|
397 echo "<tr><td>The data used to generate the VJ Circos plots for $sample.</td><td><a href='${sample}_VJ_circos.txt'>Download</a></td></tr>" >> $outputFile
|
|
398 if [[ "$useD" == "true" ]] ; then
|
|
399 echo "<tr><td>The data used to generate the DJ Circos plots for $sample.</td><td><a href='${sample}_DJ_circos.txt'>Download</a></td></tr>" >> $outputFile
|
|
400 fi
|
|
401 done
|
|
402
|
|
403 #echo "<tr><td>A frequency count of V Gene + J Gene + CDR3</td><td><a href='VJCDR3_count.txt'>Download</a></td></tr>" >> $outputFile
|
|
404
|
|
405 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Clonality</td></tr>" >> $outputFile
|
|
406 echo "<tr><td>The dataset used to calculate clonality score (Unique based on clonaltype, $clonalType)</td><td><a href='clonalityComplete.txt'>Download</a></td></tr>" >> $outputFile
|
25
|
407 echo "<tr><td>Sequences that are present in more than one replicate</td><td><a href='clonaltypes_replicates.txt'>Download</a></td></tr>" >> $outputFile
|
5
|
408
|
|
409 echo "</table>" >> $outputFile
|
18
|
410
|
|
411 cat $dir/naive_downloads.htm >> $outputFile
|
|
412
|
5
|
413 echo "</div></html>" >> $outputFile
|