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