comparison report_clonality/r_wrapper.sh @ 47:d97e1421aa86 draft

Uploaded
author davidvanzessen
date Wed, 27 Jan 2016 10:25:43 -0500
parents fee06348bfad
children d08dfc8d5225
comparison
equal deleted inserted replaced
46:fee06348bfad 47:d97e1421aa86
6 clonalType=$4 6 clonalType=$4
7 species=$5 7 species=$5
8 locus=$6 8 locus=$6
9 filterproductive=$7 9 filterproductive=$7
10 clonality_method=$8 10 clonality_method=$8
11 filter_uniques=$9
11 dir="$(cd "$(dirname "$0")" && pwd)" 12 dir="$(cd "$(dirname "$0")" && pwd)"
12 useD="false" 13 useD="false"
13 if grep -q "$species.*${locus}D" "$dir/genes.txt" ; then 14 if grep -q "$species.*${locus}D" "$dir/genes.txt" ; then
14 echo "species D region in reference db" 15 echo "species D region in reference db"
15 useD="true" 16 useD="true"
23 useD="false" 24 useD="false"
24 fi 25 fi
25 fi 26 fi
26 mkdir $3 27 mkdir $3
27 cp $dir/genes.txt $outputDir 28 cp $dir/genes.txt $outputDir
28 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType "$species" "$locus" $filterproductive ${clonality_method} 2>&1 29 Rscript --verbose $dir/RScript.r $inputFile $outputDir $outputDir $clonalType "$species" "$locus" $filterproductive ${clonality_method} ${filter_uniques} 2>&1
29 cp $dir/tabber.js $outputDir 30 cp $dir/tabber.js $outputDir
30 cp $dir/style.css $outputDir 31 cp $dir/style.css $outputDir
31 cp $dir/script.js $outputDir 32 cp $dir/script.js $outputDir
32 cp $dir/jquery-1.11.0.min.js $outputDir 33 cp $dir/jquery-1.11.0.min.js $outputDir
33 samples=`cat $outputDir/samples.txt` 34 samples=`cat $outputDir/samples.txt`
34 35
35 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 36 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
36 echo "<table border = 1>" >> $2 37 echo "<table border = 1>" >> $2
37 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 38 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
38 while IFS=, read sample all productive perc_prod productive_unique perc_prod_un unproductive perc_unprod unproductive_unique perc_unprod_un 39 while IFS=, read sample all productive perc_prod productive_unique perc_prod_un unproductive perc_unprod unproductive_unique perc_unprod_un removed perc_rem
39 do 40 do
40 echo "<tr><td>$sample</td>" >> $2 41 echo "<tr><td>$sample</td>" >> $2
41 echo "<td>$all</td>" >> $2 42 echo "<td>$all</td>" >> $2
43 echo "<td>${removed} (${perc_rem}%)</td>" >> $2
42 echo "<td>$productive (${perc_prod}%)</td>" >> $2 44 echo "<td>$productive (${perc_prod}%)</td>" >> $2
43 echo "<td>$productive_unique (${perc_prod_un}%)</td>" >> $2 45 echo "<td>$productive_unique (${perc_prod_un}%)</td>" >> $2
44 echo "<td>$unproductive (${perc_unprod}%)</td>" >> $2 46 echo "<td>$unproductive (${perc_unprod}%)</td>" >> $2
45 echo "<td>$unproductive_unique (${perc_unprod_un}%)</td></tr>" >> $2 47 echo "<td>$unproductive_unique (${perc_unprod_un}%)</td></tr>" >> $2
46 done < $outputDir/productive_counting.txt 48 done < $outputDir/productive_counting.txt