diff rnbeads_galaxy_wrapper.sh @ 13:d6cdc73fd57e draft

Uploaded
author pavlo-lutsik
date Sun, 21 Apr 2013 18:04:11 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rnbeads_galaxy_wrapper.sh	Sun Apr 21 18:04:11 2013 -0400
@@ -0,0 +1,23 @@
+#!/bin/bash
+Rscript --no-save $(dirname $(readlink -f $0))/RnBeadsGalaxy.R $* > /tmp/rnbeads.stdout 2>/tmp/rnbeads.stderr 
+#Rscript --no-save \$R_SCRIPTS_PATH/RnBeadsGalaxy.R $*
+outfile=`echo $* | sed -e "s/.*--output-file=\(.*\)[$[[:blank:]]].*/\1/g"`
+outdir=`echo $* | sed -e "s/.*--report-dir=\(.*\)[[:blank:]].*/\1/g"`
+
+
+if [ -s /tmp/rnbeads.stderr ]
+then
+	cat /tmp/rnbeads.stdout >&2
+	cat $outdir/analysis.log >&2
+	cat /tmp/rnbeads.stderr >&2
+	exit 3
+else
+	echo "<html>\n<body>\n" >> $outfile
+	echo "<a href=\"index.html\">RnBeads report</a>\n" >> $outfile
+	echo "<br/><br/>\nOutput was generated during the execution:" >> $outfile
+	echo "<p>" >> outfile
+	cat /tmp/rnbeads.stdout >> $outfile
+	echo "</p>" >> $outfile
+	echo "</body>\n</html>" >> $outfile
+	exit 0
+fi
\ No newline at end of file