comparison rnbeads_galaxy_wrapper.sh @ 45:6b0981ab063e draft default tip

Uploaded
author pavlo-lutsik
date Thu, 14 Aug 2014 14:56:18 -0400
parents
children
comparison
equal deleted inserted replaced
44:51c4548d56ed 45:6b0981ab063e
1 #!/bin/bash
2 random_hash=`date | md5sum | head -c10`
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 started=`cat /tmp/rnbeads_${random_hash}.stdout | grep -e "STARTED RnBeads Pipeline" | wc -l`
12 if [ "$started" -lt 1 ]
13 then
14 cat /tmp/rnbeads_${random_hash}.stdout >&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/><h5>Output was generated during the execution:</h5><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