annotate wrapper.sh @ 4:477e95b098fd draft

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