Mercurial > repos > davidvanzessen > clonal_sequences_in_paired_samples
diff wrapper.sh @ 29:5ab17bdf2530 draft
Uploaded
author | davidvanzessen |
---|---|
date | Fri, 22 May 2015 09:06:04 -0400 |
parents | 0940835d259c |
children | 45554fd15511 |
line wrap: on
line diff
--- a/wrapper.sh Tue May 19 08:13:49 2015 -0400 +++ b/wrapper.sh Fri May 22 09:06:04 2015 -0400 @@ -5,12 +5,13 @@ outputDir=$3 min_freq=$4 min_cells=$5 +merge_on="$6" dir="$(cd "$(dirname "$0")" && pwd)" mkdir $outputDir -Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputFile $min_freq $min_cells 2>&1 +Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputFile $min_freq $min_cells "${merge_on}" 2>&1 cp $dir/jquery-1.11.0.min.js $outputDir cp $dir/script.js $outputDir cp $dir/style.css $outputDir @@ -51,6 +52,7 @@ echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_freq'>" >> "$html" 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" echo "<tbody>" >> "$html" + scatterplot_tab="<div class='tabbertab' title='Scatter Plots Reads'>" while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2 do if [ "$locus" != "$oldLocus" ] ; then @@ -82,7 +84,10 @@ echo "<td>$sum</td>" >> "$html" echo "<td>${percent}%</td>" >> "$html" echo "</tr>" >> "$html" - oldLocus="$locus" + oldLocus="$locus" + if [ "${cut_off_value}" == "0" ] ; then + scatterplot_tab="${scatterplot_tab}<img src='${patient}_${sample1}_${sample2}_freq_${locus}_scatter.png' /><br />" + fi done < tmp.txt echo "</tbody></table>" >> "$html" echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_freq'></div></td></tr></table>" >> "$html" @@ -91,6 +96,7 @@ echo "<a href='${patient}_freq.png'><img src='${patient}_freq.png' width='1280' height='720' /></a><br />" >> "$html" echo "<a href='${patient}_freq_both.png'><img src='${patient}_freq_both.png' width='1280' height='720' /></a><br />" >> "$html" echo "<a href='${patient}_percent_freq.png'><img src='${patient}_percent_freq.png' width='1280' height='720' /></a></div>" >> "$html" + echo "${scatterplot_tab}</div>" >> "$html" tail -n+2 ${patient}_reads.txt | sed "s/>//" > tmp.txt echo "<div class='tabbertab' title='Data reads'>" >> "$html" @@ -98,6 +104,7 @@ echo "<table border = 1 class='result_table summary_table' id='summary_table_${patient}_reads'>" >> "$html" 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" echo "<tbody>" >> "$html" + scatterplot_tab="<div class='tabbertab' title='Scatter Plots Frequency'>" while read locus j_segment v_segment cut_off_value both one read_count1 two read_count2 sum percent locusreadsum1 locusreadsum2 do if [ "$locus" != "$oldLocus" ] ; then @@ -130,6 +137,9 @@ echo "<td>${percent}%</td>" >> "$html" echo "</tr>" >> "$html" oldLocus="$locus" + if [ "${cut_off_value}" == "0" ] ; then + scatterplot_tab="${scatterplot_tab}<img src='${patient}_${sample1}_${sample2}_reads_${locus}_scatter.png' /><br />" + fi done < tmp.txt echo "</tbody></table>" >> "$html" echo "</td><td style='vertical-align:top;'><div id='result_div_${patient}_reads'></div></td></tr></table>" >> "$html" @@ -138,6 +148,7 @@ echo "<a href='${patient}_reads.png'><img src='${patient}_reads.png' width='1280' height='720' /></a><br />" >> "$html" echo "<a href='${patient}_reads_both.png'><img src='${patient}_reads_both.png' width='1280' height='720' /></a><br />" >> "$html" echo "<a href='${patient}_percent_reads.png'><img src='${patient}_percent_reads.png' width='1280' height='720' /></a></div>" >> "$html" + echo "${scatterplot_tab}</div>" >> "$html" echo "</div>" >> "$html" echo "</div>" >> "$html" echo "</html>" >> "$html" @@ -146,7 +157,7 @@ html="index.html" echo "<html>" > $html echo "<table>" >> "$html" -echo "<tr><td><b>Singles:</b></td></tr>" >> "$html" +echo "<tr><td><b>Singles (<a href='singles_freq_scatterplot.png'>Frequency scatterplot</a>, <a href='singles_reads_scatterplot.png'>Reads scatterplot</a>):</b></td></tr>" >> "$html" for patient in "${singles[@]}" do echo "<tr><td><a href='${patient}.html'>$patient</a></td></tr>" >> "$html"