annotate report_clonality/r_wrapper.sh @ 44:1d8728f3ff37 draft

Uploaded
author davidvanzessen
date Fri, 08 Dec 2017 05:47:33 -0500
parents 106275b54470
children 942eea8359fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
1 #!/bin/bash
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
2
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
3 inputFile=$1
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
4 outputDir=$3
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
5 outputFile=$3/index.html #$2
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
6 clonalType=$4
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
7 species=$5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
8 locus=$6
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
9 filterproductive=$7
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
10 clonality_method=$8
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
11
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
12 dir="$(cd "$(dirname "$0")" && pwd)"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
13 useD="false"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
14 if grep -q "$species.*${locus}D" "$dir/genes.txt" ; then
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
15 echo "species D region in reference db"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
16 useD="true"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
17 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
18 echo "$species"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
19 if [[ "$species" == *"custom"* ]] ; then
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
20 loci=(${locus//;/ })
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
21 useD="true"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
22 echo "${loci[@]}"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
23 if [[ "${#loci[@]}" -eq "2" ]] ; then
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
24 useD="false"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
25 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
26 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
27 mkdir $3
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
28 cp $dir/genes.txt $outputDir
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
29 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType "$species" "$locus" $filterproductive ${clonality_method} 2>&1
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
30 cp $dir/tabber.js $outputDir
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
31 cp $dir/style.css $outputDir
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
32 cp $dir/script.js $outputDir
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
33 cp $dir/jquery-1.11.0.min.js $outputDir
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
34 cp $dir/pure-min.css $outputDir
17
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
35 cp $dir/IGH_junctie_analyse.png $outputDir
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
36 samples=`cat $outputDir/samples.txt`
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
37
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
38 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 />" > $2
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
39 echo "<table border = 1>" >> $2
19
3ef457aa5df6 Uploaded
davidvanzessen
parents: 18
diff changeset
40 echo "<thead><tr><th>Donor/Replicate</th><th>All</th><th>Productive</th><th>Unique Productive</th><th>Unproductive</th><th>Unique Unproductive</th></tr></thead>" >> $2
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
41 while IFS=, read sample all productive perc_prod productive_unique perc_prod_un unproductive perc_unprod unproductive_unique perc_unprod_un
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
42 do
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
43 echo "<tr><td>$sample</td>" >> $2
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
44 echo "<td>$all</td>" >> $2
40
106275b54470 Uploaded
davidvanzessen
parents: 38
diff changeset
45 if [[ "$productive" != "0" ]] ; then
106275b54470 Uploaded
davidvanzessen
parents: 38
diff changeset
46 echo "<td>$productive (${perc_prod}%)</td>" >> $2
106275b54470 Uploaded
davidvanzessen
parents: 38
diff changeset
47 echo "<td>$productive_unique (${perc_prod_un}%)</td>" >> $2
106275b54470 Uploaded
davidvanzessen
parents: 38
diff changeset
48 echo "<td>$unproductive (${perc_unprod}%)</td>" >> $2
106275b54470 Uploaded
davidvanzessen
parents: 38
diff changeset
49 echo "<td>$unproductive_unique (${perc_unprod_un}%)</td></tr>" >> $2
106275b54470 Uploaded
davidvanzessen
parents: 38
diff changeset
50 else
106275b54470 Uploaded
davidvanzessen
parents: 38
diff changeset
51 echo "<td colspan='4' style='background-color: red;'>No productive sequences!</td>" >> $2
106275b54470 Uploaded
davidvanzessen
parents: 38
diff changeset
52 fi
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
53 done < $outputDir/productive_counting.txt
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
54 echo "</table><br />" >> $2
19
3ef457aa5df6 Uploaded
davidvanzessen
parents: 18
diff changeset
55 echo "Table showing the number and percentage of (unique) productive and unproductive sequences per donor and per replicate. <br />" >> $2
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
56 echo "The definition of unique sequences is based on the clonal type definition filter setting chosen. " >> $2
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
57 echo "</center></html>" >> $2
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
58
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
59 echo "<html><head><title>Report on:" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
60
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
61 mkdir $outputDir/circos
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
62 cp $dir/circos/* $outputDir/circos/
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
63 #CIRCOSTOOLS="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/circos-tools-0.21/tools"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
64 #CIRCOSDIR="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
65
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
66 #CIRCOSTOOLS="/home/galaxy/circos/circos-tools-0.22/tools"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
67 #CIRCOSDIR="/home/galaxy/Anaconda3/bin"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
68
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
69 USECIRCOS="no"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
70 if [ -d "$CIRCOSDIR" ]; then
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
71 USECIRCOS="yes"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
72 else
12
5f5d29c5e711 Uploaded
davidvanzessen
parents: 8
diff changeset
73 if [ -d "/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/" ]; then #hopefully temporary fix
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
74 USECIRCOS="yes"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
75 CIRCOSTOOLS="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/circos-tools-0.21/tools"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
76 CIRCOSDIR="/data/galaxy/galaxy-dist/toolsheddependencies/circos/0.64/saskia-hiltemann/cg_circos_plots/bbfdd52d64fd/bin/"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
77 fi
12
5f5d29c5e711 Uploaded
davidvanzessen
parents: 8
diff changeset
78
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
79 if [ -d "/home/galaxy/Anaconda3/bin" ]; then #hopefully temporary fix #or not
12
5f5d29c5e711 Uploaded
davidvanzessen
parents: 8
diff changeset
80 USECIRCOS="yes"
5f5d29c5e711 Uploaded
davidvanzessen
parents: 8
diff changeset
81 CIRCOSTOOLS="/home/galaxy/circos/circos-tools-0.22/tools"
5f5d29c5e711 Uploaded
davidvanzessen
parents: 8
diff changeset
82 CIRCOSDIR="/home/galaxy/Anaconda3/bin"
5f5d29c5e711 Uploaded
davidvanzessen
parents: 8
diff changeset
83 fi
44
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
84
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
85 if [ -d "/media/galaxy/data/other_backup/circos/galaxian-circos//bin" ]; then #hopefully temporary fix #or not #really not
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
86 USECIRCOS="yes"
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
87 CIRCOSTOOLS="/media/galaxy/data/other_backup/circos/galaxian-circos/tools"
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
88 CIRCOSDIR="/media/galaxy/data/other_backup/circos/galaxian-circos/bin"
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
89 fi
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
90 fi
12
5f5d29c5e711 Uploaded
davidvanzessen
parents: 8
diff changeset
91
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
92 echo "Using Circos: $USECIRCOS"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
93 sed -i "s%DATA_DIR%$outputDir/circos%" $outputDir/circos/circos.conf
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
94 for sample in $samples; do #output the samples to a file and create the circos plots with the R script output
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
95 echo " $sample" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
96
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
97 if [[ "$USECIRCOS" != "yes" ]]; then
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
98 continue
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
99 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
100
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
101 circos_file="$outputDir/${sample}_VJ_circos.txt"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
102 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
44
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
103 echo "Circos tools command:"
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
104 echo "cat \"${circos_file}\" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/"
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
105 cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/
44
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
106 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
107 echo "Circos command:"
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
108 echo "$CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1"
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
109 $CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
110 mv $outputDir/circos/circos.png $outputDir/circosVJ_${sample}.png
36
edf2d5882b77 Uploaded
davidvanzessen
parents: 35
diff changeset
111 mv $outputDir/circos/circos.svg $outputDir/circosVJ_${sample}.svg
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
112
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
113
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
114 if [[ "$useD" == "true" ]] ; then
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
115 circos_file="$outputDir/${sample}_VD_circos.txt"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
116 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
117 cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/
44
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
118 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
119 $CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
120 mv $outputDir/circos/circos.png $outputDir/circosVD_${sample}.png
36
edf2d5882b77 Uploaded
davidvanzessen
parents: 35
diff changeset
121 mv $outputDir/circos/circos.svg $outputDir/circosVD_${sample}.svg
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
122
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
123 circos_file="$outputDir/${sample}_DJ_circos.txt"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
124 echo -e -n "labels$(cat ${circos_file})" > ${circos_file}
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
125 cat "${circos_file}" | $CIRCOSTOOLS/tableviewer/bin/parse-table -configfile $dir/circos/parse-table.conf 2>&1 | $CIRCOSTOOLS/tableviewer/bin/make-conf -dir $outputDir/circos/
44
1d8728f3ff37 Uploaded
davidvanzessen
parents: 40
diff changeset
126 sed -i -- 's%/%:%g' $outputDir/circos/cells.txt
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
127 $CIRCOSDIR/circos -conf $outputDir/circos/circos.conf 2>&1
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
128 mv $outputDir/circos/circos.png $outputDir/circosDJ_${sample}.png
36
edf2d5882b77 Uploaded
davidvanzessen
parents: 35
diff changeset
129 mv $outputDir/circos/circos.svg $outputDir/circosDJ_${sample}.svg
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
130 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
131 done
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
132 echo "</title><script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
133 echo "<link rel='stylesheet' type='text/css' href='pure-min.css'>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
134 echo "<script type='text/javascript' src='tabber.js'></script>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
135 echo "<script type='text/javascript' src='script.js'></script>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
136 echo "<link rel='stylesheet' type='text/css' href='style.css'></head>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
137 echo "<div class='tabber'><div class='tabbertab' title='Gene frequencies'>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
138
8
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
139
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
140 echo "<a href='VFPlot.pdf'><img src='VFPlot.png'/></a>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
141 if [[ "$useD" == "true" ]] ; then
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
142 echo "<a href='DFPlot.pdf'><img src='DFPlot.png'/></a>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
143 fi
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
144 echo "<a href='VPlot.pdf'><img src='VPlot.png'/></a>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
145 if [[ "$useD" == "true" ]] ; then
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
146 echo "<a href='DPlot.pdf'><img src='DPlot.png'/></a>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
147 fi
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
148 echo "<a href='JPlot.pdf'><img src='JPlot.png'/></a> <br />" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
149
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
150 echo "<a href='DReadingFrame.pdf'><img src='DReadingFrame.png'/></a>" >> $outputFile
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
151
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
152 cat $dir/naive_gene_freq.htm >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
153
8
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
154 echo "</div>" >> $outputFile
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
155
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
156 echo "<div class='tabbertab' title='CDR3 Characteristics'>" >> $outputFile
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
157 echo "<a href='CDR3LengthPlot.pdf'><img src='CDR3LengthPlot.png'/></a><br />" >> $outputFile
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
158 echo "<a href='AAComposition.pdf'><img src='AAComposition.png'/></a>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
159
8
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
160
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
161 echo "<table class='pure-table pure-table-striped'>" >> $outputFile
19
3ef457aa5df6 Uploaded
davidvanzessen
parents: 18
diff changeset
162 echo "<thead><tr><th>Donor</th><th>Median CDR3 Length</th></tr></thead>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
163 while read Sample median
8
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
164 do
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
165 echo "<tr><td>$Sample</td><td>$median</td></tr>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
166 done < $outputDir/AAMedianBySample.txt
8
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
167 echo "</table>" >> $outputFile
8cbc1a8d27ae Uploaded
davidvanzessen
parents: 5
diff changeset
168
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
169 cat $dir/naive_cdr3_char.htm >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
170
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
171 echo "</div>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
172
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
173 #Heatmaps
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
174
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
175 count=1
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
176 echo "<div class='tabbertab' title='Heatmaps'><div class='tabber'>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
177 for sample in $samples; do
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
178 echo "<div class='tabbertab' title='$sample'><table border='1'><tr>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
179 if [[ "$useD" == "true" ]] ; then
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
180 echo "<td><a href='HeatmapVD_$sample.pdf'><img src='HeatmapVD_$sample.png'/></a></td>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
181 fi
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
182 echo "<td><a href='HeatmapVJ_$sample.pdf'><img src='HeatmapVJ_$sample.png'/></a></td>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
183 if [[ "$useD" == "true" ]] ; then
32
7c33029fd63d Uploaded
davidvanzessen
parents: 27
diff changeset
184 echo "<td><a href='HeatmapDJ_$sample.pdf'><img src='HeatmapDJ_$sample.png'/></a></td>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
185 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
186 echo "</tr></table></div>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
187 count=$((count+1))
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
188 done
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
189
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
190 cat $dir/naive_heatmap.htm >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
191
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
192 echo "</div></div>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
193
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
194 echo "<div class='tabbertab' title='Compare Heatmaps'><table class='pure-table pure-table-striped'><thead><tr><th>ID</th><th>Include</th></tr></thead>" >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
195 for sample in $samples; do
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
196 echo "<tr><td>$sample</td><td><input type='checkbox' onchange=\"javascript:compareAdd('$sample')\" id='compare_checkbox_$sample'/></td></tr>" >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
197 done
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
198 echo "</table><div name='comparisonarea'>" >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
199 echo "<table><tr id='comparison_table_vd'></tr></table>" >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
200 echo "<table><tr id='comparison_table_vj'></tr></table>" >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
201 echo "<table><tr id='comparison_table_dj'></tr></table>" >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
202
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
203 cat $dir/naive_compare.htm >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
204
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
205 echo "</div></div>" >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
206
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
207
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
208 #circos
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
209
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
210 if [[ "$USECIRCOS" == "yes" ]]; then
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
211
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
212 echo "<div class='tabbertab' title='Circos'><div class='tabber'>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
213 for sample in $samples; do
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
214 echo "<div class='tabbertab' title='$sample'><table border='1'><center>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
215 if [[ "$useD" == "true" ]] ; then
35
dc6c53a11d7d Uploaded
davidvanzessen
parents: 33
diff changeset
216 echo "<tr><td>V-D</td><td><a href='circosVD_${sample}.svg'><img src='circosVD_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
217 fi
35
dc6c53a11d7d Uploaded
davidvanzessen
parents: 33
diff changeset
218 echo "<tr><td>V-J</td><td><a href='circosVJ_${sample}.svg'><img src='circosVJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
219 if [[ "$useD" == "true" ]] ; then
35
dc6c53a11d7d Uploaded
davidvanzessen
parents: 33
diff changeset
220 echo "<tr><td>D-J</td><td><a href='circosDJ_${sample}.svg'><img src='circosDJ_${sample}.png' width='700' height='700'/></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
221 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
222 echo "<center></table></div>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
223 count=$((count+1))
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
224 done
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
225
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
226 cat $dir/naive_circos.htm >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
227
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
228 echo "</div></div>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
229 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
230 #echo "<div class='tabbertab' title='Interactive'><svg class='chart'></svg><script src='http://d3js.org/d3.v3.min.js'></script></div>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
231
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
232 hasReplicateColumn="$(if head -n 1 $inputFile | grep -q 'Replicate'; then echo 'Yes'; else echo 'No'; fi)"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
233 echo "$hasReplicateColumn"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
234 #if its a 'new' merged file with replicate info
17
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
235 if [[ "$hasReplicateColumn" == "Yes" && "${clonality_method}" != "none" ]] ; then
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
236 if [[ "${clonality_method}" == "boyd" ]] ; then
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
237 echo "<div class='tabbertab' title='Clonality'><div class='tabber'>" >> $outputFile
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
238 else
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
239 echo "<div class='tabbertab' title='Shared Clonal Types'><div class='tabber'>" >> $outputFile
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
240 fi
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
241
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
242 for sample in $samples; do
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
243 echo "${clonality_method}"
26
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
244
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
245 echo "<div class='tabbertab' title='$sample'><table class='pure-table pure-table-striped'>" >> $outputFile
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
246
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
247 if [[ "${clonality_method}" == "boyd" ]] ; then
22
c28da767799f Uploaded
davidvanzessen
parents: 19
diff changeset
248 clonalityScore="$(cat $outputDir/lymphclon_clonality_${sample}.txt)"
26
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
249 echo "<tr><td>Clonality Score: </td><td>$clonalityScore</td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
250 fi
26
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
251
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
252 #replicate,reads,squared
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
253 echo "<tr><td>Replicate ID</td><td>Number of Sequences</td></tr>" >> $outputFile
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
254 while read replicate reads squared
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
255 do
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
256 echo "<tr><td>$replicate</td><td>$reads</td></tr>" >> $outputFile
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
257 done < $outputDir/ReplicateReads_$sample.txt
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
258
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
259 #sum of reads and reads squared
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
260 while read readsSum squaredSum
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
261 do
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
262 echo "<tr><td>Sum</td><td>$readsSum</td></tr>" >> $outputFile
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
263 done < $outputDir/ReplicateSumReads_$sample.txt
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
264
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
265 echo "<tr><td></td><td></td></tr>" >> $outputFile
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
266
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
267 #overview
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
268 echo "<tr><td>Number of replicates containing the coincidence</td><td>Number of sequences shared between replicates</td></tr>" >> $outputFile
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
269 while read type count weight weightedCount
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
270 do
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
271 if [[ "$type" -eq "1" ]]; then
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
272 echo "<tr><td>$type</td><td>$count</td></tr>" >> $outputFile
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
273 else
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
274 echo "<tr><td><a href='coincidences_${sample}_${type}.txt'>$type</a></td><td>$count</td></tr>" >> $outputFile
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
275 fi
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
276 done < $outputDir/ClonalityOverView_$sample.txt
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
277 echo "</table></div>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
278 done
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
279
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
280 cat $dir/naive_clonality.htm >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
281
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
282 echo "</div></div>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
283 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
284
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
285 #hasJunctionData="$(if head -n 1 $inputFile | grep -qE '3V.REGION.trimmed.nt.nb'; then echo 'Yes'; else echo 'No'; fi)"
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
286
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
287 #if [[ "$hasJunctionData" == "Yes" ]] ; then
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
288 if [ -a "$outputDir/junctionAnalysisProd_mean_wD.txt" ] ; then
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
289 echo "<div class='tabbertab' title='Junction Analysis'>" >> $outputFile
17
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
290 echo "<img src='IGH_junctie_analyse.png' />" >> $outputFile
da95be204ebc Uploaded
davidvanzessen
parents: 16
diff changeset
291
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
292 echo "<center><p style='font-size: 20;'>Unique rearrangements with a V, D and J gene assigned</p></center>" >> $outputFile
38
b6936fb52ab9 Uploaded
davidvanzessen
parents: 36
diff changeset
293 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive mean</caption><thead><tr><th>Donor</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
294 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
295 do
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
296 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELD</td><td>$DDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
297 done < $outputDir/junctionAnalysisProd_mean_wD.txt
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
298 echo "</tbody></table>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
299
38
b6936fb52ab9 Uploaded
davidvanzessen
parents: 36
diff changeset
300 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive mean</caption><thead><tr><th>Donor</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
301 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
302 do
26
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
303 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELD</td><td>$DDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>-</td></tr>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
304 done < $outputDir/junctionAnalysisUnProd_mean_wD.txt
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
305 echo "</tbody></table>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
306
38
b6936fb52ab9 Uploaded
davidvanzessen
parents: 36
diff changeset
307 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive median</caption><thead><tr><th>Donor</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
308 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
309 do
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
310 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELD</td><td>$DDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
311 done < $outputDir/junctionAnalysisProd_median_wD.txt
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
312 echo "</tbody></table>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
313
38
b6936fb52ab9 Uploaded
davidvanzessen
parents: 36
diff changeset
314 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive median</caption><thead><tr><th>Donor</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N1</th><th>P2</th><th>DEL.D</th><th>D.DEL</th><th>P3</th><th>N2</th><th>P4</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
315 while read Sample unique VDEL P1 N1 P2 DELD DDEL P3 N2 P4 DELJ TotalDel TotalN TotalP median
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
316 do
26
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
317 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELD</td><td>$DDEL</td><td>$P3</td><td>$N2</td><td>$P4</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>-</td></tr>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
318 done < $outputDir/junctionAnalysisUnProd_median_wD.txt
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
319 echo "</tbody></table>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
320
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
321 # again for no-d
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
322 echo "<center><p style='font-size: 20;'>Unique rearrangements with only a V and J gene assigned</p></center>" >> $outputFile
38
b6936fb52ab9 Uploaded
davidvanzessen
parents: 36
diff changeset
323 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive mean</caption><thead><tr><th>Donor</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N</th><th>P2</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
324 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
325 do
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
326 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
327 done < $outputDir/junctionAnalysisProd_mean_nD.txt
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
328 echo "</tbody></table>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
329
38
b6936fb52ab9 Uploaded
davidvanzessen
parents: 36
diff changeset
330 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive mean</caption><thead><tr><th>Donor</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N</th><th>P2</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
331 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
332 do
26
28fbbdfd7a87 Uploaded
davidvanzessen
parents: 25
diff changeset
333 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>-</td></tr>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
334 done < $outputDir/junctionAnalysisUnProd_mean_nD.txt
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
335 echo "</tbody></table>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
336
38
b6936fb52ab9 Uploaded
davidvanzessen
parents: 36
diff changeset
337 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Productive median</caption><thead><tr><th>Donor</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N</th><th>P2</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
338 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
339 do
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
340 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>$median</td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
341 done < $outputDir/junctionAnalysisProd_median_nD.txt
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
342 echo "</tbody></table>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
343
38
b6936fb52ab9 Uploaded
davidvanzessen
parents: 36
diff changeset
344 echo "<table class='pure-table pure-table-striped' id='junction_table'> <caption>Unproductive median</caption><thead><tr><th>Donor</th><th>Number of sequences</th><th>V.DEL</th><th>P1</th><th>N</th><th>P2</th><th>DEL.J</th><th>Total.Del</th><th>Total.N</th><th>Total.P</th><th>CDR3.Length</th><thead></tr><tbody>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
345 while read Sample unique VDEL P1 N1 P2 DELJ TotalDel TotalN TotalP median
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
346 do
27
b539aeb75980 Uploaded
davidvanzessen
parents: 26
diff changeset
347 echo "<tr><td>$Sample</td><td>$unique</td><td>$VDEL</td><td>$P1</td><td>$N1</td><td>$P2</td><td>$DELJ</td><td>$TotalDel</td><td>$TotalN</td><td>$TotalP</td><td>-</td></tr>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
348 done < $outputDir/junctionAnalysisUnProd_median_nD.txt
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
349 echo "</tbody></table>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
350
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
351 cat $dir/naive_junction.htm >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
352
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
353 echo "</div>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
354 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
355
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
356 echo "<div class='tabbertab' title='Downloads'>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
357 echo "<table class='pure-table pure-table-striped'>" >> $outputFile
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
358 echo "<thead><tr><th>Description</th><th>Link</th></tr></thead>" >> $outputFile
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
359 echo "<tr><td>The filtered dataset</td><td><a href='allUnique.txt'>Download</a></td></tr>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
360 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Gene frequencies</td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
361
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
362 echo "<tr><td>The dataset used to generate the distribution of V gene families graph</td><td><a href='VFFrequency.txt'>Download</a></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
363 if [[ "$useD" == "true" ]] ; then
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
364 echo "<tr><td>The dataset used to generate the distribution of D gene families graph</td><td><a href='DFFrequency.txt'>Download</a></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
365 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
366
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
367 echo "<tr><td>The dataset used to generate the relative frequency of V gene usage graph</td><td><a href='VFrequency.txt'>Download</a></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
368 if [[ "$useD" == "true" ]] ; then
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
369 echo "<tr><td>The dataset used to generate the relative frequency of D gene usage graph</td><td><a href='DFrequency.txt'>Download</a></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
370 fi
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
371 echo "<tr><td>The dataset used to generate the relative frequency of J gene usage graph</td><td><a href='JFrequency.txt'>Download</a></td></tr>" >> $outputFile
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
372 echo "<tr><td>The dataset used to generate the relative frequency of the D reading frame graph</td><td><a href='DReadingFrame.txt'>Download</a></td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
373
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
374 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>CDR3 Characteristics</td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
375 echo "<tr><td>The dataset used to generate the CDR3 length frequency graph</td><td><a href='CDR3LengthPlot.txt'>Download</a></td></tr>" >> $outputFile
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
376 echo "<tr><td>The dataset used to generate the Amino Acid Composition in the CDR3 graph</td><td><a href='AAComposition.txt'>Download</a></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
377
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
378 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Heatmaps</td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
379 for sample in $samples; do
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
380 if [[ "$useD" == "true" ]] ; then
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
381 echo "<tr><td>The data used to generate the VD heatmap for $sample.</td><td><a href='HeatmapVD_$sample.txt'>Download</a></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
382 fi
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
383 echo "<tr><td>The data used to generate the VJ heatmap for $sample.</td><td><a href='HeatmapVJ_$sample.txt'>Download</a></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
384 if [[ "$useD" == "true" ]] ; then
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
385 echo "<tr><td>The data used to generate the DJ heatmap for $sample.</td><td><a href='HeatmapDJ_$sample.txt'>Download</a></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
386 fi
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
387 done
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
388
24
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
389 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Circos</td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
390 for sample in $samples; do
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
391 if [[ "$useD" == "true" ]] ; then
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
392 echo "<tr><td>The data used to generate the VD Circos plots for $sample.</td><td><a href='${sample}_VD_circos.txt'>Download</a></td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
393 fi
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
394 echo "<tr><td>The data used to generate the VJ Circos plots for $sample.</td><td><a href='${sample}_VJ_circos.txt'>Download</a></td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
395 if [[ "$useD" == "true" ]] ; then
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
396 echo "<tr><td>The data used to generate the DJ Circos plots for $sample.</td><td><a href='${sample}_DJ_circos.txt'>Download</a></td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
397 fi
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
398 done
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
399
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
400 #echo "<tr><td>A frequency count of V Gene + J Gene + CDR3</td><td><a href='VJCDR3_count.txt'>Download</a></td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
401
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
402 echo "<tr><td colspan='2' style='background-color:#E0E0E0;'>Clonality</td></tr>" >> $outputFile
d5d203d38c8a Uploaded
davidvanzessen
parents: 23
diff changeset
403 echo "<tr><td>The dataset used to calculate clonality score (Unique based on clonaltype, $clonalType)</td><td><a href='clonalityComplete.txt'>Download</a></td></tr>" >> $outputFile
25
94765af0db1f Uploaded
davidvanzessen
parents: 24
diff changeset
404 echo "<tr><td>Sequences that are present in more than one replicate</td><td><a href='clonaltypes_replicates.txt'>Download</a></td></tr>" >> $outputFile
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
405
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
406 echo "</table>" >> $outputFile
18
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
407
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
408 cat $dir/naive_downloads.htm >> $outputFile
5d11c9139a55 Uploaded
davidvanzessen
parents: 17
diff changeset
409
5
bcec7bb4e089 Uploaded
davidvanzessen
parents:
diff changeset
410 echo "</div></html>" >> $outputFile