annotate rnbeads_galaxy_wrapper.sh @ 13:d6cdc73fd57e draft

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