annotate wrapper.sh @ 0:8a5a2abbb870 draft default tip

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