annotate wrapper.sh @ 93:8fcf31272f6e draft

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