diff rnbeads_galaxy_wrapper.sh @ 31:aad84663f9c2 draft

Uploaded
author pavlo-lutsik
date Fri, 05 Jul 2013 08:03:54 -0400
parents bd8652fa984f
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rnbeads_galaxy_wrapper.sh	Fri Jul 05 08:03:54 2013 -0400
@@ -0,0 +1,25 @@
+#!/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 $* | cut -d\  -f2 | sed -e "s/--output-file=//g"`
+echo $outfile
+#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><body>" >> $outfile
+	echo "<a href=\"index.html\">RnBeads report</a>" >> $outfile
+	echo "<br/><br/>Output was generated during the execution:<br/>" >> $outfile
+	echo "<pre>" >> outfile
+	cat /tmp/rnbeads.stdout |sed -e "s/$/<br\/>/g" >> $outfile
+	echo "</pre>" >> outfile
+	echo "</p>" >> $outfile
+	echo "</body></html>" >> $outfile
+	exit 0
+fi
\ No newline at end of file