comparison rnbeads_galaxy_wrapper.sh @ 33:4feb5eba202c draft

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