Mercurial > repos > davidvanzessen > clonal_sequences_in_paired_samples
comparison wrapper.sh @ 7:68c6c7624ffc draft
Uploaded
author | davidvanzessen |
---|---|
date | Thu, 18 Sep 2014 08:56:44 -0400 |
parents | f11df36f43bb |
children | fa240d1c57a9 |
comparison
equal
deleted
inserted
replaced
6:8313c6cc65c5 | 7:68c6c7624ffc |
---|---|
7 min_cells=$5 | 7 min_cells=$5 |
8 | 8 |
9 dir="$(cd "$(dirname "$0")" && pwd)" | 9 dir="$(cd "$(dirname "$0")" && pwd)" |
10 mkdir $outputDir | 10 mkdir $outputDir |
11 | 11 |
12 echo "testtestsetset" > $outputFile | |
13 | 12 |
14 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputFile $min_freq $min_cells 2>&1 | 13 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputFile $min_freq $min_cells 2>&1 |
15 cp $dir/jquery-1.11.0.min.js $outputDir | 14 cp $dir/jquery-1.11.0.min.js $outputDir |
16 cp $dir/script.js $outputDir | 15 cp $dir/script.js $outputDir |
17 cp $dir/style.css $outputDir | 16 cp $dir/style.css $outputDir |
141 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 |
142 echo "</div>" >> $html | 141 echo "</div>" >> $html |
143 echo "</div>" >> $html | 142 echo "</div>" >> $html |
144 echo "</html>" >> $html | 143 echo "</html>" >> $html |
145 done < patients.txt | 144 done < patients.txt |
146 rm tmp.txt | |
147 | 145 |
148 html="index.html" | 146 html="index.html" |
149 echo "<html>" > $html | 147 echo "<html>" > $html |
150 echo "<table>" >> $html | 148 echo "<table>" >> $html |
151 echo "<tr><td><b>Singles:</b></td></tr>" >> $html | 149 echo "<tr><td><b>Singles:</b></td></tr>" >> $html |
168 do | 166 do |
169 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 |
170 done | 168 done |
171 echo "<tr><td><b>Triplets:</b></td></tr>" >> $html | 169 echo "<tr><td><b>Triplets:</b></td></tr>" >> $html |
172 | 170 |
171 while read sample1 sample2 sample3 | |
172 do | |
173 sample1="$(echo ${sample1} | tr -d '\r' | tr -d '\n')" | |
174 sample2="$(echo ${sample2} | tr -d '\r' | tr -d '\n')" | |
175 sample3="$(echo ${sample3} | tr -d '\r' | tr -d '\n')" | |
176 patient="${sample1}_${sample2}_${sample3}" | |
177 echo "$patient" | |
178 html="${patient}.html" | |
179 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> "index.html" | |
180 echo "$header" > $html | |
181 oldLocus="" | |
182 tail -n+2 ${patient}_freq.txt | sed "s/>//" > tmp.txt | |
183 echo "<div class='tabber'>" >> $html | |
184 echo "<div class='tabbertab' title='Data frequency'>" >> $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 | |
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 | |
189 while read locus j_segment v_segment cut_off_value all one read_count1 two read_count2 three read_count3 | |
190 do | |
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 | |
193 echo "<tr><td><b>$locus</b></td>" >> $html | |
194 else | |
195 echo "<td></td>" >> $html | |
196 fi | |
197 echo "<td>$v_segment</td>" >> $html | |
198 echo "<td>$j_segment</td>" >> $html | |
199 echo "<td>>$cut_off_value</td>" >> $html | |
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 | |
202 else | |
203 echo "<td>$all</td>" >> $html | |
204 fi | |
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 | |
207 else | |
208 echo "<td>$one</td>" >> $html | |
209 fi | |
210 echo "<td>$read_count1</td>" >> $html | |
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 | |
213 else | |
214 echo "<td>$two</td>" >> $html | |
215 fi | |
216 echo "<td>$read_count2</td>" >> $html | |
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 | |
219 else | |
220 echo "<td>$three</td>" >> $html | |
221 fi | |
222 echo "<td>$read_count3</td>" >> $html | |
223 echo "</tr>" >> $html | |
224 oldLocus="$locus" | |
225 done < tmp.txt | |
226 echo "</tbody></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 | |
229 echo "<div class='tabbertab' title='Graphs frequency'>" >> $html | |
230 echo "<a href='${patient}_reads_total_all.png'><img src='${patient}_reads.png' width='1280' height='720' /></a><br />" >> $html | |
231 echo "<a href='${patient}_reads_indiv_all.png'><img src='${patient}_reads_all.png' width='1280' height='720' /></a><br />" >> $html | |
232 | |
233 tail -n+2 ${patient}_reads.txt | sed "s/>//" > tmp.txt | |
234 echo "<div class='tabbertab' title='Data reads'>" >> $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 | |
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 | |
239 while read locus j_segment v_segment cut_off_value all one read_count1 two read_count2 three read_count3 | |
240 do | |
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 | |
243 echo "<tr><td><b>$locus</b></td>" >> $html | |
244 else | |
245 echo "<td></td>" >> $html | |
246 fi | |
247 echo "<td>$v_segment</td>" >> $html | |
248 echo "<td>$j_segment</td>" >> $html | |
249 echo "<td>>$cut_off_value</td>" >> $html | |
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 | |
252 else | |
253 echo "<td>$all</td>" >> $html | |
254 fi | |
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 | |
257 else | |
258 echo "<td>$one</td>" >> $html | |
259 fi | |
260 echo "<td>$read_count1</td>" >> $html | |
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 | |
263 else | |
264 echo "<td>$two</td>" >> $html | |
265 fi | |
266 echo "<td>$read_count2</td>" >> $html | |
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 | |
269 else | |
270 echo "<td>$three</td>" >> $html | |
271 fi | |
272 echo "<td>$read_count3</td>" >> $html | |
273 echo "</tr>" >> $html | |
274 oldLocus="$locus" | |
275 done < tmp.txt | |
276 echo "</tbody></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 | |
279 echo "<div class='tabbertab' title='Graphs reads'>" >> $html | |
280 echo "<a href='${patient}_reads_total_all.png'><img src='${patient}_reads.png' width='1280' height='720' /></a><br />" >> $html | |
281 echo "<a href='${patient}_reads_indiv_all.png'><img src='${patient}_reads_all.png' width='1280' height='720' /></a><br />" >> $html | |
282 echo "</div>" >> $html | |
283 echo "</div>" >> $html | |
284 echo "</html>" >> $html | |
285 done < triplets.txt | |
286 rm tmp.txt | |
287 | |
288 | |
289 html="index.html" | |
290 | |
173 echo "</table>" >> $html | 291 echo "</table>" >> $html |
174 echo "</html>" >> $html | 292 echo "</html>" >> $html |
175 | 293 |