comparison rnbeads_galaxy_wrapper.sh @ 43:39b78c48d064 draft

Uploaded
author pavlo-lutsik
date Fri, 05 Jul 2013 17:39:25 -0400
parents 450c8ff1d11a
children
comparison
equal deleted inserted replaced
42:16f6ef2b3251 43:39b78c48d064
1 #!/bin/bash
2 random_hash=`tr -dc "[:alpha:]" < /dev/urandom | head -c 8`
3 Rscript --no-save $(dirname $(readlink -f $0))/RnBeadsGalaxy.R $* > /tmp/rnbeads_${random_hash}.stdout 2>/tmp/rnbeads_${random_hash}.stderr
4 #Rscript --no-save \$R_SCRIPTS_PATH/RnBeadsGalaxy.R $*
5 outfile=`echo $* | cut -d\ -f2 | sed -e "s/--output-file=//g"`
6 echo $outfile
7 #outdir=`echo $* | sed -e "s/.*--report-dir=\(.*\)[[:blank:]].*/\1/g"`
8
9
10 errl=`cat /tmp/rnbeads_${random_hash}.stderr | grep -e "[E|e]rror" | wc -l`
11 if [ "$errl" -gt 0 ]
12 then
13 cat /tmp/rnbeads_${random_hash}.stdout >&2
14 #cat $outdir/analysis.log >&2
15 cat /tmp/rnbeads_${random_hash}.stderr >&2
16 exit 3
17 else
18 echo "<html><body>" >> $outfile
19 echo "<a href=\"index.html\">RnBeads report</a>" >> $outfile
20 echo "<br/><br/>Output was generated during the execution:<br/>" >> $outfile
21 echo "<pre>" >> outfile
22 cat /tmp/rnbeads_${random_hash}.stdout |sed -e "s/$/<br\/>/g" >> $outfile
23 echo "</pre>" >> outfile
24 echo "</p>" >> $outfile
25 echo "</body></html>" >> $outfile
26 exit 0
27 fi