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