0
|
1 #!/bin/bash
|
|
2 #set -e
|
|
3 dir="$(cd "$(dirname "$0")" && pwd)"
|
|
4 input=$1
|
|
5 method=$2
|
|
6 log=$3 #becomes the main html page at the end
|
|
7 outdir=$4
|
|
8 output="$outdir/index.html" #copied to $log location at the end
|
34
|
9 title="$5"
|
0
|
10 include_fr1=$6
|
|
11 functionality=$7
|
|
12 unique=$8
|
28
|
13 naive_output=$9
|
|
14 naive_output_ca=${10}
|
|
15 naive_output_cg=${11}
|
|
16 naive_output_cm=${12}
|
|
17 naive_output_ce=${13}
|
|
18 naive_output_all=${14}
|
|
19 filter_unique=${15}
|
|
20 class_filter=${16}
|
|
21 empty_region_filter=${17}
|
|
22 fast=${18}
|
0
|
23 mkdir $outdir
|
|
24
|
|
25 tar -xzf $dir/style.tar.gz -C $outdir
|
|
26
|
|
27 echo "---------------- read parameters ----------------"
|
|
28 echo "---------------- read parameters ----------------<br />" > $log
|
|
29
|
|
30 echo "unpacking IMGT file"
|
|
31
|
|
32 type="`file $input`"
|
|
33 if [[ "$type" == *"Zip archive"* ]] ; then
|
|
34 echo "Zip archive"
|
|
35 echo "unzip $input -d $PWD/files/"
|
|
36 unzip $input -d $PWD/files/
|
|
37 elif [[ "$type" == *"XZ compressed data"* ]] ; then
|
|
38 echo "ZX archive"
|
|
39 echo "tar -xJf $input -C $PWD/files/"
|
34
|
40 mkdir -p "$PWD/files/$title"
|
|
41 tar -xJf $input -C "$PWD/files/$title"
|
0
|
42 fi
|
|
43
|
35
|
44 cat "`find $PWD/files/ -name "1_*"`" > $PWD/summary.txt
|
|
45 cat "`find $PWD/files/ -name "3_*"`" > $PWD/sequences.txt
|
|
46 cat "`find $PWD/files/ -name "5_*"`" > $PWD/aa.txt
|
|
47 cat "`find $PWD/files/ -name "6_*"`" > $PWD/junction.txt
|
|
48 cat "`find $PWD/files/ -name "7_*"`" > $PWD/mutationanalysis.txt
|
|
49 cat "`find $PWD/files/ -name "8_*"`" > $PWD/mutationstats.txt
|
|
50 cat "`find $PWD/files/ -name "10_*"`" > $PWD/hotspots.txt
|
0
|
51
|
|
52 if [[ ${#BLASTN_DIR} -ge 5 ]] ; then
|
|
53 echo "On server, using BLASTN_DIR env: ${BLASTN_DIR}"
|
|
54 else
|
|
55 BLASTN_DIR="/home/galaxy/Downloads/ncbi-blast-2.4.0+/bin"
|
|
56 echo "Dev Galaxy set BLASTN_DIR to: ${BLASTN_DIR}"
|
|
57 fi
|
|
58
|
|
59 echo "---------------- class identification ----------------"
|
|
60 echo "---------------- class identification ----------------<br />" >> $log
|
|
61
|
|
62 python $dir/gene_identification.py --input $PWD/summary.txt --output $outdir/identified_genes.txt
|
|
63
|
|
64 echo "---------------- merge_and_filter.r ----------------"
|
|
65 echo "---------------- merge_and_filter.r ----------------<br />" >> $log
|
|
66
|
14
|
67 Rscript $dir/merge_and_filter.r $PWD/summary.txt $PWD/sequences.txt $PWD/mutationanalysis.txt $PWD/mutationstats.txt $PWD/hotspots.txt $PWD/aa.txt $outdir/identified_genes.txt $outdir/merged.txt $outdir/before_unique_filter.txt $outdir/unmatched.txt $method $functionality $unique ${filter_unique} ${class_filter} ${empty_region_filter} 2>&1
|
0
|
68
|
5
|
69 if [[ "$fast" == "no" ]] ; then
|
0
|
70
|
5
|
71 echo "---------------- creating new IMGT zips ----------------"
|
|
72 echo "---------------- creating new IMGT zips ----------------<br />" >> $log
|
|
73
|
|
74 mkdir $outdir/new_IMGT
|
0
|
75
|
36
|
76 cat "`find $PWD/files/ -name "1_*"`" > "$outdir/new_IMGT/1_Summary.txt"
|
|
77 cat "`find $PWD/files/ -name "2_*"`" > "$outdir/new_IMGT/2_IMGT-gapped-nt-sequences.txt"
|
|
78 cat "`find $PWD/files/ -name "3_*"`" > "$outdir/new_IMGT/3_Nt-sequences.txt"
|
|
79 cat "`find $PWD/files/ -name "4_*"`" > "$outdir/new_IMGT/4_IMGT-gapped-AA-sequences.txt"
|
|
80 cat "`find $PWD/files/ -name "5_*"`" > "$outdir/new_IMGT/5_AA-sequences.txt"
|
|
81 cat "`find $PWD/files/ -name "6_*"`" > "$outdir/new_IMGT/6_Junction.txt"
|
|
82 cat "`find $PWD/files/ -name "7_*"`" > "$outdir/new_IMGT/7_V-REGION-mutation-and-AA-change-table.txt"
|
|
83 cat "`find $PWD/files/ -name "8_*"`" > "$outdir/new_IMGT/8_V-REGION-nt-mutation-statistics.txt"
|
|
84 cat "`find $PWD/files/ -name "9_*"`" > "$outdir/new_IMGT/9_V-REGION-AA-change-statistics.txt"
|
|
85 cat "`find $PWD/files/ -name "10_*"`" > "$outdir/new_IMGT/10_V-REGION-mutation-hotspots.txt"
|
0
|
86
|
5
|
87 mkdir $outdir/new_IMGT_IGA
|
|
88 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGA
|
0
|
89
|
5
|
90 mkdir $outdir/new_IMGT_IGA1
|
|
91 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGA1
|
0
|
92
|
5
|
93 mkdir $outdir/new_IMGT_IGA2
|
|
94 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGA2
|
0
|
95
|
5
|
96 mkdir $outdir/new_IMGT_IGG
|
|
97 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGG
|
0
|
98
|
5
|
99 mkdir $outdir/new_IMGT_IGG1
|
|
100 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGG1
|
0
|
101
|
5
|
102 mkdir $outdir/new_IMGT_IGG2
|
|
103 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGG2
|
0
|
104
|
5
|
105 mkdir $outdir/new_IMGT_IGG3
|
|
106 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGG3
|
0
|
107
|
5
|
108 mkdir $outdir/new_IMGT_IGG4
|
|
109 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGG4
|
|
110
|
|
111 mkdir $outdir/new_IMGT_IGM
|
|
112 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGM
|
0
|
113
|
5
|
114 mkdir $outdir/new_IMGT_IGE
|
|
115 cp $outdir/new_IMGT/* $outdir/new_IMGT_IGE
|
0
|
116
|
5
|
117 Rscript $dir/new_imgt.r $outdir/new_IMGT/ $outdir/merged.txt "-" 2>&1
|
|
118
|
|
119 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGA/ $outdir/merged.txt "IGA" 2>&1
|
|
120 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGA1/ $outdir/merged.txt "IGA1" 2>&1
|
|
121 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGA2/ $outdir/merged.txt "IGA2" 2>&1
|
0
|
122
|
5
|
123 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGG/ $outdir/merged.txt "IGG" 2>&1
|
|
124 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGG1/ $outdir/merged.txt "IGG1" 2>&1
|
|
125 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGG2/ $outdir/merged.txt "IGG2" 2>&1
|
|
126 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGG3/ $outdir/merged.txt "IGG3" 2>&1
|
|
127 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGG4/ $outdir/merged.txt "IGG4" 2>&1
|
0
|
128
|
5
|
129 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGM/ $outdir/merged.txt "IGM" 2>&1
|
0
|
130
|
5
|
131 Rscript $dir/new_imgt.r $outdir/new_IMGT_IGE/ $outdir/merged.txt "IGE" 2>&1
|
0
|
132
|
|
133
|
5
|
134 tmp="$PWD"
|
|
135 cd $outdir/new_IMGT/ #tar weirdness...
|
|
136 tar -cJf ../new_IMGT.txz *
|
0
|
137
|
5
|
138 cd $outdir/new_IMGT_IGA/
|
|
139 tar -cJf ../new_IMGT_IGA.txz *
|
0
|
140
|
5
|
141 cd $outdir/new_IMGT_IGA1/
|
|
142 tar -cJf ../new_IMGT_IGA1.txz *
|
0
|
143
|
5
|
144 cd $outdir/new_IMGT_IGA2/
|
|
145 tar -cJf ../new_IMGT_IGA2.txz *
|
0
|
146
|
5
|
147 cd $outdir/new_IMGT_IGG/
|
|
148 tar -cJf ../new_IMGT_IGG.txz *
|
0
|
149
|
5
|
150 cd $outdir/new_IMGT_IGG1/
|
|
151 tar -cJf ../new_IMGT_IGG1.txz *
|
0
|
152
|
5
|
153 cd $outdir/new_IMGT_IGG2/
|
|
154 tar -cJf ../new_IMGT_IGG2.txz *
|
|
155
|
|
156 cd $outdir/new_IMGT_IGG3/
|
|
157 tar -cJf ../new_IMGT_IGG3.txz *
|
0
|
158
|
5
|
159 cd $outdir/new_IMGT_IGG4/
|
|
160 tar -cJf ../new_IMGT_IGG4.txz *
|
|
161
|
|
162 cd $outdir/new_IMGT_IGM/
|
|
163 tar -cJf ../new_IMGT_IGM.txz *
|
0
|
164
|
5
|
165 cd $outdir/new_IMGT_IGE/
|
|
166 tar -cJf ../new_IMGT_IGE.txz *
|
0
|
167
|
5
|
168 cd $tmp
|
|
169 fi
|
0
|
170
|
|
171 echo "---------------- shm_csr.r ----------------"
|
|
172 echo "---------------- shm_csr.r ----------------<br />" >> $log
|
|
173
|
5
|
174 classes="IGA,IGA1,IGA2,IGG,IGG1,IGG2,IGG3,IGG4,IGM,IGE,unmatched"
|
0
|
175 echo "R mutation analysis"
|
1
|
176 Rscript $dir/shm_csr.r $outdir/merged.txt $classes $outdir ${empty_region_filter} 2>&1
|
0
|
177
|
|
178 echo "---------------- shm_csr.py ----------------"
|
|
179 echo "---------------- shm_csr.py ----------------<br />" >> $log
|
|
180
|
1
|
181 python $dir/shm_csr.py --input $outdir/merged.txt --genes $classes --empty_region_filter "${empty_region_filter}" --output $outdir/hotspot_analysis.txt
|
0
|
182
|
|
183 echo "---------------- aa_histogram.r ----------------"
|
|
184 echo "---------------- aa_histogram.r ----------------<br />" >> $log
|
|
185
|
5
|
186 Rscript $dir/aa_histogram.r $outdir/aa_id_mutations.txt $outdir/absent_aa_id.txt "IGA,IGG,IGM,IGE" $outdir/ 2>&1
|
0
|
187 if [ -e "$outdir/aa_histogram_.png" ]; then
|
|
188 mv $outdir/aa_histogram_.png $outdir/aa_histogram.png
|
|
189 mv $outdir/aa_histogram_.txt $outdir/aa_histogram.txt
|
29
|
190 mv $outdir/aa_histogram_absent_.txt $outdir/aa_histogram_absent.txt
|
|
191 mv $outdir/aa_histogram_count_.txt $outdir/aa_histogram_count.txt
|
|
192 mv $outdir/aa_histogram_sum_.txt $outdir/aa_histogram_sum.txt
|
0
|
193 fi
|
|
194
|
5
|
195 genes=(IGA IGA1 IGA2 IGG IGG1 IGG2 IGG3 IGG4 IGM IGE)
|
0
|
196
|
|
197 funcs=(sum mean median)
|
|
198 funcs=(sum)
|
|
199
|
|
200 echo "---------------- sequence_overview.r ----------------"
|
|
201 echo "---------------- sequence_overview.r ----------------<br />" >> $log
|
|
202
|
|
203 mkdir $outdir/sequence_overview
|
|
204
|
7
|
205 Rscript $dir/sequence_overview.r $outdir/before_unique_filter.txt $outdir/merged.txt $outdir/sequence_overview $classes $outdir/hotspot_analysis_sum.txt ${empty_region_filter} 2>&1
|
0
|
206
|
|
207 echo "<table border='1'>" > $outdir/base_overview.html
|
|
208
|
|
209 while IFS=$'\t' read ID class seq A C G T
|
|
210 do
|
|
211 echo "<tr><td>$ID</td><td>$seq</td><td>$class</td><td>$A</td><td>$C</td><td>$G</td><td>$T</td></tr>" >> $outdir/base_overview.html
|
|
212 done < $outdir/sequence_overview/ntoverview.txt
|
|
213
|
|
214 echo "<html><center><h1>$title</h1></center>" > $output
|
|
215 echo "<meta name='viewport' content='width=device-width, initial-scale=1'>" >> $output
|
|
216 echo "<script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $output
|
|
217 echo "<script type='text/javascript' src='tabber.js'></script>" >> $output
|
|
218 echo "<script type='text/javascript' src='script.js'></script>" >> $output
|
|
219 echo "<link rel='stylesheet' type='text/css' href='style.css'>" >> $output
|
|
220 echo "<link rel='stylesheet' type='text/css' href='pure-min.css'>" >> $output
|
|
221
|
|
222 matched_count="`cat $outdir/merged.txt | grep -v 'unmatched' | tail -n +2 | wc -l`"
|
|
223 unmatched_count="`cat $outdir/unmatched.txt | tail -n +2 | wc -l`"
|
|
224 total_count=$((matched_count + unmatched_count))
|
|
225 perc_count=$((unmatched_count / total_count * 100))
|
|
226 perc_count=`bc -l <<< "scale=2; ${unmatched_count} / ${total_count} * 100"`
|
|
227 perc_count=`bc -l <<< "scale=2; (${unmatched_count} / ${total_count} * 100 ) / 1"`
|
|
228
|
|
229 echo "<center><h2>Total: ${total_count}</h2></center>" >> $output
|
|
230 echo "<center><h2>Matched: ${matched_count} Unmatched: ${unmatched_count}</h2></center>" >> $output
|
|
231 echo "<center><h2>Percentage unmatched: ${perc_count}</h2></center>" >> $output
|
|
232
|
|
233 echo "---------------- main tables ----------------"
|
|
234 echo "---------------- main tables ----------------<br />" >> $log
|
|
235
|
|
236 echo "<div class='tabber'>" >> $output
|
23
|
237 echo "<div class='tabbertab' title='SHM Overview' style='width: 3000px;'>" >> $output
|
0
|
238
|
|
239 for func in ${funcs[@]}
|
|
240 do
|
|
241
|
|
242 echo "---------------- $func table ----------------"
|
|
243 echo "---------------- $func table ----------------<br />" >> $log
|
|
244
|
|
245 cat $outdir/mutations_${func}.txt $outdir/hotspot_analysis_${func}.txt > $outdir/data_${func}.txt
|
|
246
|
|
247 echo "---------------- pattern_plots.r ----------------"
|
|
248 echo "---------------- pattern_plots.r ----------------<br />" >> $log
|
|
249
|
23
|
250 Rscript $dir/pattern_plots.r $outdir/data_${func}.txt $outdir/plot1 $outdir/plot2 $outdir/plot3 $outdir/shm_overview.txt 2>&1
|
0
|
251
|
|
252 echo "<table class='pure-table pure-table-striped'>" >> $output
|
|
253 echo "<thead><tr><th>info</th>" >> $output
|
|
254
|
|
255 if [ "${class_filter}" != "101_101" ] ; then
|
|
256
|
|
257 for gene in ${genes[@]}
|
|
258 do
|
|
259 tmp=`cat $outdir/${gene}_${func}_n.txt`
|
|
260 echo "<th><a href='matched_${gene}_${func}.txt'>${gene} (N = $tmp)</a></th>" >> $output
|
|
261 done
|
|
262
|
|
263 tmp=`cat $outdir/all_${func}_n.txt`
|
|
264 echo "<th><a href='matched_all_${func}.txt'>all (N = $tmp)</a></th>" >> $output
|
|
265 tmp=`cat $outdir/unmatched_${func}_n.txt`
|
|
266 echo "<th><a href='unmatched.txt'>unmatched (N = ${unmatched_count})</a></th><tr></thead>" >> $output
|
|
267
|
5
|
268 while IFS=, read name cax cay caz ca1x ca1y ca1z ca2x ca2y ca2z cgx cgy cgz cg1x cg1y cg1z cg2x cg2y cg2z cg3x cg3y cg3z cg4x cg4y cg4z cmx cmy cmz cex cey cez unx uny unz allx ally allz
|
0
|
269 do
|
|
270 if [ "$name" == "FR R/S (ratio)" ] || [ "$name" == "CDR R/S (ratio)" ] ; then #meh
|
5
|
271 echo "<tr><td>$name</td><td>${cax}/${cay} (${caz})</td><td>${ca1x}/${ca1y} (${ca1z})</td><td>${ca2x}/${ca2y} (${ca2z})</td><td>${cgx}/${cgy} (${cgz})</td><td>${cg1x}/${cg1y} (${cg1z})</td><td>${cg2x}/${cg2y} (${cg2z})</td><td>${cg3x}/${cg3y} (${cg3z})</td><td>${cg4x}/${cg4y} (${cg4z})</td><td>${cmx}/${cmy} (${cmz})</td><td>${cex}/${cey} (${cez})</td><td>${allx}/${ally} (${allz})</td><td>${unx}/${uny} (${unz})</td></tr>" >> $output
|
0
|
272 elif [ "$name" == "Median of Number of Mutations (%)" ] ; then
|
5
|
273 echo "<tr><td>$name</td><td>${caz}%</td><td>${ca1z}%</td><td>${ca2z}%</td><td>${cgz}%</td><td>${cg1z}%</td><td>${cg2z}%</td><td>${cg3z}%</td><td>${cg4z}%</td><td>${cmz}%</td><td>${cez}%</td><td>${allz}%</td><td>${unz}%</td></tr>" >> $output
|
0
|
274 else
|
5
|
275 echo "<tr><td>$name</td><td>${cax}/${cay} (${caz}%)</td><td>${ca1x}/${ca1y} (${ca1z}%)</td><td>${ca2x}/${ca2y} (${ca2z}%)</td><td>${cgx}/${cgy} (${cgz}%)</td><td>${cg1x}/${cg1y} (${cg1z}%)</td><td>${cg2x}/${cg2y} (${cg2z}%)</td><td>${cg3x}/${cg3y} (${cg3z}%)</td><td>${cg4x}/${cg4y} (${cg4z}%)</td><td>${cmx}/${cmy} (${cmz}%)</td><td>${cex}/${cey} (${cez}%)</td><td>${allx}/${ally} (${allz}%)</td><td>${unx}/${uny} (${unz}%)</td></tr>" >> $output
|
0
|
276 fi
|
|
277 done < $outdir/data_${func}.txt
|
|
278
|
|
279 else
|
3
|
280 tmp=`cat $outdir/all_${func}_n.txt`
|
0
|
281 echo "<th><a href='matched_all_${func}.txt'>all (N = $tmp)</a></th>" >> $output
|
|
282
|
5
|
283 while IFS=, read name cax cay caz ca1x ca1y ca1z ca2x ca2y ca2z cgx cgy cgz cg1x cg1y cg1z cg2x cg2y cg2z cg3x cg3y cg3z cg4x cg4y cg4z cmx cmy cmz cex cey cez unx uny unz allx ally allz
|
0
|
284 do
|
|
285 if [ "$name" == "FR R/S (ratio)" ] || [ "$name" == "CDR R/S (ratio)" ] ; then #meh
|
3
|
286 echo "<tr><td>$name</td><td>${allx}/${ally}</td></tr>" >> $output
|
0
|
287 elif [ "$name" == "Median of Number of Mutations (%)" ] ; then
|
3
|
288 echo "<tr><td>$name</td><td>${allz}%</td></tr>" >> $output
|
0
|
289 else
|
3
|
290 echo "<tr><td>$name</td><td>${allx}/${ally} (${allz}%)</td></tr>" >> $output
|
0
|
291 fi
|
|
292 done < $outdir/data_${func}.txt
|
|
293
|
|
294 fi
|
|
295 echo "</table>" >> $output
|
|
296 #echo "<a href='data_${func}.txt'>Download data</a>" >> $output
|
|
297 done
|
|
298
|
|
299 echo "<img src='plot1.png' /><br />" >> $output
|
|
300 echo "<img src='plot2.png' /><br />" >> $output
|
|
301 echo "<img src='plot3.png' /><br />" >> $output
|
|
302
|
|
303 echo "</div>" >> $output #SHM overview tab end
|
|
304
|
|
305 echo "---------------- images ----------------"
|
|
306 echo "---------------- images ----------------<br />" >> $log
|
|
307
|
23
|
308 echo "<div class='tabbertab' title='SHM Frequency' style='width: 3000px;'>" >> $output
|
0
|
309
|
|
310 if [ -a $outdir/scatter.png ]
|
|
311 then
|
|
312 echo "<img src='scatter.png'/><br />" >> $output
|
|
313 fi
|
|
314 if [ -a $outdir/frequency_ranges.png ]
|
|
315 then
|
|
316 echo "<img src='frequency_ranges.png'/><br />" >> $output
|
|
317 fi
|
|
318
|
|
319 echo "</div>" >> $output #SHM frequency tab end
|
|
320
|
23
|
321 echo "<div class='tabbertab' title='Transition tables' style='width: 3000px;'>" >> $output
|
0
|
322
|
|
323 echo "<table border='0'>" >> $output
|
|
324
|
|
325 for gene in ${genes[@]}
|
|
326 do
|
|
327 echo "<tr>" >> $output
|
|
328 echo "<td><h1>${gene}</h1></td>" >> $output
|
23
|
329
|
|
330 if [ -e $outdir/transitions_heatmap_${gene}.png ]
|
|
331 then
|
|
332 echo "<td><img src='transitions_heatmap_${gene}.png' /></td>" >> $output
|
|
333 else
|
|
334 echo "<td></td>" >> $output
|
|
335 fi
|
|
336
|
|
337 if [ -e $outdir/transitions_stacked_${gene}.png ]
|
|
338 then
|
|
339 echo "<td><img src='transitions_stacked_${gene}.png' /></td>" >> $output
|
|
340 else
|
|
341 echo "<td></td>" >> $output
|
|
342 fi
|
|
343
|
0
|
344 echo "<td><table style='border-left-width: 1;' class='pure-table transition-table pure-table-bordered'>" >> $output
|
|
345 echo "<tr><td></td><td colspan="5"><center>To</center></td></tr>" >> $output
|
|
346 first="true"
|
|
347 while IFS=, read from a c g t
|
|
348 do
|
|
349 if [ "$first" == "true" ] ; then
|
|
350 echo "<tr><td rowspan='5'>From</td><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output
|
|
351 first="false"
|
|
352 else
|
|
353 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output
|
|
354 fi
|
|
355 done < $outdir/transitions_${gene}_sum.txt
|
|
356 echo "</table></td>" >> $output
|
|
357
|
|
358 echo "</tr>" >> $output
|
|
359 done
|
|
360
|
|
361 echo "<tr>" >> $output
|
|
362 echo "<td><h1>All</h1></td>" >> $output
|
|
363 echo "<td><img src='transitions_heatmap_all.png' /></td>" >> $output
|
|
364 echo "<td><img src='transitions_stacked_all.png' /></td>" >> $output
|
|
365 echo "<td><table style='border-left-width: 1;' class='pure-table transition-table pure-table-bordered'>" >> $output
|
|
366 echo "<tr><td></td><td colspan="5"><center>To</center></td></tr>" >> $output
|
|
367 first="true"
|
|
368 while IFS=, read from a c g t
|
|
369 do
|
|
370 if [ "$first" == "true" ] ; then
|
|
371 echo "<tr><td rowspan='5'>From</td><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output
|
|
372 first="false"
|
|
373 else
|
|
374 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output
|
|
375 fi
|
|
376 done < $outdir/transitions_all_sum.txt
|
|
377 echo "</table></td>" >> $output
|
|
378
|
|
379 echo "</tr>" >> $output
|
|
380
|
|
381 echo "</table>" >> $output
|
|
382
|
|
383 echo "</div>" >> $output #transition tables tab end
|
|
384
|
|
385 echo "<div class='tabbertab' title='Antigen Selection'>" >> $output
|
|
386
|
23
|
387 if [ -e $outdir/aa_histogram.png ]
|
0
|
388 then
|
|
389 echo "<img src='aa_histogram.png'/><br />" >> $output
|
23
|
390 fi
|
|
391
|
|
392 if [ -e $outdir/aa_histogram_IGA.png ]
|
|
393 then
|
0
|
394 echo "<img src='aa_histogram_IGA.png'/><br />" >> $output
|
23
|
395 fi
|
|
396
|
|
397 if [ -e $outdir/aa_histogram_IGG.png ]
|
|
398 then
|
0
|
399 echo "<img src='aa_histogram_IGG.png'/><br />" >> $output
|
23
|
400 fi
|
|
401
|
|
402 if [ -e $outdir/aa_histogram_IGM.png ]
|
|
403 then
|
0
|
404 echo "<img src='aa_histogram_IGM.png'/><br />" >> $output
|
23
|
405 fi
|
|
406
|
|
407 if [ -e $outdir/aa_histogram_IGE.png ]
|
|
408 then
|
6
|
409 echo "<img src='aa_histogram_IGE.png'/><br />" >> $output
|
0
|
410 fi
|
|
411
|
23
|
412
|
33
|
413
|
|
414 if [[ "$fast" == "no" ]] ; then
|
|
415
|
|
416 echo "---------------- baseline ----------------"
|
|
417 echo "---------------- baseline ----------------<br />" >> $log
|
|
418 tmp="$PWD"
|
|
419
|
|
420 mkdir $outdir/baseline
|
37
|
421
|
|
422 baseline_boundaries="27:27:38:55:65:104:-"
|
|
423
|
|
424 if [[ "${empty_region_filter}" == "leader" ]] ; then
|
|
425 baseline_boundaries="1:26:38:55:65:104:-"
|
|
426 fi
|
23
|
427
|
33
|
428 mkdir $outdir/baseline/IGA_IGG_IGM
|
|
429 if [[ $(wc -l < $outdir/new_IMGT/1_Summary.txt) -gt "1" ]]; then
|
|
430 cd $outdir/baseline/IGA_IGG_IGM
|
37
|
431 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "${baseline_boundaries}" $outdir/new_IMGT.txz "IGA_IGG_IGM" "$dir/baseline/IMGTVHreferencedataset20161215.fa" "$outdir/baseline.pdf" "Sequence.ID" "$outdir/baseline.txt"
|
33
|
432 else
|
|
433 echo "No sequences" > "$outdir/baseline.txt"
|
|
434 fi
|
|
435
|
|
436 mkdir $outdir/baseline/IGA
|
|
437 if [[ $(wc -l < $outdir/new_IMGT_IGA/1_Summary.txt) -gt "1" ]]; then
|
|
438 cd $outdir/baseline/IGA
|
37
|
439 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "${baseline_boundaries}" $outdir/new_IMGT_IGA.txz "IGA" "$dir/baseline/IMGTVHreferencedataset20161215.fa" "$outdir/baseline_IGA.pdf" "Sequence.ID" "$outdir/baseline_IGA.txt"
|
33
|
440 else
|
|
441 echo "No IGA sequences" > "$outdir/baseline_IGA.txt"
|
|
442 fi
|
|
443
|
|
444 mkdir $outdir/baseline/IGG
|
|
445 if [[ $(wc -l < $outdir/new_IMGT_IGG/1_Summary.txt) -gt "1" ]]; then
|
|
446 cd $outdir/baseline/IGG
|
37
|
447 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "${baseline_boundaries}" $outdir/new_IMGT_IGG.txz "IGG" "$dir/baseline/IMGTVHreferencedataset20161215.fa" "$outdir/baseline_IGG.pdf" "Sequence.ID" "$outdir/baseline_IGG.txt"
|
33
|
448 else
|
|
449 echo "No IGG sequences" > "$outdir/baseline_IGG.txt"
|
|
450 fi
|
23
|
451
|
33
|
452 mkdir $outdir/baseline/IGM
|
|
453 if [[ $(wc -l < $outdir/new_IMGT_IGM/1_Summary.txt) -gt "1" ]]; then
|
|
454 cd $outdir/baseline/IGM
|
37
|
455 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "${baseline_boundaries}" $outdir/new_IMGT_IGM.txz "IGM" "$dir/baseline/IMGTVHreferencedataset20161215.fa" "$outdir/baseline_IGM.pdf" "Sequence.ID" "$outdir/baseline_IGM.txt"
|
33
|
456 else
|
|
457 echo "No IGM sequences" > "$outdir/baseline_IGM.txt"
|
|
458 fi
|
|
459
|
|
460 mkdir $outdir/baseline/IGE
|
|
461 if [[ $(wc -l < $outdir/new_IMGT_IGE/1_Summary.txt) -gt "1" ]]; then
|
|
462 cd $outdir/baseline/IGE
|
37
|
463 bash $dir/baseline/wrapper.sh 1 1 1 1 0 0 "${baseline_boundaries}" $outdir/new_IMGT_IGE.txz "IGE" "$dir/baseline/IMGTVHreferencedataset20161215.fa" "$outdir/baseline_IGE.pdf" "Sequence.ID" "$outdir/baseline_IGE.txt"
|
33
|
464 else
|
|
465 echo "No IGE sequences" > "$outdir/baseline_IGE.txt"
|
|
466 fi
|
|
467
|
|
468 cd $tmp
|
23
|
469
|
33
|
470 echo "Cleaning up *.RData files"
|
|
471 find $outdir/baseline -name "*.RData" -type f -delete
|
|
472
|
|
473 if [ -e $outdir/baseline.pdf ]
|
|
474 then
|
|
475 echo "<embed src='baseline.pdf' width='700px' height='1000px'>" >> $output
|
|
476 fi
|
|
477
|
|
478 if [ -e $outdir/baseline_IGA.pdf ]
|
|
479 then
|
|
480 echo "<embed src='baseline_IGA.pdf' width='700px' height='1000px'>" >> $output
|
|
481 fi
|
23
|
482
|
33
|
483 if [ -e $outdir/baseline_IGG.pdf ]
|
|
484 then
|
|
485 echo "<embed src='baseline_IGG.pdf' width='700px' height='1000px'>" >> $output
|
|
486 fi
|
|
487
|
|
488 if [ -e $outdir/baseline_IGM.pdf ]
|
|
489 then
|
|
490 echo "<embed src='baseline_IGM.pdf' width='700px' height='1000px'>" >> $output
|
|
491 fi
|
|
492
|
|
493 if [ -e $outdir/baseline_IGE.pdf ]
|
|
494 then
|
|
495 echo "<embed src='baseline_IGE.pdf' width='700px' height='1000px'>" >> $output
|
|
496 fi
|
23
|
497 fi
|
0
|
498
|
|
499 echo "</div>" >> $output #antigen selection tab end
|
|
500
|
|
501 echo "<div class='tabbertab' title='CSR'>" >> $output #CSR tab
|
|
502
|
23
|
503 if [ -e $outdir/IGA.png ]
|
0
|
504 then
|
|
505 echo "<img src='IGA.png'/><br />" >> $output
|
|
506 fi
|
23
|
507 if [ -e $outdir/IGG.png ]
|
0
|
508 then
|
|
509 echo "<img src='IGG.png'/><br />" >> $output
|
|
510 fi
|
|
511
|
|
512 echo "</div>" >> $output #CSR tab end
|
|
513
|
5
|
514 if [[ "$fast" == "no" ]] ; then
|
|
515
|
|
516 echo "---------------- change-o MakeDB ----------------"
|
0
|
517
|
5
|
518 mkdir $outdir/change_o
|
0
|
519
|
5
|
520 tmp="$PWD"
|
0
|
521
|
5
|
522 cd $outdir/change_o
|
0
|
523
|
5
|
524 bash $dir/change_o/makedb.sh $outdir/new_IMGT.txz false false false $outdir/change_o/change-o-db.txt
|
|
525 bash $dir/change_o/define_clones.sh bygroup $outdir/change_o/change-o-db.txt gene first ham none min complete 3.0 $outdir/change_o/change-o-db-defined_clones.txt $outdir/change_o/change-o-defined_clones-summary.txt
|
0
|
526
|
5
|
527 Rscript $dir/merge.r $outdir/change_o/change-o-db-defined_clones.txt $outdir/merged.txt "all" "Sequence.ID,best_match" "SEQUENCE_ID" "Sequence.ID" $outdir/change_o/change-o-db-defined_clones.txt 2>&1
|
0
|
528
|
5
|
529 echo "Rscript $dir/merge.r $outdir/change_o/change-o-db-defined_clones.txt $outdir/$outdir/merged.txt 'all' 'Sequence.ID,best_match' 'Sequence.ID' 'Sequence.ID' '\t' $outdir/change_o/change-o-db-defined_clones.txt 2>&1"
|
0
|
530
|
5
|
531 if [[ $(wc -l < $outdir/new_IMGT_IGA/1_Summary.txt) -gt "1" ]]; then
|
|
532 bash $dir/change_o/makedb.sh $outdir/new_IMGT_IGA.txz false false false $outdir/change_o/change-o-db-IGA.txt
|
|
533 bash $dir/change_o/define_clones.sh bygroup $outdir/change_o/change-o-db-IGA.txt gene first ham none min complete 3.0 $outdir/change_o/change-o-db-defined_clones-IGA.txt $outdir/change_o/change-o-defined_clones-summary-IGA.txt
|
|
534 else
|
|
535 echo "No IGA sequences" > "$outdir/change_o/change-o-db-defined_clones-IGA.txt"
|
|
536 echo "No IGA sequences" > "$outdir/change_o/change-o-defined_clones-summary-IGA.txt"
|
|
537 fi
|
0
|
538
|
5
|
539 if [[ $(wc -l < $outdir/new_IMGT_IGG/1_Summary.txt) -gt "1" ]]; then
|
|
540 bash $dir/change_o/makedb.sh $outdir/new_IMGT_IGG.txz false false false $outdir/change_o/change-o-db-IGG.txt
|
|
541 bash $dir/change_o/define_clones.sh bygroup $outdir/change_o/change-o-db-IGG.txt gene first ham none min complete 3.0 $outdir/change_o/change-o-db-defined_clones-IGG.txt $outdir/change_o/change-o-defined_clones-summary-IGG.txt
|
|
542 else
|
|
543 echo "No IGG sequences" > "$outdir/change_o/change-o-db-defined_clones-IGG.txt"
|
|
544 echo "No IGG sequences" > "$outdir/change_o/change-o-defined_clones-summary-IGG.txt"
|
|
545 fi
|
0
|
546
|
5
|
547 if [[ $(wc -l < $outdir/new_IMGT_IGM/1_Summary.txt) -gt "1" ]]; then
|
|
548 bash $dir/change_o/makedb.sh $outdir/new_IMGT_IGM.txz false false false $outdir/change_o/change-o-db-IGM.txt
|
|
549 bash $dir/change_o/define_clones.sh bygroup $outdir/change_o/change-o-db-IGM.txt gene first ham none min complete 3.0 $outdir/change_o/change-o-db-defined_clones-IGM.txt $outdir/change_o/change-o-defined_clones-summary-IGM.txt
|
|
550 else
|
|
551 echo "No IGM sequences" > "$outdir/change_o/change-o-db-defined_clones-IGM.txt"
|
|
552 echo "No IGM sequences" > "$outdir/change_o/change-o-defined_clones-summary-IGM.txt"
|
|
553 fi
|
0
|
554
|
6
|
555 if [[ $(wc -l < $outdir/new_IMGT_IGE/1_Summary.txt) -gt "1" ]]; then
|
|
556 bash $dir/change_o/makedb.sh $outdir/new_IMGT_IGE.txz false false false $outdir/change_o/change-o-db-IGE.txt
|
|
557 bash $dir/change_o/define_clones.sh bygroup $outdir/change_o/change-o-db-IGE.txt gene first ham none min complete 3.0 $outdir/change_o/change-o-db-defined_clones-IGE.txt $outdir/change_o/change-o-defined_clones-summary-IGE.txt
|
|
558 else
|
|
559 echo "No IGE sequences" > "$outdir/change_o/change-o-db-defined_clones-IGE.txt"
|
|
560 echo "No IGE sequences" > "$outdir/change_o/change-o-defined_clones-summary-IGE.txt"
|
|
561 fi
|
|
562
|
5
|
563 PWD="$tmp"
|
0
|
564
|
16
|
565 echo "<div class='tabbertab' title='Clonality'>" >> $output #clonality tab
|
0
|
566
|
16
|
567 function clonality_table {
|
|
568 local infile=$1
|
|
569 local outfile=$2
|
|
570
|
|
571 echo "<table class='pure-table pure-table-striped'>" >> $outfile
|
|
572 echo "<thead><tr><th>Clone size</th><th>Nr of clones</th><th>Nr of sequences</th></tr></thead>" >> $outfile
|
|
573
|
|
574 first='true'
|
|
575
|
|
576 while read size clones seqs
|
|
577 do
|
|
578 if [[ "$first" == "true" ]]; then
|
|
579 first="false"
|
|
580 continue
|
|
581 fi
|
|
582 echo "<tr><td>$size</td><td>$clones</td><td>$seqs</td></tr>" >> $outfile
|
|
583 done < $infile
|
|
584
|
|
585 echo "</table>" >> $outfile
|
|
586 }
|
|
587 echo "<div class='tabber'>" >> $output
|
0
|
588
|
16
|
589 echo "<div class='tabbertab' title='All'>" >> $output
|
|
590 clonality_table $outdir/change_o/change-o-defined_clones-summary.txt $output
|
|
591 echo "</div>" >> $output
|
0
|
592
|
16
|
593 echo "<div class='tabbertab' title='IGA'>" >> $output
|
|
594 clonality_table $outdir/change_o/change-o-defined_clones-summary-IGA.txt $output
|
|
595 echo "</div>" >> $output
|
0
|
596
|
16
|
597 echo "<div class='tabbertab' title='IGG'>" >> $output
|
|
598 clonality_table $outdir/change_o/change-o-defined_clones-summary-IGG.txt $output
|
|
599 echo "</div>" >> $output
|
0
|
600
|
16
|
601 echo "<div class='tabbertab' title='IGM'>" >> $output
|
|
602 clonality_table $outdir/change_o/change-o-defined_clones-summary-IGM.txt $output
|
|
603 echo "</div>" >> $output
|
6
|
604
|
16
|
605 echo "<div class='tabbertab' title='IGE'>" >> $output
|
|
606 clonality_table $outdir/change_o/change-o-defined_clones-summary-IGM.txt $output
|
|
607 echo "</div>" >> $output
|
0
|
608
|
23
|
609 echo "<div class='tabbertab' title='Overlap'>" >> $output
|
31
|
610 cat "$outdir/sequence_overview/index.html" | sed "s%href='\(.*\).html%href='sequence_overview/\1.html%g" >> $output # rewrite href to 'sequence_overview/..."
|
16
|
611 echo "</div>" >> $output
|
0
|
612
|
|
613
|
16
|
614 echo "</div>" >> $output #clonality tabber end
|
0
|
615
|
16
|
616 echo "</div>" >> $output #clonality tab end
|
0
|
617
|
5
|
618 fi
|
|
619
|
0
|
620 echo "<div class='tabbertab' title='Downloads'>" >> $output
|
|
621
|
|
622 echo "<table class='pure-table pure-table-striped'>" >> $output
|
|
623 echo "<thead><tr><th>info</th><th>link</th></tr></thead>" >> $output
|
|
624 echo "<tr><td>The complete dataset</td><td><a href='merged.txt' download='merged.txt' >Download</a></td></tr>" >> $output
|
|
625 echo "<tr><td>The filtered dataset</td><td><a href='filtered.txt' download='filtered.txt' >Download</a></td></tr>" >> $output
|
|
626 echo "<tr><td>The alignment info on the unmatched sequences</td><td><a href='unmatched.txt' download='unmatched.txt' >Download</a></td></tr>" >> $output
|
|
627
|
2
|
628 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>SHM Overview</td></tr>" >> $output
|
23
|
629 echo "<tr><td>The SHM Overview table as a dataset</td><td><a href='shm_overview.txt' download='shm_overview.txt' >Download</a></td></tr>" >> $output
|
2
|
630 echo "<tr><td>Motif data per sequence ID</td><td><a href='motif_per_seq.txt' download='motif_per_seq.txt' >Download</a></td></tr>" >> $output
|
|
631 echo "<tr><td>Mutation data per sequence ID</td><td><a href='mutation_by_id.txt' download='mutation_by_id.txt' >Download</a></td></tr>" >> $output
|
|
632 echo "<tr><td>Base count for every sequence</td><td><a href='base_overview.html'>View</a></td></tr>" >> $output
|
|
633 echo "<tr><td>The data used to generate the RGYW/WRCY and TW/WA plot</td><td><a href='plot1.txt' download='plot1.txt' >Download</a></td></tr>" >> $output
|
|
634 echo "<tr><td>The data used to generate the relative transition and transversion plot</td><td><a href='plot2.txt' download='plot2.txt' >Download</a></td></tr>" >> $output
|
|
635 echo "<tr><td>The data used to generate the absolute transition and transversion plot</td><td><a href='plot3.txt' download='plot3.txt' >Download</a></td></tr>" >> $output
|
|
636
|
|
637 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>SHM Frequency</td></tr>" >> $output
|
0
|
638 echo "<tr><td>The data generate the frequency scatter plot</td><td><a href='scatter.txt' download='scatter.txt' >Download</a></td></tr>" >> $output
|
|
639 echo "<tr><td>The data used to generate the frequency by class plot</td><td><a href='frequency_ranges_classes.txt' download='frequency_ranges_classes.txt' >Download</a></td></tr>" >> $output
|
|
640 echo "<tr><td>The data for frequency by subclass</td><td><a href='frequency_ranges_subclasses.txt' download='frequency_ranges_subclasses.txt' >Download</a></td></tr>" >> $output
|
|
641
|
2
|
642 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Transition Tables</td></tr>" >> $output
|
23
|
643 echo "<tr><td>The data for the 'all' transition plot</td><td><a href='transitions_all_sum.txt' download='transitions_all_sum.txt' >Download</a></td></tr>" >> $output
|
|
644 echo "<tr><td>The data for the 'IGA' transition plot</td><td><a href='transitions_IGA_sum.txt' download='transitions_all_sum.txt' >Download</a></td></tr>" >> $output
|
|
645 echo "<tr><td>The data for the 'IGA1' transition plot</td><td><a href='transitions_IGA1_sum.txt' download='transitions_IGA1_sum.txt' >Download</a></td></tr>" >> $output
|
30
|
646 echo "<tr><td>The data for the 'IGA2' transition plot</td><td><a href='transitions_IGA2_sum.txt' download='transitions_IGA2_sum.txt' >Download</a></td></tr>" >> $output
|
23
|
647 echo "<tr><td>The data for the 'IGG' transition plot</td><td><a href='transitions_IGG_sum.txt' download='transitions_IGG_sum.txt' >Download</a></td></tr>" >> $output
|
|
648 echo "<tr><td>The data for the 'IGG1' transition plot</td><td><a href='transitions_IGG1_sum.txt' download='transitions_IGG1_sum.txt' >Download</a></td></tr>" >> $output
|
|
649 echo "<tr><td>The data for the 'IGG2' transition plot</td><td><a href='transitions_IGG2_sum.txt' download='transitions_IGG2_sum.txt' >Download</a></td></tr>" >> $output
|
|
650 echo "<tr><td>The data for the 'IGG3' transition plot</td><td><a href='transitions_IGG3_sum.txt' download='transitions_IGG3_sum.txt' >Download</a></td></tr>" >> $output
|
|
651 echo "<tr><td>The data for the 'IGG4' transition plot</td><td><a href='transitions_IGG4_sum.txt' download='transitions_IGG4_sum.txt' >Download</a></td></tr>" >> $output
|
|
652 echo "<tr><td>The data for the 'IGM' transition plot</td><td><a href='transitions_IGM_sum.txt' download='transitions_IGM_sum.txt' >Download</a></td></tr>" >> $output
|
|
653 echo "<tr><td>The data for the 'IGE' transition plot</td><td><a href='transitions_IGE_sum.txt' download='transitions_IGE_sum.txt' >Download</a></td></tr>" >> $output
|
0
|
654
|
2
|
655 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Antigen Selection</td></tr>" >> $output
|
0
|
656 echo "<tr><td>AA mutation data per sequence ID</td><td><a href='aa_id_mutations.txt' download='aa_id_mutations.txt' >Download</a></td></tr>" >> $output
|
|
657 echo "<tr><td>Absent AA location data per sequence ID</td><td><a href='absent_aa_id.txt' download='absent_aa_id.txt' >Download</a></td></tr>" >> $output
|
|
658
|
29
|
659 echo "<tr><td>The data used to generate the aa mutation frequency plot</td><td><a href='aa_histogram_sum.txt' download='aa_histogram_sum.txt' >Download</a></td></tr>" >> $output
|
|
660 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGA</td><td><a href='aa_histogram_sum_IGA.txt' download='aa_histogram_sum_IGA.txt' >Download</a></td></tr>" >> $output
|
|
661 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGG</td><td><a href='aa_histogram_sum_IGG.txt' download='aa_histogram_sum_IGG.txt' >Download</a></td></tr>" >> $output
|
|
662 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGM</td><td><a href='aa_histogram_sum_IGM.txt' download='aa_histogram_sum_IGM.txt' >Download</a></td></tr>" >> $output
|
|
663 echo "<tr><td>The data used to generate the aa mutation frequency plot for IGE</td><td><a href='aa_histogram_sum_IGE.txt' download='aa_histogram_sum_IGE.txt' >Download</a></td></tr>" >> $output
|
|
664
|
0
|
665 echo "<tr><td>Baseline PDF (<a href='http://selection.med.yale.edu/baseline/'>http://selection.med.yale.edu/baseline/</a>)</td><td><a href='baseline.pdf' download='baseline.pdf' >Download</a></td></tr>" >> $output
|
|
666 echo "<tr><td>Baseline data</td><td><a href='baseline.txt' download='baseline.txt' >Download</a></td></tr>" >> $output
|
|
667 echo "<tr><td>Baseline IGA PDF</td><td><a href='baseline_IGA.pdf' download='baseline_IGA.pdf' >Download</a></td></tr>" >> $output
|
|
668 echo "<tr><td>Baseline IGA data</td><td><a href='baseline_IGA.txt' download='baseline_IGA.txt' >Download</a></td></tr>" >> $output
|
|
669 echo "<tr><td>Baseline IGG PDF</td><td><a href='baseline_IGG.pdf' download='baseline_IGG.pdf' >Download</a></td></tr>" >> $output
|
|
670 echo "<tr><td>Baseline IGG data</td><td><a href='baseline_IGG.txt' download='baseline_IGG.txt' >Download</a></td></tr>" >> $output
|
|
671 echo "<tr><td>Baseline IGM PDF</td><td><a href='baseline_IGM.pdf' download='baseline_IGM.pdf' >Download</a></td></tr>" >> $output
|
|
672 echo "<tr><td>Baseline IGM data</td><td><a href='baseline_IGM.txt' download='baseline_IGM.txt' >Download</a></td></tr>" >> $output
|
31
|
673 echo "<tr><td>Baseline IGE PDF</td><td><a href='baseline_IGE.pdf' download='baseline_IGE.pdf' >Download</a></td></tr>" >> $output
|
6
|
674 echo "<tr><td>Baseline IGE data</td><td><a href='baseline_IGE.txt' download='baseline_IGE.txt' >Download</a></td></tr>" >> $output
|
0
|
675
|
2
|
676 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>CSR</td></tr>" >> $output
|
|
677 echo "<tr><td>The data for the CSR IGA pie plot</td><td><a href='IGA_pie.txt' download='IGA_pie.txt' >Download</a></td></tr>" >> $output
|
|
678 echo "<tr><td>The data for the CSR IGG pie plot</td><td><a href='IGG_pie.txt' download='IGG_pie.txt' >Download</a></td></tr>" >> $output
|
|
679
|
|
680 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Clonality</td></tr>" >> $output
|
|
681 echo "<tr><td>Sequence overlap between subclasses</td><td><a href='sequence_overview/index.html'>View</a></td></tr>" >> $output
|
|
682 echo "<tr><td>The Change-O DB file with defined clones and subclass annotation</td><td><a href='change_o/change-o-db-defined_clones.txt' download='change_o/change-o-db-defined_clones.txt' >Download</a></td></tr>" >> $output
|
|
683 echo "<tr><td>The Change-O DB defined clones summary file</td><td><a href='change_o/change-o-defined_clones-summary.txt' download='change_o/change-o-defined_clones-summary.txt' >Download</a></td></tr>" >> $output
|
|
684 echo "<tr><td>The Change-O DB file with defined clones of IGA</td><td><a href='change_o/change-o-db-defined_clones-IGA.txt' download='change_o/change-o-db-defined_clones-IGA.txt' >Download</a></td></tr>" >> $output
|
|
685 echo "<tr><td>The Change-O DB defined clones summary file of IGA</td><td><a href='change_o/change-o-defined_clones-summary-IGA.txt' download='change_o/change-o-defined_clones-summary-IGA.txt' >Download</a></td></tr>" >> $output
|
|
686 echo "<tr><td>The Change-O DB file with defined clones of IGG</td><td><a href='change_o/change-o-db-defined_clones-IGG.txt' download='change_o/change-o-db-defined_clones-IGG.txt' >Download</a></td></tr>" >> $output
|
|
687 echo "<tr><td>The Change-O DB defined clones summary file of IGG</td><td><a href='change_o/change-o-defined_clones-summary-IGG.txt' download='change_o/change-o-defined_clones-summary-IGG.txt' >Download</a></td></tr>" >> $output
|
|
688 echo "<tr><td>The Change-O DB file with defined clones of IGM</td><td><a href='change_o/change-o-db-defined_clones-IGM.txt' download='change_o/change-o-db-defined_clones-IGM.txt' >Download</a></td></tr>" >> $output
|
|
689 echo "<tr><td>The Change-O DB defined clones summary file of IGM</td><td><a href='change_o/change-o-defined_clones-summary-IGM.txt' download='change_o/change-o-defined_clones-summary-IGM.txt' >Download</a></td></tr>" >> $output
|
6
|
690 echo "<tr><td>The Change-O DB file with defined clones of IGE</td><td><a href='change_o/change-o-db-defined_clones-IGE.txt' download='change_o/change-o-db-defined_clones-IGE.txt' >Download</a></td></tr>" >> $output
|
|
691 echo "<tr><td>The Change-O DB defined clones summary file of IGE</td><td><a href='change_o/change-o-defined_clones-summary-IGE.txt' download='change_o/change-o-defined_clones-summary-IGE.txt' >Download</a></td></tr>" >> $output
|
2
|
692
|
|
693 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Filtered IMGT output files</td></tr>" >> $output
|
0
|
694 echo "<tr><td>An IMGT archive with just the matched and filtered sequences</td><td><a href='new_IMGT.txz' download='new_IMGT.txz' >Download</a></td></tr>" >> $output
|
|
695 echo "<tr><td>An IMGT archive with just the matched and filtered IGA sequences</td><td><a href='new_IMGT_IGA.txz' download='new_IMGT_IGA.txz' >Download</a></td></tr>" >> $output
|
|
696 echo "<tr><td>An IMGT archive with just the matched and filtered IGA1 sequences</td><td><a href='new_IMGT_IGA1.txz' download='new_IMGT_IGA1.txz' >Download</a></td></tr>" >> $output
|
|
697 echo "<tr><td>An IMGT archive with just the matched and filtered IGA2 sequences</td><td><a href='new_IMGT_IGA2.txz' download='new_IMGT_IGA2.txz' >Download</a></td></tr>" >> $output
|
|
698 echo "<tr><td>An IMGT archive with just the matched and filtered IGG sequences</td><td><a href='new_IMGT_IGG.txz' download='new_IMGT_IGG.txz' >Download</a></td></tr>" >> $output
|
|
699 echo "<tr><td>An IMGT archive with just the matched and filtered IGG1 sequences</td><td><a href='new_IMGT_IGG1.txz' download='new_IMGT_IGG1.txz' >Download</a></td></tr>" >> $output
|
|
700 echo "<tr><td>An IMGT archive with just the matched and filtered IGG2 sequences</td><td><a href='new_IMGT_IGG2.txz' download='new_IMGT_IGG2.txz' >Download</a></td></tr>" >> $output
|
|
701 echo "<tr><td>An IMGT archive with just the matched and filtered IGG3 sequences</td><td><a href='new_IMGT_IGG3.txz' download='new_IMGT_IGG3.txz' >Download</a></td></tr>" >> $output
|
|
702 echo "<tr><td>An IMGT archive with just the matched and filtered IGG4 sequences</td><td><a href='new_IMGT_IGG4.txz' download='new_IMGT_IGG4.txz' >Download</a></td></tr>" >> $output
|
|
703 echo "<tr><td>An IMGT archive with just the matched and filtered IGM sequences</td><td><a href='new_IMGT_IGM.txz' download='new_IMGT_IGM.txz' >Download</a></td></tr>" >> $output
|
31
|
704 echo "<tr><td>An IMGT archive with just the matched and filtered IGE sequences</td><td><a href='new_IMGT_IGE.txz' download='new_IMGT_IGE.txz' >Download</a></td></tr>" >> $output
|
0
|
705
|
|
706 echo "</table>" >> $output
|
|
707
|
|
708 echo "</div>" >> $output #downloads tab end
|
|
709
|
|
710 echo "</div>" >> $output #tabs end
|
|
711
|
|
712 echo "</html>" >> $output
|
|
713
|
5
|
714
|
0
|
715 echo "---------------- naive_output.r ----------------"
|
|
716 echo "---------------- naive_output.r ----------------<br />" >> $log
|
|
717
|
5
|
718 if [[ "$naive_output" == "yes" ]]
|
0
|
719 then
|
28
|
720 echo "output naive output"
|
18
|
721 if [[ "${class_filter}" == "101_101" ]]
|
|
722 then
|
28
|
723 echo "copy new_IMGT.txz to ${naive_output_all}"
|
21
|
724 cp $outdir/new_IMGT.txz ${naive_output_all}
|
18
|
725 else
|
28
|
726 echo "copy for classes"
|
18
|
727 cp $outdir/new_IMGT_IGA.txz ${naive_output_ca}
|
|
728 cp $outdir/new_IMGT_IGG.txz ${naive_output_cg}
|
|
729 cp $outdir/new_IMGT_IGM.txz ${naive_output_cm}
|
|
730 cp $outdir/new_IMGT_IGE.txz ${naive_output_ce}
|
|
731 fi
|
0
|
732 fi
|
|
733
|
|
734 echo "</table>" >> $outdir/base_overview.html
|
|
735
|
|
736 mv $log $outdir/log.html
|
|
737
|
|
738 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 />" > $log
|
|
739 echo "<table border = 1>" >> $log
|
|
740 echo "<thead><tr><th>Info</th><th>Sequences</th><th>Percentage</th></tr></thead>" >> $log
|
|
741 tIFS="$TMP"
|
|
742 IFS=$'\t'
|
|
743 while read step seq perc
|
|
744 do
|
|
745 echo "<tr>" >> $log
|
|
746 echo "<td>$step</td>" >> $log
|
|
747 echo "<td>$seq</td>" >> $log
|
|
748 echo "<td>${perc}%</td>" >> $log
|
|
749 echo "</tr>" >> $log
|
|
750 done < $outdir/filtering_steps.txt
|
|
751 echo "</table border></center></html>" >> $log
|
|
752
|
|
753 IFS="$tIFS"
|
|
754
|
|
755
|
|
756 echo "---------------- Done! ----------------"
|
|
757 echo "---------------- Done! ----------------<br />" >> $outdir/log.html
|
|
758
|
|
759
|
|
760
|
|
761
|
|
762
|
|
763
|
|
764
|
|
765
|
|
766
|
|
767
|
|
768
|
|
769
|
|
770
|
|
771
|
|
772
|
|
773
|
|
774
|
|
775
|
|
776
|
|
777
|
|
778
|