Mercurial > repos > davidvanzessen > clonal_sequences_in_paired_samples
comparison wrapper.sh @ 9:58a28427930e draft
Uploaded
author | davidvanzessen |
---|---|
date | Tue, 30 Sep 2014 10:06:57 -0400 |
parents | fa240d1c57a9 |
children | d980e2493657 |
comparison
equal
deleted
inserted
replaced
8:fa240d1c57a9 | 9:58a28427930e |
---|---|
27 pairs_R_Dx=() | 27 pairs_R_Dx=() |
28 while read patient sample1 sample2 type | 28 while read patient sample1 sample2 type |
29 do | 29 do |
30 echo "$patient" | 30 echo "$patient" |
31 html="${patient}.html" | 31 html="${patient}.html" |
32 echo "$header" > $html | 32 echo "$header" > "$html" |
33 if [[ "$type" == *pair* ]] ; then | 33 if [[ "$type" == *pair* ]] ; then |
34 if [[ "$sample1" == *_BM* ]] || [[ "$sample1" == *_PB* ]] ; then | 34 if [[ "$sample1" == *_BM* ]] || [[ "$sample1" == *_PB* ]] ; then |
35 pairs_BM_PB+=( "$patient" ) | 35 pairs_BM_PB+=( "$patient" ) |
36 elif [[ "$sample1" == *_Left* ]] || [[ "$sample1" == *_Right* ]] ; then | 36 elif [[ "$sample1" == *_Left* ]] || [[ "$sample1" == *_Right* ]] ; then |
37 pairs_Left_Right+=( "$patient" ) | 37 pairs_Left_Right+=( "$patient" ) |
43 fi | 43 fi |
44 oldLocus="" | 44 oldLocus="" |
45 sample1="$(echo ${sample1} | tr -d '\r' | tr -d '\n')" | 45 sample1="$(echo ${sample1} | tr -d '\r' | tr -d '\n')" |
46 sample2="$(echo ${sample2} | tr -d '\r' | tr -d '\n')" | 46 sample2="$(echo ${sample2} | tr -d '\r' | tr -d '\n')" |
47 tail -n+2 ${patient}_freq.txt | sed "s/>//" > tmp.txt | 47 tail -n+2 ${patient}_freq.txt | sed "s/>//" > tmp.txt |
48 echo "<div class='tabber'>" >> $html | 48 echo "<div class='tabber'>" >> "$html" |
49 echo "<div class='tabbertab' title='Data frequency'>" >> $html | 49 echo "<div class='tabbertab' title='Data frequency'>" >> "$html" |
50 echo "<table><tr><td style='vertical-align:top;'>" >> $html | 50 echo "<table><tr><td style='vertical-align:top;'>" >> "$html" |
51 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_freq'>" >> $html | 51 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_freq'>" >> "$html" |
52 echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_Both</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Sum number of sequences $patient</th><th>Percentage of sequences ${patient}_both</th></thead>" >> $html | 52 echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_Both</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Sum number of sequences $patient</th><th>Percentage of sequences ${patient}_both</th></thead>" >> "$html" |
53 echo "<tbody>" >> $html | 53 echo "<tbody>" >> "$html" |
54 while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2 | 54 while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2 |
55 do | 55 do |
56 if [ "$locus" != "$oldLocus" ] ; then | 56 if [ "$locus" != "$oldLocus" ] ; then |
57 echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> $html | 57 echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> "$html" |
58 echo "<tr><td><b>$locus</b></td>" >> $html | 58 echo "<tr><td><b>$locus</b></td>" >> "$html" |
59 else | 59 else |
60 echo "<td></td>" >> $html | 60 echo "<td></td>" >> "$html" |
61 fi | 61 fi |
62 echo "<td>$v_segment</td>" >> $html | 62 echo "<td>$v_segment</td>" >> "$html" |
63 echo "<td>$j_segment</td>" >> $html | 63 echo "<td>$j_segment</td>" >> "$html" |
64 echo "<td>>$cut_off_value</td>" >> $html | 64 echo "<td>>$cut_off_value</td>" >> "$html" |
65 if [ "$both" != "0" ] ; then | 65 if [ "$both" != "0" ] ; then |
66 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$both</td>" >> $html | 66 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$both</td>" >> "$html" |
67 else | 67 else |
68 echo "<td>$both</td>" >> $html | 68 echo "<td>$both</td>" >> "$html" |
69 fi | 69 fi |
70 if [ "$one" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 70 if [ "$one" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
71 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$one</td>" >> $html | 71 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$one</td>" >> "$html" |
72 else | 72 else |
73 echo "<td>$one</td>" >> $html | 73 echo "<td>$one</td>" >> "$html" |
74 fi | 74 fi |
75 echo "<td>$read_count1</td>" >> $html | 75 echo "<td>$read_count1</td>" >> "$html" |
76 if [ "$two" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 76 if [ "$two" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
77 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$two</td>" >> $html | 77 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$two</td>" >> "$html" |
78 else | 78 else |
79 echo "<td>$two</td>" >> $html | 79 echo "<td>$two</td>" >> "$html" |
80 fi | 80 fi |
81 echo "<td>$read_count2</td>" >> $html | 81 echo "<td>$read_count2</td>" >> "$html" |
82 echo "<td>$sum</td>" >> $html | 82 echo "<td>$sum</td>" >> "$html" |
83 echo "<td>${percent}%</td>" >> $html | 83 echo "<td>${percent}%</td>" >> "$html" |
84 echo "</tr>" >> $html | 84 echo "</tr>" >> "$html" |
85 oldLocus="$locus" | 85 oldLocus="$locus" |
86 done < tmp.txt | 86 done < tmp.txt |
87 echo "</tbody></table>" >> $html | 87 echo "</tbody></table>" >> "$html" |
88 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_freq'></div></td></tr></table>" >> $html | 88 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_freq'></div></td></tr></table>" >> "$html" |
89 echo "</div>" >> $html | 89 echo "</div>" >> "$html" |
90 echo "<div class='tabbertab' title='Graphs frequency'>" >> $html | 90 echo "<div class='tabbertab' title='Graphs frequency'>" >> "$html" |
91 echo "<a href='${patient}_freq.png'><img src='${patient}_freq.png' width='1280' height='720' /></a><br />" >> $html | 91 echo "<a href='${patient}_freq.png'><img src='${patient}_freq.png' width='1280' height='720' /></a><br />" >> "$html" |
92 echo "<a href='${patient}_freq_both.png'><img src='${patient}_freq_both.png' width='1280' height='720' /></a><br />" >> $html | 92 echo "<a href='${patient}_freq_both.png'><img src='${patient}_freq_both.png' width='1280' height='720' /></a><br />" >> "$html" |
93 echo "<a href='${patient}_percent_freq.png'><img src='${patient}_percent_freq.png' width='1280' height='720' /></a></div>" >> $html | 93 echo "<a href='${patient}_percent_freq.png'><img src='${patient}_percent_freq.png' width='1280' height='720' /></a></div>" >> "$html" |
94 | 94 |
95 tail -n+2 ${patient}_reads.txt | sed "s/>//" > tmp.txt | 95 tail -n+2 ${patient}_reads.txt | sed "s/>//" > tmp.txt |
96 echo "<div class='tabbertab' title='Data reads'>" >> $html | 96 echo "<div class='tabbertab' title='Data reads'>" >> "$html" |
97 echo "<table><tr><td style='vertical-align:top;'>" >> $html | 97 echo "<table><tr><td style='vertical-align:top;'>" >> "$html" |
98 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_reads'>" >> $html | 98 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_reads'>" >> "$html" |
99 echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_Both</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Sum number of sequences $patient</th><th>Percentage of sequences ${patient}_both</th></thead>" >> $html | 99 echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_Both</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Sum number of sequences $patient</th><th>Percentage of sequences ${patient}_both</th></thead>" >> "$html" |
100 echo "<tbody>" >> $html | 100 echo "<tbody>" >> "$html" |
101 while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2 | 101 while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2 |
102 do | 102 do |
103 if [ "$locus" != "$oldLocus" ] ; then | 103 if [ "$locus" != "$oldLocus" ] ; then |
104 echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> $html | 104 echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> "$html" |
105 echo "<tr><td><b>$locus</b></td>" >> $html | 105 echo "<tr><td><b>$locus</b></td>" >> "$html" |
106 else | 106 else |
107 echo "<td></td>" >> $html | 107 echo "<td></td>" >> "$html" |
108 fi | 108 fi |
109 echo "<td>$v_segment</td>" >> $html | 109 echo "<td>$v_segment</td>" >> "$html" |
110 echo "<td>$j_segment</td>" >> $html | 110 echo "<td>$j_segment</td>" >> "$html" |
111 echo "<td>>$cut_off_value</td>" >> $html | 111 echo "<td>>$cut_off_value</td>" >> "$html" |
112 if [ "$both" != "0" ] ; then | 112 if [ "$both" != "0" ] ; then |
113 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$both</td>" >> $html | 113 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$both</td>" >> "$html" |
114 else | 114 else |
115 echo "<td>$both</td>" >> $html | 115 echo "<td>$both</td>" >> "$html" |
116 fi | 116 fi |
117 if [ "$one" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 117 if [ "$one" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
118 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$one</td>" >> $html | 118 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$one</td>" >> "$html" |
119 else | 119 else |
120 echo "<td>$one</td>" >> $html | 120 echo "<td>$one</td>" >> "$html" |
121 fi | 121 fi |
122 echo "<td>$read_count1</td>" >> $html | 122 echo "<td>$read_count1</td>" >> "$html" |
123 if [ "$two" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 123 if [ "$two" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
124 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$two</td>" >> $html | 124 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$two</td>" >> "$html" |
125 else | 125 else |
126 echo "<td>$two</td>" >> $html | 126 echo "<td>$two</td>" >> "$html" |
127 fi | 127 fi |
128 echo "<td>$read_count2</td>" >> $html | 128 echo "<td>$read_count2</td>" >> "$html" |
129 echo "<td>$sum</td>" >> $html | 129 echo "<td>$sum</td>" >> "$html" |
130 echo "<td>${percent}%</td>" >> $html | 130 echo "<td>${percent}%</td>" >> "$html" |
131 echo "</tr>" >> $html | 131 echo "</tr>" >> "$html" |
132 oldLocus="$locus" | 132 oldLocus="$locus" |
133 done < tmp.txt | 133 done < tmp.txt |
134 echo "</tbody></table>" >> $html | 134 echo "</tbody></table>" >> "$html" |
135 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_reads'></div></td></tr></table>" >> $html | 135 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_reads'></div></td></tr></table>" >> "$html" |
136 echo "</div>" >> $html | 136 echo "</div>" >> "$html" |
137 echo "<div class='tabbertab' title='Graphs reads'>" >> $html | 137 echo "<div class='tabbertab' title='Graphs reads'>" >> "$html" |
138 echo "<a href='${patient}_reads.png'><img src='${patient}_reads.png' width='1280' height='720' /></a><br />" >> $html | 138 echo "<a href='${patient}_reads.png'><img src='${patient}_reads.png' width='1280' height='720' /></a><br />" >> "$html" |
139 echo "<a href='${patient}_reads_both.png'><img src='${patient}_reads_both.png' width='1280' height='720' /></a><br />" >> $html | 139 echo "<a href='${patient}_reads_both.png'><img src='${patient}_reads_both.png' width='1280' height='720' /></a><br />" >> "$html" |
140 echo "<a href='${patient}_percent_reads.png'><img src='${patient}_percent_reads.png' width='1280' height='720' /></a></div>" >> $html | 140 echo "<a href='${patient}_percent_reads.png'><img src='${patient}_percent_reads.png' width='1280' height='720' /></a></div>" >> "$html" |
141 echo "</div>" >> $html | 141 echo "</div>" >> "$html" |
142 echo "</div>" >> $html | 142 echo "</div>" >> "$html" |
143 echo "</html>" >> $html | 143 echo "</html>" >> "$html" |
144 done < patients.txt | 144 done < patients.txt |
145 | 145 |
146 html="index.html" | 146 html="index.html" |
147 echo "<html>" > $html | 147 echo "<html>" > $html |
148 echo "<table>" >> $html | 148 echo "<table>" >> "$html" |
149 echo "<tr><td><b>Singles:</b></td></tr>" >> $html | 149 echo "<tr><td><b>Singles:</b></td></tr>" >> "$html" |
150 for patient in "${singles[@]}" | 150 for patient in "${singles[@]}" |
151 do | 151 do |
152 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> $html | 152 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> "$html" |
153 done | 153 done |
154 echo "<tr><td><b>Pairs (Left & Right):</b></td></tr>" >> $html | 154 echo "<tr><td><b>Pairs (Left & Right):</b></td></tr>" >> "$html" |
155 for patient in "${pairs_Left_Right[@]}" | 155 for patient in "${pairs_Left_Right[@]}" |
156 do | 156 do |
157 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> $html | 157 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> "$html" |
158 done | 158 done |
159 echo "<tr><td><b>Pairs (BM & PB):</b></td></tr>" >> $html | 159 echo "<tr><td><b>Pairs (BM & PB):</b></td></tr>" >> "$html" |
160 for patient in "${pairs_BM_PB[@]}" | 160 for patient in "${pairs_BM_PB[@]}" |
161 do | 161 do |
162 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> $html | 162 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> "$html" |
163 done | 163 done |
164 echo "<tr><td><b>Pairs (Dx & R):</b></td></tr>" >> $html | 164 echo "<tr><td><b>Pairs (Dx & R):</b></td></tr>" >> "$html" |
165 for patient in "${pairs_R_Dx[@]}" | 165 for patient in "${pairs_R_Dx[@]}" |
166 do | 166 do |
167 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> $html | 167 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> "$html" |
168 done | 168 done |
169 echo "<tr><td><b>Triplets:</b></td></tr>" >> $html | 169 echo "<tr><td><b>Triplets:</b></td></tr>" >> "$html" |
170 | 170 |
171 while read sample1 sample2 sample3 | 171 while read sample1 sample2 sample3 |
172 do | 172 do |
173 sample1="$(echo ${sample1} | tr -d '\r' | tr -d '\n')" | 173 sample1="$(echo ${sample1} | tr -d '\r' | tr -d '\n')" |
174 sample2="$(echo ${sample2} | tr -d '\r' | tr -d '\n')" | 174 sample2="$(echo ${sample2} | tr -d '\r' | tr -d '\n')" |
178 html="${patient}.html" | 178 html="${patient}.html" |
179 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> "index.html" | 179 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> "index.html" |
180 echo "$header" > $html | 180 echo "$header" > $html |
181 oldLocus="" | 181 oldLocus="" |
182 tail -n+2 ${patient}_freq.txt | sed "s/>//" > tmp.txt | 182 tail -n+2 ${patient}_freq.txt | sed "s/>//" > tmp.txt |
183 echo "<div class='tabber'>" >> $html | 183 echo "<div class='tabber'>" >> "$html" |
184 echo "<div class='tabbertab' title='Data frequency'>" >> $html | 184 echo "<div class='tabbertab' title='Data frequency'>" >> "$html" |
185 echo "<table><tr><td style='vertical-align:top;'>" >> $html | 185 echo "<table><tr><td style='vertical-align:top;'>" >> "$html" |
186 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_freq'>" >> $html | 186 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_freq'>" >> "$html" |
187 echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_All</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Number of sequences_$sample3</th><th>Read Count $sample3</th></thead>" >> $html | 187 echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_All</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Number of sequences_$sample3</th><th>Read Count $sample3</th></thead>" >> "$html" |
188 echo "<tbody>" >> $html | 188 echo "<tbody>" >> "$html" |
189 while read locus j_segment v_segment cut_off_value all one read_count1 two read_count2 three read_count3 | 189 while read locus j_segment v_segment cut_off_value all one read_count1 two read_count2 three read_count3 |
190 do | 190 do |
191 if [ "$locus" != "$oldLocus" ] ; then | 191 if [ "$locus" != "$oldLocus" ] ; then |
192 echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> $html | 192 echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> "$html" |
193 echo "<tr><td><b>$locus</b></td>" >> $html | 193 echo "<tr><td><b>$locus</b></td>" >> "$html" |
194 else | 194 else |
195 echo "<td></td>" >> $html | 195 echo "<td></td>" >> "$html" |
196 fi | 196 fi |
197 echo "<td>$v_segment</td>" >> $html | 197 echo "<td>$v_segment</td>" >> "$html" |
198 echo "<td>$j_segment</td>" >> $html | 198 echo "<td>$j_segment</td>" >> "$html" |
199 echo "<td>>$cut_off_value</td>" >> $html | 199 echo "<td>>$cut_off_value</td>" >> "$html" |
200 if [ "$all" != "0" ] ; then | 200 if [ "$all" != "0" ] ; then |
201 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${sample2}_${sample3}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$all</td>" >> $html | 201 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${sample2}_${sample3}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$all</td>" >> "$html" |
202 else | 202 else |
203 echo "<td>$all</td>" >> $html | 203 echo "<td>$all</td>" >> "$html" |
204 fi | 204 fi |
205 if [ "$one" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 205 if [ "$one" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
206 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$one</td>" >> $html | 206 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$one</td>" >> "$html" |
207 else | 207 else |
208 echo "<td>$one</td>" >> $html | 208 echo "<td>$one</td>" >> "$html" |
209 fi | 209 fi |
210 echo "<td>$read_count1</td>" >> $html | 210 echo "<td>$read_count1</td>" >> "$html" |
211 if [ "$two" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 211 if [ "$two" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
212 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$two</td>" >> $html | 212 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$two</td>" >> "$html" |
213 else | 213 else |
214 echo "<td>$two</td>" >> $html | 214 echo "<td>$two</td>" >> "$html" |
215 fi | 215 fi |
216 echo "<td>$read_count2</td>" >> $html | 216 echo "<td>$read_count2</td>" >> "$html" |
217 if [ "$three" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 217 if [ "$three" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
218 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample3}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$three</td>" >> $html | 218 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample3}_${locus}_${cut_off_value}.txt\", \"$patient\", \"freq\")'>$three</td>" >> "$html" |
219 else | 219 else |
220 echo "<td>$three</td>" >> $html | 220 echo "<td>$three</td>" >> "$html" |
221 fi | 221 fi |
222 echo "<td>$read_count3</td>" >> $html | 222 echo "<td>$read_count3</td>" >> "$html" |
223 echo "</tr>" >> $html | 223 echo "</tr>" >> "$html" |
224 oldLocus="$locus" | 224 oldLocus="$locus" |
225 done < tmp.txt | 225 done < tmp.txt |
226 echo "</tbody></table>" >> $html | 226 echo "</tbody></table>" >> "$html" |
227 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_freq'></div></td></tr></table>" >> $html | 227 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_freq'></div></td></tr></table>" >> "$html" |
228 echo "</div>" >> $html | 228 echo "</div>" >> "$html" |
229 echo "<div class='tabbertab' title='Graphs frequency'>" >> $html | 229 echo "<div class='tabbertab' title='Graphs frequency'>" >> "$html" |
230 echo "<a href='${patient}_freq_total_all.png'><img src='${patient}_freq_total_all.png' width='1280' height='720' /></a><br />" >> $html | 230 echo "<a href='${patient}_freq_total_all.png'><img src='${patient}_freq_total_all.png' width='1280' height='720' /></a><br />" >> "$html" |
231 echo "<a href='${patient}_freq_indiv_all.png'><img src='${patient}_freq_indiv_all.png' width='1280' height='720' /></a><br /></div>" >> $html | 231 echo "<a href='${patient}_freq_indiv_all.png'><img src='${patient}_freq_indiv_all.png' width='1280' height='720' /></a><br /></div>" >> "$html" |
232 | 232 |
233 tail -n+2 ${patient}_reads.txt | sed "s/>//" > tmp.txt | 233 tail -n+2 ${patient}_reads.txt | sed "s/>//" > tmp.txt |
234 echo "<div class='tabbertab' title='Data reads'>" >> $html | 234 echo "<div class='tabbertab' title='Data reads'>" >> "$html" |
235 echo "<table><tr><td style='vertical-align:top;'>" >> $html | 235 echo "<table><tr><td style='vertical-align:top;'>" >> "$html" |
236 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_reads'>" >> $html | 236 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_reads'>" >> "$html" |
237 echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_All</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Number of sequences_$sample3</th><th>Read Count $sample3</th></thead>" >> $html | 237 echo "<thead><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Cut off value</th><th>Number of sequences ${patient}_All</th><th>Number of sequences_$sample1</th><th>Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Read Count $sample2</th><th>Number of sequences_$sample3</th><th>Read Count $sample3</th></thead>" >> "$html" |
238 echo "<tbody>" >> $html | 238 echo "<tbody>" >> "$html" |
239 while read locus j_segment v_segment cut_off_value all one read_count1 two read_count2 three read_count3 | 239 while read locus j_segment v_segment cut_off_value all one read_count1 two read_count2 three read_count3 |
240 do | 240 do |
241 if [ "$locus" != "$oldLocus" ] ; then | 241 if [ "$locus" != "$oldLocus" ] ; then |
242 echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> $html | 242 echo "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> "$html" |
243 echo "<tr><td><b>$locus</b></td>" >> $html | 243 echo "<tr><td><b>$locus</b></td>" >> "$html" |
244 else | 244 else |
245 echo "<td></td>" >> $html | 245 echo "<td></td>" >> "$html" |
246 fi | 246 fi |
247 echo "<td>$v_segment</td>" >> $html | 247 echo "<td>$v_segment</td>" >> "$html" |
248 echo "<td>$j_segment</td>" >> $html | 248 echo "<td>$j_segment</td>" >> "$html" |
249 echo "<td>>$cut_off_value</td>" >> $html | 249 echo "<td>>$cut_off_value</td>" >> "$html" |
250 if [ "$all" != "0" ] ; then | 250 if [ "$all" != "0" ] ; then |
251 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${sample2}_${sample3}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$all</td>" >> $html | 251 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${sample2}_${sample3}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$all</td>" >> "$html" |
252 else | 252 else |
253 echo "<td>$all</td>" >> $html | 253 echo "<td>$all</td>" >> "$html" |
254 fi | 254 fi |
255 if [ "$one" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 255 if [ "$one" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
256 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$one</td>" >> $html | 256 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample1}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$one</td>" >> "$html" |
257 else | 257 else |
258 echo "<td>$one</td>" >> $html | 258 echo "<td>$one</td>" >> "$html" |
259 fi | 259 fi |
260 echo "<td>$read_count1</td>" >> $html | 260 echo "<td>$read_count1</td>" >> "$html" |
261 if [ "$two" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 261 if [ "$two" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
262 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$two</td>" >> $html | 262 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample2}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$two</td>" >> "$html" |
263 else | 263 else |
264 echo "<td>$two</td>" >> $html | 264 echo "<td>$two</td>" >> "$html" |
265 fi | 265 fi |
266 echo "<td>$read_count2</td>" >> $html | 266 echo "<td>$read_count2</td>" >> "$html" |
267 if [ "$three" != "0" ] && [ "$cut_off_value" != "0" ] ; then | 267 if [ "$three" != "0" ] && [ "$cut_off_value" != "0" ] ; then |
268 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample3}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$three</td>" >> $html | 268 echo "<td data-patient='${patient}' style='cursor:pointer' onclick='javascript:loadfile(\"${sample3}_${locus}_${cut_off_value}.txt\", \"$patient\", \"reads\")'>$three</td>" >> "$html" |
269 else | 269 else |
270 echo "<td>$three</td>" >> $html | 270 echo "<td>$three</td>" >> "$html" |
271 fi | 271 fi |
272 echo "<td>$read_count3</td>" >> $html | 272 echo "<td>$read_count3</td>" >> "$html" |
273 echo "</tr>" >> $html | 273 echo "</tr>" >> "$html" |
274 oldLocus="$locus" | 274 oldLocus="$locus" |
275 done < tmp.txt | 275 done < tmp.txt |
276 echo "</tbody></table>" >> $html | 276 echo "</tbody></table>" >> "$html" |
277 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_reads'></div></td></tr></table>" >> $html | 277 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_reads'></div></td></tr></table>" >> "$html" |
278 echo "</div>" >> $html | 278 echo "</div>" >> "$html" |
279 echo "<div class='tabbertab' title='Graphs reads'>" >> $html | 279 echo "<div class='tabbertab' title='Graphs reads'>" >> "$html" |
280 echo "<a href='${patient}_reads_total_all.png'><img src='${patient}_reads_total_all.png' width='1280' height='720' /></a><br />" >> $html | 280 echo "<a href='${patient}_reads_total_all.png'><img src='${patient}_reads_total_all.png' width='1280' height='720' /></a><br />" >> "$html" |
281 echo "<a href='${patient}_reads_indiv_all.png'><img src='${patient}_reads_indiv_all.png' width='1280' height='720' /></a><br /></div>" >> $html | 281 echo "<a href='${patient}_reads_indiv_all.png'><img src='${patient}_reads_indiv_all.png' width='1280' height='720' /></a><br /></div>" >> "$html" |
282 echo "</div>" >> $html | 282 echo "</div>" >> "$html" |
283 echo "</div>" >> $html | 283 echo "</div>" >> "$html" |
284 echo "</html>" >> $html | 284 echo "</html>" >> "$html" |
285 done < triplets.txt | 285 done < triplets.txt |
286 rm tmp.txt | 286 rm tmp.txt |
287 | 287 |
288 | 288 |
289 html="index.html" | 289 html="index.html" |
290 | 290 |
291 echo "</table>" >> $html | 291 echo "</table>" >> "$html" |
292 echo "</html>" >> $html | 292 echo "</html>" >> "$html" |
293 | 293 |