annotate rnbeads_galaxy_wrapper.sh @ 25:6f4321495d9d draft

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