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