comparison wrapper.sh @ 4:f11df36f43bb draft

Uploaded
author davidvanzessen
date Mon, 15 Sep 2014 05:37:16 -0400
parents f9316f7676cc
children 68c6c7624ffc
comparison
equal deleted inserted replaced
3:f9316f7676cc 4:f11df36f43bb
19 19
20 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)</center></html>" > $outputFile 20 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)</center></html>" > $outputFile
21 21
22 cd $outputDir 22 cd $outputDir
23 23
24 html="index.html" 24 header="<html><head><script type='text/javascript' src='jquery-1.11.0.min.js'></script><script type='text/javascript' src='tabber.js'></script><script type='text/javascript' src='script.js'></script><link rel='stylesheet' type='text/css' href='style.css'></head><div id='hidden_div' style='display: none;'></div>"
25 echo "<html><head><title>Result</title>" > $html 25 singles=()
26 echo "<script type='text/javascript' src='jquery-1.11.0.min.js'></script>" >> $html 26 pairs_BM_PB=()
27 echo "<script type='text/javascript' src='tabber.js'></script>" >> $html 27 pairs_Left_Right=()
28 echo "<script type='text/javascript' src='script.js'></script>" >> $html 28 pairs_R_Dx=()
29 echo "<script type='text/javascript' src='jquery.tablesorter.min.js'></script>" >> $html 29 while read patient sample1 sample2 type
30 echo "<link rel='stylesheet' type='text/css' href='style.css'></head>" >> $html
31 echo "<div id='hidden_div' style='display: none;'></div>" >> $html
32 echo "<div class='tabber'>" >> $html
33 while read patient sample1 sample2
34 do 30 do
35 echo "$patient" 31 echo "$patient"
32 html="${patient}.html"
33 echo "$header" > $html
34 if [[ "$type" == *pair* ]] ; then
35 if [[ "$sample1" == *_BM* ]] || [[ "$sample1" == *_PB* ]] ; then
36 pairs_BM_PB+=( "$patient" )
37 elif [[ "$sample1" == *_Left* ]] || [[ "$sample1" == *_Right* ]] ; then
38 pairs_Left_Right+=( "$patient" )
39 else
40 pairs_R_Dx+=( "$patient" )
41 fi
42 else
43 singles+=( "$patient" )
44 fi
36 oldLocus="" 45 oldLocus=""
37 sample1="$(echo ${sample1} | tr -d '\r' | tr -d '\n')" 46 sample1="$(echo ${sample1} | tr -d '\r' | tr -d '\n')"
38 sample2="$(echo ${sample2} | tr -d '\r' | tr -d '\n')" 47 sample2="$(echo ${sample2} | tr -d '\r' | tr -d '\n')"
39 tail -n+2 ${patient}_freq.txt | sed "s/>//" > tmp.txt 48 tail -n+2 ${patient}_freq.txt | sed "s/>//" > tmp.txt
40 echo "<div class='tabbertab' title='$patient'>" >> $html
41 echo "<div class='tabber'>" >> $html 49 echo "<div class='tabber'>" >> $html
42 echo "<div class='tabbertab' title='Data frequency'>" >> $html 50 echo "<div class='tabbertab' title='Data frequency'>" >> $html
43 echo "<table><tr><td style='vertical-align:top;'>" >> $html 51 echo "<table><tr><td style='vertical-align:top;'>" >> $html
44 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_freq'>" >> $html 52 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_freq'>" >> $html
45 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>Normalized Read Count $sample1</th><th>Number of sequences_$sample2</th><th>Normalized Read Count $sample2</th><th>Sum number of sequences $patient</th><th>Percentage of sequences ${patient}_both</th></thead>" >> $html 53 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
46 echo "<tbody>" >> $html 54 echo "<tbody>" >> $html
47 readsumtable="<table class='result_table summary_table'><thead><tr><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Total normalized read count for $sample1</th><th>Total normalized read count for $sample2</th></tr></thead>"
48 while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2 55 while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2
49 do 56 do
50 if [ "$locus" != "$oldLocus" ] ; then 57 if [ "$locus" != "$oldLocus" ] ; then
51 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></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> $html
52 echo "<tr><td><b>$locus</b></td>" >> $html 59 echo "<tr><td><b>$locus</b></td>" >> $html
53 readsumtable="${readsumtable}<tr><td>$locus</td><td>$v_segment</td><td>$j_segment</td><td>$locusreadsum1</td><td>$locusreadsum2</td></tr>"
54 else 60 else
55 echo "<td></td>" >> $html 61 echo "<td></td>" >> $html
56 fi 62 fi
57 echo "<td>$v_segment</td>" >> $html 63 echo "<td>$v_segment</td>" >> $html
58 echo "<td>$j_segment</td>" >> $html 64 echo "<td>$j_segment</td>" >> $html
79 echo "</tr>" >> $html 85 echo "</tr>" >> $html
80 oldLocus="$locus" 86 oldLocus="$locus"
81 done < tmp.txt 87 done < tmp.txt
82 echo "</tbody></table>" >> $html 88 echo "</tbody></table>" >> $html
83 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_freq'></div></td></tr></table>" >> $html 89 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_freq'></div></td></tr></table>" >> $html
84 echo "${readsumtable}</table></div>" >> $html 90 echo "</div>" >> $html
85 echo "<div class='tabbertab' title='Graphs frequency'>" >> $html 91 echo "<div class='tabbertab' title='Graphs frequency'>" >> $html
86 echo "<a href='${patient}_freq.png'><img src='${patient}_freq.png' width='1280' height='720' /></a><br />" >> $html 92 echo "<a href='${patient}_freq.png'><img src='${patient}_freq.png' width='1280' height='720' /></a><br />" >> $html
87 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}_freq_both.png'><img src='${patient}_freq_both.png' width='1280' height='720' /></a><br />" >> $html
88 echo "<a href='${patient}_percent_freq.png'><img src='${patient}_percent_freq.png' width='1280' height='720' /></a></div>" >> $html 94 echo "<a href='${patient}_percent_freq.png'><img src='${patient}_percent_freq.png' width='1280' height='720' /></a></div>" >> $html
89 95
91 echo "<div class='tabbertab' title='Data reads'>" >> $html 97 echo "<div class='tabbertab' title='Data reads'>" >> $html
92 echo "<table><tr><td style='vertical-align:top;'>" >> $html 98 echo "<table><tr><td style='vertical-align:top;'>" >> $html
93 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_reads'>" >> $html 99 echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_reads'>" >> $html
94 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 "<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
95 echo "<tbody>" >> $html 101 echo "<tbody>" >> $html
96 readsumtable="<table class='result_table summary_table'><thead><tr><th>Ig/TCR gene rearrangement type</th><th>Proximal gene segment</th><th>Distal gene segment</th><th>Total normalized read count for $sample1</th><th>Total normalized read count for $sample2</th></tr></thead>"
97 while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2 102 while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2
98 do 103 do
99 if [ "$locus" != "$oldLocus" ] ; then 104 if [ "$locus" != "$oldLocus" ] ; then
100 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></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr>" >> $html
101 echo "<tr><td><b>$locus</b></td>" >> $html 106 echo "<tr><td><b>$locus</b></td>" >> $html
102 readsumtable="${readsumtable}<tr><td>$locus</td><td>$v_segment</td><td>$j_segment</td><td>$locusreadsum1</td><td>$locusreadsum2</td></tr>"
103 else 107 else
104 echo "<td></td>" >> $html 108 echo "<td></td>" >> $html
105 fi 109 fi
106 echo "<td>$v_segment</td>" >> $html 110 echo "<td>$v_segment</td>" >> $html
107 echo "<td>$j_segment</td>" >> $html 111 echo "<td>$j_segment</td>" >> $html
128 echo "</tr>" >> $html 132 echo "</tr>" >> $html
129 oldLocus="$locus" 133 oldLocus="$locus"
130 done < tmp.txt 134 done < tmp.txt
131 echo "</tbody></table>" >> $html 135 echo "</tbody></table>" >> $html
132 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_reads'></div></td></tr></table>" >> $html 136 echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_reads'></div></td></tr></table>" >> $html
133 echo "${readsumtable}</table></div>" >> $html 137 echo "</div>" >> $html
134 echo "<div class='tabbertab' title='Graphs reads'>" >> $html 138 echo "<div class='tabbertab' title='Graphs reads'>" >> $html
135 echo "<a href='${patient}_reads.png'><img src='${patient}_reads.png' width='1280' height='720' /></a><br />" >> $html 139 echo "<a href='${patient}_reads.png'><img src='${patient}_reads.png' width='1280' height='720' /></a><br />" >> $html
136 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}_reads_both.png'><img src='${patient}_reads_both.png' width='1280' height='720' /></a><br />" >> $html
137 echo "<a href='${patient}_percent_reads.png'><img src='${patient}_percent_reads.png' width='1280' height='720' /></a></div>" >> $html 141 echo "<a href='${patient}_percent_reads.png'><img src='${patient}_percent_reads.png' width='1280' height='720' /></a></div>" >> $html
138 echo "</div>" >> $html 142 echo "</div>" >> $html
139 echo "</div>" >> $html 143 echo "</div>" >> $html
144 echo "</html>" >> $html
140 done < patients.txt 145 done < patients.txt
141 echo "</div></html>" >> $html
142 rm tmp.txt 146 rm tmp.txt
147
148 html="index.html"
149 echo "<html>" > $html
150 echo "<table>" >> $html
151 echo "<tr><td><b>Singles:</b></td></tr>" >> $html
152 for patient in "${singles[@]}"
153 do
154 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> $html
155 done
156 echo "<tr><td><b>Pairs (Left & Right):</b></td></tr>" >> $html
157 for patient in "${pairs_Left_Right[@]}"
158 do
159 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> $html
160 done
161 echo "<tr><td><b>Pairs (BM & PB):</b></td></tr>" >> $html
162 for patient in "${pairs_BM_PB[@]}"
163 do
164 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> $html
165 done
166 echo "<tr><td><b>Pairs (Dx & R):</b></td></tr>" >> $html
167 for patient in "${pairs_R_Dx[@]}"
168 do
169 echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> $html
170 done
171 echo "<tr><td><b>Triplets:</b></td></tr>" >> $html
172
173 echo "</table>" >> $html
174 echo "</html>" >> $html
175