0
|
1 #!/bin/bash
|
4
|
2 set -e
|
0
|
3 dir="$(cd "$(dirname "$0")" && pwd)"
|
|
4 input=$1
|
19
|
5 method=$2
|
102
|
6 log=$3 #becomes the main html page at the end
|
19
|
7 outdir=$4
|
102
|
8 output="$outdir/index.html" #copied to $log location at the end
|
19
|
9 title=$5
|
22
|
10 include_fr1=$6
|
34
|
11 functionality=$7
|
|
12 unique=$8
|
69
|
13 naive_output_ca=$9
|
|
14 naive_output_cg=${10}
|
|
15 naive_output_cm=${11}
|
|
16 filter_unique=${12}
|
|
17 class_filter=${13}
|
0
|
18 mkdir $outdir
|
|
19
|
55
|
20 echo "---------------- read parameters ----------------"
|
102
|
21 echo "---------------- read parameters ----------------<br />" > $log
|
55
|
22
|
|
23 echo "unpacking IMGT file"
|
|
24
|
89
|
25
|
|
26
|
35
|
27 type="`file $input`"
|
|
28 if [[ "$type" == *"Zip archive"* ]] ; then
|
|
29 echo "Zip archive"
|
|
30 echo "unzip $input -d $PWD/files/"
|
|
31 unzip $input -d $PWD/files/
|
|
32 elif [[ "$type" == *"XZ compressed data"* ]] ; then
|
|
33 echo "ZX archive"
|
|
34 echo "tar -xJf $input -C $PWD/files/"
|
|
35 mkdir -p $PWD/files/$title
|
|
36 tar -xJf $input -C $PWD/files/$title
|
|
37 fi
|
|
38
|
64
|
39 cat `find $PWD/files/ -name "1_*"` > $PWD/summary.txt
|
|
40 cat `find $PWD/files/ -name "3_*"` > $PWD/sequences.txt
|
|
41 cat `find $PWD/files/ -name "5_*"` > $PWD/aa.txt
|
|
42 cat `find $PWD/files/ -name "6_*"` > $PWD/junction.txt
|
|
43 cat `find $PWD/files/ -name "7_*"` > $PWD/mutationanalysis.txt
|
|
44 cat `find $PWD/files/ -name "8_*"` > $PWD/mutationstats.txt
|
|
45 cat `find $PWD/files/ -name "10_*"` > $PWD/hotspots.txt
|
|
46
|
|
47 #cat $PWD/files/*/1_* > $PWD/summary.txt
|
|
48 #cat $PWD/files/*/3_* > $PWD/sequences.txt
|
|
49 #cat $PWD/files/*/5_* > $PWD/aa.txt
|
|
50 #cat $PWD/files/*/6_* > $PWD/junction.txt
|
|
51 #cat $PWD/files/*/7_* > $PWD/mutationanalysis.txt
|
|
52 #cat $PWD/files/*/8_* > $PWD/mutationstats.txt
|
|
53 #cat $PWD/files/*/10_* > $PWD/hotspots.txt
|
3
|
54
|
26
|
55 #BLASTN_DIR="/home/galaxy/tmp/blast/ncbi-blast-2.2.30+/bin"
|
19
|
56
|
|
57 echo "${BLASTN_DIR}"
|
|
58
|
89
|
59 echo "---------------- identification ($method) ----------------"
|
102
|
60 echo "---------------- identification ($method) ----------------<br />" >> $log
|
55
|
61
|
19
|
62 if [[ "${method}" == "custom" ]] ; then
|
|
63 python $dir/gene_identification.py --input $PWD/summary.txt --output $outdir/identified_genes.txt
|
|
64 else
|
|
65 ID_index=$(cat $PWD/summary.txt | grep -o -P ".+Sequence ID" | grep -o -P "\t" | wc -l)
|
|
66 ID_index=$((ID_index+1))
|
|
67 sequence_index=$(cat $PWD/summary.txt | grep -o -P ".+\tSequence" | grep -o -P "\t" | wc -l)
|
|
68 sequence_index=$((sequence_index+1))
|
|
69
|
|
70 cat $PWD/summary.txt | tail -n+2 | cut -f ${ID_index},${sequence_index} | awk '{print ">" $1 "\n" $2}' > $PWD/sequences.fasta
|
|
71
|
|
72 echo -e "qseqid\tsseqid\tpident\tlength\tmismatch\tgapopen\tqstart\tqend\tsstart\tsend\tevalue\tbitscore" > $outdir/identified_genes.txt
|
|
73 ${BLASTN_DIR}/blastn -task blastn -db $dir/subclass_definition.db -query $PWD/sequences.fasta -outfmt 6 >> $outdir/identified_genes.txt
|
|
74 fi
|
|
75
|
55
|
76 echo "---------------- merge_and_filter.r ----------------"
|
102
|
77 echo "---------------- merge_and_filter.r ----------------<br />" >> $log
|
19
|
78
|
90
|
79 Rscript $dir/merge_and_filter.r $PWD/summary.txt $PWD/sequences.txt $PWD/mutationanalysis.txt $PWD/mutationstats.txt $PWD/hotspots.txt $outdir/identified_genes.txt $outdir/merged.txt $outdir/before_unique_filter.txt $outdir/unmatched.txt $method $functionality $unique ${filter_unique} ${class_filter} 2>&1
|
0
|
80
|
98
|
81 echo "---------------- creating new IMGT zip ----------------"
|
102
|
82 echo "---------------- creating new IMGT zip ----------------<br />" >> $log
|
95
|
83
|
|
84 mkdir $outdir/new_IMGT
|
|
85
|
|
86 cat `find $PWD/files/ -name "1_*"` > "$outdir/new_IMGT/1_Summary.txt"
|
|
87 cat `find $PWD/files/ -name "2_*"` > "$outdir/new_IMGT/2_IMGT-gapped-nt-sequences.txt"
|
|
88 cat `find $PWD/files/ -name "3_*"` > "$outdir/new_IMGT/3_Nt-sequences.txt"
|
|
89 cat `find $PWD/files/ -name "4_*"` > "$outdir/new_IMGT/4_IMGT-gapped-AA-sequences.txt"
|
|
90 cat `find $PWD/files/ -name "5_*"` > "$outdir/new_IMGT/5_AA-sequences.txt"
|
|
91 cat `find $PWD/files/ -name "6_*"` > "$outdir/new_IMGT/6_Junction.txt"
|
|
92 cat `find $PWD/files/ -name "7_*"` > "$outdir/new_IMGT/7_V-REGION-mutation-and-AA-change-table.txt"
|
|
93 cat `find $PWD/files/ -name "8_*"` > "$outdir/new_IMGT/8_V-REGION-nt-mutation-statistics.txt"
|
|
94 cat `find $PWD/files/ -name "9_*"` > "$outdir/new_IMGT/9_V-REGION-AA-change-statistics.txt"
|
|
95 cat `find $PWD/files/ -name "10_*"` > "$outdir/new_IMGT/10_V-REGION-mutation-hotspots.txt"
|
|
96
|
99
|
97 mkdir $outdir/new_IMGT_ca
|
|
98 cp $outdir/new_IMGT/* $outdir/new_IMGT_ca
|
|
99
|
|
100 mkdir $outdir/new_IMGT_cg
|
|
101 cp $outdir/new_IMGT/* $outdir/new_IMGT_cg
|
|
102
|
|
103 mkdir $outdir/new_IMGT_cm
|
|
104 cp $outdir/new_IMGT/* $outdir/new_IMGT_cm
|
|
105
|
|
106 Rscript $dir/tmp/igat.r $outdir/new_IMGT/ $outdir/merged.txt "-" 2>&1
|
101
|
107 Rscript $dir/tmp/igat.r $outdir/new_IMGT_ca/ $outdir/merged.txt "ca" 2>&1
|
|
108 Rscript $dir/tmp/igat.r $outdir/new_IMGT_cg/ $outdir/merged.txt "cg" 2>&1
|
|
109 Rscript $dir/tmp/igat.r $outdir/new_IMGT_cm/ $outdir/merged.txt "cm" 2>&1
|
95
|
110
|
|
111
|
|
112 tmp="$PWD"
|
|
113 cd $outdir/new_IMGT/ #tar weirdness...
|
|
114 tar -cJf ../new_IMGT.txz *
|
|
115 cp $dir/tmp/IgAT.xlsm $outdir/new_IMGT/IgAT.xlsm
|
|
116 zip -r ../IgAT.zip *
|
|
117
|
99
|
118 cd $outdir/new_IMGT_ca/
|
|
119 tar -cJf ../new_IMGT_ca.txz *
|
|
120 cp $dir/tmp/IgAT.xlsm $outdir/new_IMGT_ca/IgAT.xlsm
|
|
121 zip -r ../IgAT_ca.zip *
|
|
122
|
|
123 cd $outdir/new_IMGT_cg/
|
|
124 tar -cJf ../new_IMGT_cg.txz *
|
|
125 cp $dir/tmp/IgAT.xlsm $outdir/new_IMGT_cg/IgAT.xlsm
|
|
126 zip -r ../IgAT_cg.zip *
|
|
127
|
|
128 cd $outdir/new_IMGT_cm/
|
|
129 tar -cJf ../new_IMGT_cm.txz *
|
|
130 cp $dir/tmp/IgAT.xlsm $outdir/new_IMGT_cm/IgAT.xlsm
|
|
131 zip -r ../IgAT_cm.zip *
|
|
132
|
95
|
133 cd $tmp
|
|
134
|
55
|
135 echo "---------------- mutation_analysis.r ----------------"
|
102
|
136 echo "---------------- mutation_analysis.r ----------------<br />" >> $log
|
55
|
137
|
82
|
138 classes="ca,ca1,ca2,cg,cg1,cg2,cg3,cg4,cm,unmatched"
|
4
|
139 echo "R mutation analysis"
|
82
|
140 Rscript $dir/mutation_analysis.r $outdir/merged.txt $classes $outdir ${include_fr1} 2>&1
|
53
|
141
|
55
|
142
|
|
143 echo "---------------- mutation_analysis.py ----------------"
|
102
|
144 echo "---------------- mutation_analysis.py ----------------<br />" >> $log
|
55
|
145
|
82
|
146 python $dir/mutation_analysis.py --input $outdir/merged.txt --genes $classes --includefr1 "${include_fr1}" --output $outdir/hotspot_analysis.txt
|
55
|
147
|
|
148 echo "---------------- aa_histogram.r ----------------"
|
105
|
149 echo "---------------- aa_histogram.r ----------------<br />" >> $log
|
55
|
150
|
104
|
151 Rscript $dir/aa_histogram.r $outdir/aa_mutations.txt $outdir/aa_histogram.png "" 2>&1
|
105
|
152
|
|
153 echo "---------------- aa_histogram.r ca ----------------"
|
|
154 echo "---------------- aa_histogram.r ca ----------------<br />" >> $log
|
|
155
|
104
|
156 Rscript $dir/aa_histogram.r $outdir/aa_mutations_ca.txt $outdir/aa_histogram_ca.png "ca" 2>&1
|
105
|
157
|
|
158 echo "---------------- aa_histogram.r cg ----------------"
|
|
159 echo "---------------- aa_histogram.r cg ----------------<br />" >> $log
|
|
160
|
104
|
161 Rscript $dir/aa_histogram.r $outdir/aa_mutations_cg.txt $outdir/aa_histogram_cg.png "cg" 2>&1
|
105
|
162
|
|
163 echo "---------------- aa_histogram.r cm ----------------"
|
|
164 echo "---------------- aa_histogram.r cm ----------------<br />" >> $log
|
|
165
|
104
|
166 Rscript $dir/aa_histogram.r $outdir/aa_mutations_cm.txt $outdir/aa_histogram_cm.png "cm" 2>&1
|
4
|
167
|
0
|
168 genes=(ca ca1 ca2 cg cg1 cg2 cg3 cg4 cm)
|
|
169
|
53
|
170 funcs=(sum mean median)
|
0
|
171
|
82
|
172 echo "---------------- sequence_overview.r ----------------"
|
102
|
173 echo "---------------- sequence_overview.r ----------------<br />" >> $log
|
82
|
174
|
|
175 mkdir $outdir/sequence_overview
|
|
176
|
90
|
177 #Rscript $dir/sequence_overview.r $outdir/identified_genes.txt $PWD/sequences.txt $outdir/merged.txt $outdir/sequence_overview $classes $outdir/hotspot_analysis_sum.txt 2>&1
|
100
|
178 Rscript $dir/sequence_overview.r $outdir/before_unique_filter.txt $outdir/merged.txt $outdir/sequence_overview $classes $outdir/hotspot_analysis_sum.txt 2>&1
|
82
|
179
|
|
180 echo "<table border='1'>" > $outdir/base_overview.html
|
|
181
|
92
|
182 while IFS=$'\t' read ID class seq A C G T
|
82
|
183 do
|
85
|
184 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
|
82
|
185 done < $outdir/sequence_overview/ntoverview.txt
|
|
186
|
62
|
187 echo "<html><center><h1>$title</h1></center>" > $output
|
|
188
|
|
189 #display the matched/unmatched for clearity
|
|
190
|
98
|
191 matched_count="`cat $outdir/merged.txt | grep -v 'unmatched' | tail -n +2 | wc -l`"
|
62
|
192 unmatched_count="`cat $outdir/unmatched.txt | tail -n +2 | wc -l`"
|
|
193 total_count=$((matched_count + unmatched_count))
|
|
194 perc_count=$((unmatched_count / total_count * 100))
|
|
195 perc_count=`bc -l <<< "scale=2; ${unmatched_count} / ${total_count} * 100"`
|
|
196 perc_count=`bc -l <<< "scale=2; (${unmatched_count} / ${total_count} * 100 ) / 1"`
|
|
197
|
|
198 echo "<center><h2>Total: ${total_count}</h2></center>" >> $output
|
|
199 echo "<center><h2>Matched: ${matched_count} Unmatched: ${unmatched_count}</h2></center>" >> $output
|
|
200 echo "<center><h2>Percentage unmatched: ${perc_count}</h2></center>" >> $output
|
|
201
|
55
|
202 echo "---------------- main tables ----------------"
|
102
|
203 echo "---------------- main tables ----------------<br />" >> $log
|
53
|
204 for func in ${funcs[@]}
|
4
|
205 do
|
55
|
206
|
|
207 echo "---------------- $func table ----------------"
|
102
|
208 echo "---------------- $func table ----------------<br />" >> $log
|
55
|
209
|
94
|
210 cat $outdir/mutations_${func}.txt $outdir/hotspot_analysis_${func}.txt > $outdir/data_${func}.txt
|
53
|
211
|
98
|
212 echo "<table border='1' width='100%'><caption><h3><a href='data_${func}.txt'>${func} table</a></h3></caption>" >> $output
|
58
|
213 echo "<tr><th>info</th>" >> $output
|
53
|
214 for gene in ${genes[@]}
|
|
215 do
|
|
216 tmp=`cat $outdir/${gene}_${func}_n.txt`
|
|
217 echo "<th><a href='matched_${gene}_${func}.txt'>${gene} (N = $tmp)</a></th>" >> $output
|
|
218 done
|
78
|
219
|
|
220 tmp=`cat $outdir/unmatched_${func}_n.txt`
|
79
|
221 echo "<th><a href='unmatched.txt'>unmatched (N = ${unmatched_count})</a></th>" >> $output
|
53
|
222 tmp=`cat $outdir/all_${func}_n.txt`
|
89
|
223 echo "<th><a href='matched_all_${func}.txt'>all (N = $tmp)</a></th>" >> $output
|
4
|
224
|
78
|
225 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 unx uny unz allx ally allz
|
53
|
226 do
|
|
227 if [ "$name" == "FR S/R (ratio)" ] || [ "$name" == "CDR S/R (ratio)" ] ; then #meh
|
|
228 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>${allx}/${ally} (${allz})</td></tr>" >> $output
|
|
229 else
|
78
|
230 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>${unx}/${uny} (${unz}%)</td><td>${allx}/${ally} (${allz}%)</td></tr>" >> $output
|
53
|
231 fi
|
94
|
232 done < $outdir/data_${func}.txt
|
|
233 echo "</table>" >> $output
|
|
234 #echo "<a href='data_${func}.txt'>Download data</a>" >> $output
|
53
|
235 done
|
|
236
|
55
|
237 echo "---------------- download links ----------------"
|
102
|
238 echo "---------------- download links ----------------<br />" >> $log
|
55
|
239
|
94
|
240
|
53
|
241 echo "<a href='unmatched.txt'>unmatched</a><br />" >> $output
|
|
242 echo "<a href='motif_per_seq.txt'>motif per sequence</a><br />" >> $output
|
|
243 echo "<a href='merged.txt'>all data</a><br />" >> $output
|
|
244 echo "<a href='mutation_by_id.txt'>mutations by id</a><br />" >> $output
|
|
245 echo "<a href='aa_id_mutations.txt'>AA mutations location by id</a><br />" >> $output
|
|
246 echo "<a href='absent_aa_id.txt'>Absant AA locations by id</a><br />" >> $output
|
77
|
247 echo "<a href='sequence_overview/index.html'>Sequence Overview</a><br />" >> $output
|
81
|
248 echo "<a href='base_overview.html'>Base overview</a><br />" >> $output
|
95
|
249 echo "<a href='baseline.pdf'>Baseline PDF</a><br />" >> $output
|
|
250 echo "<a href='baseline.txt'>Baseline Table</a><br />" >> $output
|
99
|
251 echo "<a href='baseline_ca.pdf'>Baseline ca PDF</a><br />" >> $output
|
|
252 echo "<a href='baseline_ca.txt'>Baseline ca Table</a><br />" >> $output
|
|
253 echo "<a href='baseline_cg.pdf'>Baseline cg PDF</a><br />" >> $output
|
|
254 echo "<a href='baseline_cg.txt'>Baseline cg Table</a><br />" >> $output
|
|
255 echo "<a href='baseline_cm.pdf'>Baseline cm PDF</a><br />" >> $output
|
|
256 echo "<a href='baseline_cm.txt'>Baseline cm Table</a><br />" >> $output
|
95
|
257 echo "<a href='IgAT.zip'>IgAT zip</a><br />" >> $output
|
99
|
258 echo "<a href='IgAT_ca.zip'>IgAT ca zip</a><br />" >> $output
|
|
259 echo "<a href='IgAT_cg.zip'>IgAT cg zip</a><br />" >> $output
|
|
260 echo "<a href='IgAT_cm.zip'>IgAT cm zip</a><br />" >> $output
|
|
261 echo "<a href='new_IMGT.txz'>Filtered IMGT zip</a><br />" >> $output
|
|
262 echo "<a href='new_IMGT_ca.txz'>Filtered ca IMGT zip</a><br />" >> $output
|
|
263 echo "<a href='new_IMGT_cg.txz'>Filtered cg IMGT zip</a><br />" >> $output
|
|
264 echo "<a href='new_IMGT_cm.txz'>Filtered cm IMGT zip</a><br />" >> $output
|
|
265
|
2
|
266
|
55
|
267 echo "---------------- images ----------------"
|
102
|
268 echo "---------------- images ----------------<br />" >> $log
|
55
|
269
|
4
|
270 echo "<img src='all.png'/><br />" >> $output
|
26
|
271 echo "<a href='all.txt'>download data</a><br />" >> $output
|
4
|
272 if [ -a $outdir/ca.png ]
|
|
273 then
|
|
274 echo "<img src='ca.png'/><br />" >> $output
|
26
|
275 echo "<a href='ca.txt'>download data</a><br />" >> $output
|
4
|
276 fi
|
|
277 if [ -a $outdir/cg.png ]
|
|
278 then
|
|
279 echo "<img src='cg.png'/><br />" >> $output
|
26
|
280 echo "<a href='cg.txt'>download data</a><br />" >> $output
|
4
|
281 fi
|
22
|
282 if [ -a $outdir/scatter.png ]
|
|
283 then
|
|
284 echo "<img src='scatter.png'/><br />" >> $output
|
26
|
285 echo "<a href='scatter.txt'>download data</a><br />" >> $output
|
|
286 fi
|
49
|
287 if [ -a $outdir/frequency_ranges.png ]
|
|
288 then
|
|
289 echo "<img src='frequency_ranges.png'/><br />" >> $output
|
|
290 echo "<a href='frequency_ranges_classes.txt'>download class data</a><br />" >> $output
|
|
291 echo "<a href='frequency_ranges_subclasses.txt'>download subclass data</a><br />" >> $output
|
|
292 fi
|
26
|
293 if [ -a $outdir/aa_histogram.png ]
|
|
294 then
|
|
295 echo "<img src='aa_histogram.png'/><br />" >> $output
|
|
296 echo "<a href='aa_histogram.txt'>download data</a><br />" >> $output
|
104
|
297 echo "<img src='aa_histogram_ca.png'/><br />" >> $output
|
|
298 echo "<a href='aa_histogram_ca.txt'>download data</a><br />" >> $output
|
|
299 echo "<img src='aa_histogram_cg.png'/><br />" >> $output
|
|
300 echo "<a href='aa_histogram_cg.txt'>download data</a><br />" >> $output
|
|
301 echo "<img src='aa_histogram_cm.png'/><br />" >> $output
|
|
302 echo "<a href='aa_histogram_cm.txt'>download data</a><br />" >> $output
|
22
|
303 fi
|
2
|
304
|
0
|
305 for gene in ${genes[@]}
|
|
306 do
|
|
307 echo "<table border='1'><caption>$gene transition table</caption>" >> $output
|
|
308 while IFS=, read from a c g t
|
|
309 do
|
|
310 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output
|
53
|
311 done < $outdir/transitions_${gene}_sum.txt
|
0
|
312 echo "</table>" >> $output
|
|
313 done
|
|
314
|
|
315 echo "<table border='1'><caption>All transition table</caption>" >> $output
|
|
316 while IFS=, read from a c g t
|
|
317 do
|
|
318 echo "<tr><td>$from</td><td>$a</td><td>$c</td><td>$g</td><td>$t</td></tr>" >> $output
|
53
|
319 done < $outdir/transitions_all_sum.txt
|
0
|
320 echo "</table>" >> $output
|
|
321
|
|
322 echo "</html>" >> $output
|
2
|
323
|
95
|
324 echo "---------------- baseline ----------------"
|
102
|
325 echo "---------------- baseline ----------------<br />" >> $log
|
101
|
326 tmp="$PWD"
|
|
327
|
|
328 mkdir $outdir/baseline
|
|
329
|
|
330
|
|
331 mkdir $outdir/baseline/ca_cg_cm
|
102
|
332 if [[ $(wc -l < $outdir/new_IMGT/1_Summary.txt) -gt "1" ]]; then
|
|
333 cd $outdir/baseline/ca_cg_cm
|
|
334 bash $dir/tmp/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT.txz "ca_cg_cm" "$dir/tmp/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline.pdf" "Sequence.ID" "$outdir/baseline.txt"
|
|
335 else
|
|
336 echo "No sequences" > "$outdir/baseline.txt"
|
|
337 fi
|
101
|
338
|
|
339 mkdir $outdir/baseline/ca
|
102
|
340 if [[ $(wc -l < $outdir/new_IMGT_ca/1_Summary.txt) -gt "1" ]]; then
|
|
341 cd $outdir/baseline/ca
|
|
342 bash $dir/tmp/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT_ca.txz "ca" "$dir/tmp/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline_ca.pdf" "Sequence.ID" "$outdir/baseline_ca.txt"
|
|
343 else
|
|
344 echo "No ca sequences" > "$outdir/baseline_ca.txt"
|
|
345 fi
|
101
|
346
|
|
347 mkdir $outdir/baseline/cg
|
102
|
348 if [[ $(wc -l < $outdir/new_IMGT_cg/1_Summary.txt) -gt "1" ]]; then
|
|
349 cd $outdir/baseline/cg
|
|
350 bash $dir/tmp/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT_cg.txz "cg" "$dir/tmp/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline_cg.pdf" "Sequence.ID" "$outdir/baseline_cg.txt"
|
|
351 else
|
|
352 echo "No cg sequences" > "$outdir/baseline_cg.txt"
|
|
353 fi
|
101
|
354
|
|
355 mkdir $outdir/baseline/cm
|
102
|
356 if [[ $(wc -l < $outdir/new_IMGT_cm/1_Summary.txt) -gt "1" ]]; then
|
|
357 cd $outdir/baseline/cm
|
|
358 bash $dir/tmp/baseline/wrapper.sh 1 1 1 1 0 0 "25:26:38:55:65:104:-" $outdir/new_IMGT_cm.txz "cm" "$dir/tmp/baseline/IMGT-reference-seqs-IGHV-2015-11-05.fa" "$outdir/baseline_cm.pdf" "Sequence.ID" "$outdir/baseline_cm.txt"
|
|
359 else
|
|
360 echo "No cm sequences" > "$outdir/baseline_cm.txt"
|
|
361 fi
|
47
|
362
|
101
|
363 cd $tmp
|
|
364
|
82
|
365 echo "---------------- naive_output.r ----------------"
|
102
|
366 echo "---------------- naive_output.r ----------------<br />" >> $log
|
55
|
367
|
47
|
368 if [[ "$naive_output" != "None" ]]
|
|
369 then
|
55
|
370 echo "---------------- imgt_loader.r ----------------"
|
102
|
371 echo "---------------- imgt_loader.r ----------------<br />" >> $log
|
50
|
372 #python $dir/imgt_loader.py --summ $PWD/summary.txt --aa $PWD/aa.txt --junction $PWD/junction.txt --output $naive_output
|
80
|
373 Rscript --verbose $dir/imgt_loader.r $PWD/summary.txt $PWD/aa.txt $PWD/junction.txt $outdir/loader_output.txt 2>&1
|
95
|
374
|
55
|
375 echo "---------------- naive_output.r ----------------"
|
102
|
376 echo "---------------- naive_output.r ----------------<br />" >> $log
|
81
|
377 Rscript $dir/naive_output.r $outdir/loader_output.txt $outdir/merged.txt ${naive_output_ca} ${naive_output_cg} ${naive_output_cm} $outdir/ntoverview.txt $outdir/ntsum.txt 2>&1
|
47
|
378 fi
|
|
379
|
81
|
380 echo "</table>" >> $outdir/base_overview.html
|
|
381
|
105
|
382 mv $log $outdir/log.html
|
|
383
|
|
384 cp $outdir/index.html $log
|
|
385
|
81
|
386 echo "---------------- Done! ----------------"
|
102
|
387 echo "---------------- Done! ----------------<br />" >> $log
|
47
|
388
|