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