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
|
48
|
62 cp -R $dir/circos/* $outputDir/circos/
|
5
|
63
|
|
64 USECIRCOS="no"
|
48
|
65 path_to_circos=$(which circos)
|
|
66 if [ -x "$path_to_circos" ]; then
|
5
|
67 USECIRCOS="yes"
|
|
68 fi
|
12
|
69
|
5
|
70 echo "Using Circos: $USECIRCOS"
|
|
71 sed -i "s%DATA_DIR%$outputDir/circos%" $outputDir/circos/circos.conf
|
|
72 for sample in $samples; do #output the samples to a file and create the circos plots with the R script output
|
|
73 echo " $sample" >> $outputFile
|
|
74
|
|
75 if [[ "$USECIRCOS" != "yes" ]]; then
|
|
76 continue
|
|
77 fi
|
|
78
|
|
79 circos_file="$outputDir/${sample}_VJ_circos.txt"
|
45
|
80 sed -i -- 's%/%:%g' $circos_file
|
5
|
81 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
|
44
|
82 echo "Circos tools command:"
|
48
|
83 echo "cat \"${circos_file}\" | parse-table -configfile $dir/circos/parse-table.conf 2>&1 | make-conf -dir $outputDir/circos/"
|
|
84 cat "${circos_file}" | parse-table -configfile $dir/circos/parse-table.conf 2>&1 | make-conf -dir $outputDir/circos/
|
45
|
85
|
44
|
86 echo "Circos command:"
|
48
|
87 echo "circos -conf $outputDir/circos/circos.conf 2>&1"
|
|
88 circos -conf $outputDir/circos/circos.conf 2>&1
|
5
|
89 mv $outputDir/circos/circos.png $outputDir/circosVJ_${sample}.png
|
36
|
90 mv $outputDir/circos/circos.svg $outputDir/circosVJ_${sample}.svg
|
5
|
91
|
|
92
|
|
93 if [[ "$useD" == "true" ]] ; then
|
|
94 circos_file="$outputDir/${sample}_VD_circos.txt"
|
45
|
95 sed -i -- 's%/%:%g' $circos_file
|
5
|
96 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
|
48
|
97 cat "${circos_file}" | parse-table -configfile $dir/circos/parse-table.conf 2>&1 | make-conf -dir $outputDir/circos/
|
44
|
98 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt
|
48
|
99 circos -conf $outputDir/circos/circos.conf 2>&1
|
5
|
100 mv $outputDir/circos/circos.png $outputDir/circosVD_${sample}.png
|
36
|
101 mv $outputDir/circos/circos.svg $outputDir/circosVD_${sample}.svg
|
5
|
102
|
|
103 circos_file="$outputDir/${sample}_DJ_circos.txt"
|
45
|
104 sed -i -- 's%/%:%g' $circos_file
|
5
|
105 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
|
48
|
106 cat "${circos_file}" | parse-table -configfile $dir/circos/parse-table.conf 2>&1 | make-conf -dir $outputDir/circos/
|
44
|
107 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt
|
48
|
108 circos -conf $outputDir/circos/circos.conf 2>&1
|
5
|
109 mv $outputDir/circos/circos.png $outputDir/circosDJ_${sample}.png
|
36
|
110 mv $outputDir/circos/circos.svg $outputDir/circosDJ_${sample}.svg
|
5
|
111 fi
|
|
112 done
|
|
113 echo "</title><script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $outputFile
|
|
114 echo "<link rel='stylesheet' type='text/css' href='pure-min.css'>" >> $outputFile
|
|
115 echo "<script type='text/javascript' src='tabber.js'></script>" >> $outputFile
|
|
116 echo "<script type='text/javascript' src='script.js'></script>" >> $outputFile
|
|
117 echo "<link rel='stylesheet' type='text/css' href='style.css'></head>" >> $outputFile
|
|
118 echo "<div class='tabber'><div class='tabbertab' title='Gene frequencies'>" >> $outputFile
|
|
119
|
8
|
120
|
32
|
121 echo "<a href='VFPlot.pdf'><img src='VFPlot.png'/></a>" >> $outputFile
|
5
|
122 if [[ "$useD" == "true" ]] ; then
|
32
|
123 echo "<a href='DFPlot.pdf'><img src='DFPlot.png'/></a>" >> $outputFile
|
5
|
124 fi
|
32
|
125 echo "<a href='VPlot.pdf'><img src='VPlot.png'/></a>" >> $outputFile
|
5
|
126 if [[ "$useD" == "true" ]] ; then
|
32
|
127 echo "<a href='DPlot.pdf'><img src='DPlot.png'/></a>" >> $outputFile
|
5
|
128 fi
|
32
|
129 echo "<a href='JPlot.pdf'><img src='JPlot.png'/></a> <br />" >> $outputFile
|
24
|
130
|
32
|
131 echo "<a href='DReadingFrame.pdf'><img src='DReadingFrame.png'/></a>" >> $outputFile
|
18
|
132
|
|
133 cat $dir/naive_gene_freq.htm >> $outputFile
|
|
134
|
8
|
135 echo "</div>" >> $outputFile
|
|
136
|
|
137 echo "<div class='tabbertab' title='CDR3 Characteristics'>" >> $outputFile
|
32
|
138 echo "<a href='CDR3LengthPlot.pdf'><img src='CDR3LengthPlot.png'/></a><br />" >> $outputFile
|
|
139 echo "<a href='AAComposition.pdf'><img src='AAComposition.png'/></a>" >> $outputFile
|
24
|
140
|
8
|
141
|
|
142 echo "<table class='pure-table pure-table-striped'>" >> $outputFile
|
19
|
143 echo "<thead><tr><th>Donor</th><th>Median CDR3 Length</th></tr></thead>" >> $outputFile
|
24
|
144 while read Sample median
|
8
|
145 do
|
|
146 echo "<tr><td>$Sample</td><td>$median</td></tr>" >> $outputFile
|
24
|
147 done < $outputDir/AAMedianBySample.txt
|
8
|
148 echo "</table>" >> $outputFile
|
|
149
|
18
|
150 cat $dir/naive_cdr3_char.htm >> $outputFile
|
|
151
|
5
|
152 echo "</div>" >> $outputFile
|
|
153
|
|
154 #Heatmaps
|
|
155
|
|
156 count=1
|
|
157 echo "<div class='tabbertab' title='Heatmaps'><div class='tabber'>" >> $outputFile
|
|
158 for sample in $samples; do
|
|
159 echo "<div class='tabbertab' title='$sample'><table border='1'><tr>" >> $outputFile
|
|
160 if [[ "$useD" == "true" ]] ; then
|
32
|
161 echo "<td><a href='HeatmapVD_$sample.pdf'><img src='HeatmapVD_$sample.png'/></a></td>" >> $outputFile
|
5
|
162 fi
|
32
|
163 echo "<td><a href='HeatmapVJ_$sample.pdf'><img src='HeatmapVJ_$sample.png'/></a></td>" >> $outputFile
|
5
|
164 if [[ "$useD" == "true" ]] ; then
|
32
|
165 echo "<td><a href='HeatmapDJ_$sample.pdf'><img src='HeatmapDJ_$sample.png'/></a></td>" >> $outputFile
|
5
|
166 fi
|
|
167 echo "</tr></table></div>" >> $outputFile
|
|
168 count=$((count+1))
|
|
169 done
|
18
|
170
|
|
171 cat $dir/naive_heatmap.htm >> $outputFile
|
|
172
|
5
|
173 echo "</div></div>" >> $outputFile
|
|
174
|
18
|
175 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
|
|
176 for sample in $samples; do
|
|
177 echo "<tr><td>$sample</td><td><input type='checkbox' onchange=\"javascript:compareAdd('$sample')\" id='compare_checkbox_$sample'/></td></tr>" >> $outputFile
|
|
178 done
|
|
179 echo "</table><div name='comparisonarea'>" >> $outputFile
|
|
180 echo "<table><tr id='comparison_table_vd'></tr></table>" >> $outputFile
|
|
181 echo "<table><tr id='comparison_table_vj'></tr></table>" >> $outputFile
|
|
182 echo "<table><tr id='comparison_table_dj'></tr></table>" >> $outputFile
|
|
183
|
|
184 cat $dir/naive_compare.htm >> $outputFile
|
|
185
|
|
186 echo "</div></div>" >> $outputFile
|
|
187
|
|
188
|
5
|
189 #circos
|
|
190
|
|
191 if [[ "$USECIRCOS" == "yes" ]]; then
|
|
192
|
|
193 echo "<div class='tabbertab' title='Circos'><div class='tabber'>" >> $outputFile
|
|
194 for sample in $samples; do
|
|
195 echo "<div class='tabbertab' title='$sample'><table border='1'><center>" >> $outputFile
|
|
196 if [[ "$useD" == "true" ]] ; then
|
35
|
197 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
|
198 fi
|
35
|
199 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
|
200 if [[ "$useD" == "true" ]] ; then
|
35
|
201 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
|
202 fi
|
|
203 echo "<center></table></div>" >> $outputFile
|
|
204 count=$((count+1))
|
|
205 done
|
18
|
206
|
|
207 cat $dir/naive_circos.htm >> $outputFile
|
|
208
|
5
|
209 echo "</div></div>" >> $outputFile
|
|
210 fi
|
|
211 #echo "<div class='tabbertab' title='Interactive'><svg class='chart'></svg><script src='http://d3js.org/d3.v3.min.js'></script></div>" >> $outputFile
|
|
212
|
|
213 hasReplicateColumn="$(if head -n 1 $inputFile | grep -q 'Replicate'; then echo 'Yes'; else echo 'No'; fi)"
|
|
214 echo "$hasReplicateColumn"
|
|
215 #if its a 'new' merged file with replicate info
|
17
|
216 if [[ "$hasReplicateColumn" == "Yes" && "${clonality_method}" != "none" ]] ; then
|
|
217 if [[ "${clonality_method}" == "boyd" ]] ; then
|
|
218 echo "<div class='tabbertab' title='Clonality'><div class='tabber'>" >> $outputFile
|
|
219 else
|
|
220 echo "<div class='tabbertab' title='Shared Clonal Types'><div class='tabber'>" >> $outputFile
|
|
221 fi
|
|
222
|
5
|
223 for sample in $samples; do
|
|
224 echo "${clonality_method}"
|
26
|
225
|
|
226 echo "<div class='tabbertab' title='$sample'><table class='pure-table pure-table-striped'>" >> $outputFile
|
|
227
|
|
228 if [[ "${clonality_method}" == "boyd" ]] ; then
|
22
|
229 clonalityScore="$(cat $outputDir/lymphclon_clonality_${sample}.txt)"
|
26
|
230 echo "<tr><td>Clonality Score: </td><td>$clonalityScore</td></tr>" >> $outputFile
|
5
|
231 fi
|
26
|
232
|
|
233 #replicate,reads,squared
|
|
234 echo "<tr><td>Replicate ID</td><td>Number of Sequences</td></tr>" >> $outputFile
|
|
235 while read replicate reads squared
|
|
236 do
|
|
237 echo "<tr><td>$replicate</td><td>$reads</td></tr>" >> $outputFile
|
|
238 done < $outputDir/ReplicateReads_$sample.txt
|
|
239
|
|
240 #sum of reads and reads squared
|
|
241 while read readsSum squaredSum
|
|
242 do
|
|
243 echo "<tr><td>Sum</td><td>$readsSum</td></tr>" >> $outputFile
|
|
244 done < $outputDir/ReplicateSumReads_$sample.txt
|
|
245
|
|
246 echo "<tr><td></td><td></td></tr>" >> $outputFile
|
|
247
|
|
248 #overview
|
|
249 echo "<tr><td>Number of replicates containing the coincidence</td><td>Number of sequences shared between replicates</td></tr>" >> $outputFile
|
|
250 while read type count weight weightedCount
|
|
251 do
|
|
252 if [[ "$type" -eq "1" ]]; then
|
|
253 echo "<tr><td>$type</td><td>$count</td></tr>" >> $outputFile
|
|
254 else
|
|
255 echo "<tr><td><a href='coincidences_${sample}_${type}.txt'>$type</a></td><td>$count</td></tr>" >> $outputFile
|
|
256 fi
|
|
257 done < $outputDir/ClonalityOverView_$sample.txt
|
|
258 echo "</table></div>" >> $outputFile
|
5
|
259 done
|
18
|
260
|
|
261 cat $dir/naive_clonality.htm >> $outputFile
|
|
262
|
5
|
263 echo "</div></div>" >> $outputFile
|
|
264 fi
|
|
265
|
|
266 #hasJunctionData="$(if head -n 1 $inputFile | grep -qE '3V.REGION.trimmed.nt.nb'; then echo 'Yes'; else echo 'No'; fi)"
|
|
267
|
|
268 #if [[ "$hasJunctionData" == "Yes" ]] ; then
|
24
|
269 if [ -a "$outputDir/junctionAnalysisProd_mean_wD.txt" ] ; then
|
5
|
270 echo "<div class='tabbertab' title='Junction Analysis'>" >> $outputFile
|
17
|
271 echo "<img src='IGH_junctie_analyse.png' />" >> $outputFile
|
|
272
|
24
|
273 echo "<center><p style='font-size: 20;'>Unique rearrangements with a V, D and J gene assigned</p></center>" >> $outputFile
|
38
|
274 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
|
275 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
|
5
|
276 do
|
|
277 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
|
278 done < $outputDir/junctionAnalysisProd_mean_wD.txt
|
5
|
279 echo "</tbody></table>" >> $outputFile
|
|
280
|
38
|
281 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
|
282 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
|
5
|
283 do
|
26
|
284 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
|
285 done < $outputDir/junctionAnalysisUnProd_mean_wD.txt
|
5
|
286 echo "</tbody></table>" >> $outputFile
|
|
287
|
38
|
288 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
|
289 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
|
5
|
290 do
|
|
291 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
|
292 done < $outputDir/junctionAnalysisProd_median_wD.txt
|
5
|
293 echo "</tbody></table>" >> $outputFile
|
|
294
|
38
|
295 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
|
296 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
|
5
|
297 do
|
26
|
298 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
|
299 done < $outputDir/junctionAnalysisUnProd_median_wD.txt
|
|
300 echo "</tbody></table>" >> $outputFile
|
|
301
|
|
302 # again for no-d
|
|
303 echo "<center><p style='font-size: 20;'>Unique rearrangements with only a V and J gene assigned</p></center>" >> $outputFile
|
38
|
304 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
|
305 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
|
|
306 do
|
|
307 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
|
|
308 done < $outputDir/junctionAnalysisProd_mean_nD.txt
|
|
309 echo "</tbody></table>" >> $outputFile
|
|
310
|
38
|
311 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
|
312 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
|
|
313 do
|
26
|
314 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
|
315 done < $outputDir/junctionAnalysisUnProd_mean_nD.txt
|
|
316 echo "</tbody></table>" >> $outputFile
|
|
317
|
38
|
318 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
|
319 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
|
|
320 do
|
|
321 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
|
|
322 done < $outputDir/junctionAnalysisProd_median_nD.txt
|
|
323 echo "</tbody></table>" >> $outputFile
|
|
324
|
38
|
325 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
|
326 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
|
|
327 do
|
27
|
328 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
|
329 done < $outputDir/junctionAnalysisUnProd_median_nD.txt
|
5
|
330 echo "</tbody></table>" >> $outputFile
|
|
331
|
18
|
332 cat $dir/naive_junction.htm >> $outputFile
|
|
333
|
5
|
334 echo "</div>" >> $outputFile
|
|
335 fi
|
|
336
|
|
337 echo "<div class='tabbertab' title='Downloads'>" >> $outputFile
|
|
338 echo "<table class='pure-table pure-table-striped'>" >> $outputFile
|
|
339 echo "<thead><tr><th>Description</th><th>Link</th></tr></thead>" >> $outputFile
|
18
|
340 echo "<tr><td>The filtered dataset</td><td><a href='allUnique.txt'>Download</a></td></tr>" >> $outputFile
|
24
|
341 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Gene frequencies</td></tr>" >> $outputFile
|
5
|
342
|
18
|
343 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
|
344 if [[ "$useD" == "true" ]] ; then
|
18
|
345 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
|
346 fi
|
|
347
|
18
|
348 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
|
349 if [[ "$useD" == "true" ]] ; then
|
18
|
350 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
|
351 fi
|
18
|
352 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
|
353 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
|
|
354
|
|
355 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>CDR3 Characteristics</td></tr>" >> $outputFile
|
|
356 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
|
357 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
|
358
|
24
|
359 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Heatmaps</td></tr>" >> $outputFile
|
5
|
360 for sample in $samples; do
|
|
361 if [[ "$useD" == "true" ]] ; then
|
24
|
362 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
|
363 fi
|
24
|
364 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
|
365 if [[ "$useD" == "true" ]] ; then
|
24
|
366 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
|
367 fi
|
|
368 done
|
|
369
|
24
|
370 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Circos</td></tr>" >> $outputFile
|
|
371 for sample in $samples; do
|
|
372 if [[ "$useD" == "true" ]] ; then
|
|
373 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
|
|
374 fi
|
|
375 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
|
|
376 if [[ "$useD" == "true" ]] ; then
|
|
377 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
|
|
378 fi
|
|
379 done
|
|
380
|
|
381 #echo "<tr><td>A frequency count of V Gene + J Gene + CDR3</td><td><a href='VJCDR3_count.txt'>Download</a></td></tr>" >> $outputFile
|
|
382
|
|
383 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Clonality</td></tr>" >> $outputFile
|
|
384 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
|
385 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
|
386
|
|
387 echo "</table>" >> $outputFile
|
18
|
388
|
|
389 cat $dir/naive_downloads.htm >> $outputFile
|
|
390
|
5
|
391 echo "</div></html>" >> $outputFile
|