diff report_clonality/r_wrapper.sh @ 47:d97e1421aa86 draft

Uploaded
author davidvanzessen
date Wed, 27 Jan 2016 10:25:43 -0500
parents fee06348bfad
children d08dfc8d5225
line wrap: on
line diff
--- a/report_clonality/r_wrapper.sh	Wed Jan 27 08:39:16 2016 -0500
+++ b/report_clonality/r_wrapper.sh	Wed Jan 27 10:25:43 2016 -0500
@@ -8,6 +8,7 @@
 locus=$6
 filterproductive=$7
 clonality_method=$8
+filter_uniques=$9
 dir="$(cd "$(dirname "$0")" && pwd)"
 useD="false"
 if grep -q "$species.*${locus}D" "$dir/genes.txt" ; then
@@ -25,7 +26,7 @@
 fi
 mkdir $3
 cp $dir/genes.txt $outputDir
-Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType "$species" "$locus" $filterproductive ${clonality_method} 2>&1
+Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType "$species" "$locus" $filterproductive ${clonality_method} ${filter_uniques} 2>&1
 cp $dir/tabber.js $outputDir
 cp $dir/style.css $outputDir
 cp $dir/script.js $outputDir
@@ -34,11 +35,12 @@
 
 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
 echo "<table border = 1>" >> $2
-echo "<thead><tr><th>Sample/Replicate</th><th>All</th><th>Productive</th><th>Unique Productive</th><th>Unproductive</th><th>Unique Unproductive</th></tr></thead>" >> $2
-while IFS=, read sample all productive perc_prod productive_unique perc_prod_un unproductive perc_unprod unproductive_unique perc_unprod_un
+echo "<thead><tr><th>Sample/Replicate</th><th>All</th><th>Removed</th><th>Productive</th><th>Unique Productive</th><th>Unproductive</th><th>Unique Unproductive</th></tr></thead>" >> $2
+while IFS=, read sample all productive perc_prod productive_unique perc_prod_un unproductive perc_unprod unproductive_unique perc_unprod_un removed perc_rem
 	do
 		echo "<tr><td>$sample</td>" >> $2
 		echo "<td>$all</td>" >> $2
+		echo "<td>${removed} (${perc_rem}%)</td>" >> $2
 		echo "<td>$productive (${perc_prod}%)</td>" >> $2
 		echo "<td>$productive_unique (${perc_prod_un}%)</td>" >> $2
 		echo "<td>$unproductive (${perc_unprod}%)</td>" >> $2