annotate rnbeads_galaxy_wrapper.sh @ 15:602ff524407a draft

Uploaded
author pavlo-lutsik
date Sun, 21 Apr 2013 18:10:16 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
1 #!/bin/bash
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
2 Rscript --no-save $(dirname $(readlink -f $0))/RnBeadsGalaxy.R $* > /tmp/rnbeads.stdout 2>/tmp/rnbeads.stderr
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
3 #Rscript --no-save \$R_SCRIPTS_PATH/RnBeadsGalaxy.R $*
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
4 outfile=`echo $* | sed -e "s/.*--output-file=\(.*\)[[:blank:]].*/\1/g"`
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
5 outdir=`echo $* | sed -e "s/.*--report-dir=\(.*\)[[:blank:]].*/\1/g"`
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
6
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
7
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
8 if [ -s /tmp/rnbeads.stderr ]
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
9 then
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
10 cat /tmp/rnbeads.stdout >&2
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
11 cat $outdir/analysis.log >&2
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
12 cat /tmp/rnbeads.stderr >&2
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
13 exit 3
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
14 else
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
15 echo "<html>\n<body>\n" >> $outfile
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
16 echo "<a href=\"index.html\">RnBeads report</a>\n" >> $outfile
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
17 echo "<br/><br/>\nOutput was generated during the execution:" >> $outfile
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
18 echo "<p>" >> outfile
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
19 cat /tmp/rnbeads.stdout >> $outfile
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
20 echo "</p>" >> $outfile
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
21 echo "</body>\n</html>" >> $outfile
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
22 exit 0
602ff524407a Uploaded
pavlo-lutsik
parents:
diff changeset
23 fi