annotate rnbeads_galaxy_wrapper.sh @ 37:450c8ff1d11a draft

Uploaded
author pavlo-lutsik
date Fri, 05 Jul 2013 09:08:41 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
37
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
1 #!/bin/bash
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
2 random_hash=`tr -dc "[:alpha:]" < /dev/urandom | head -c 8`
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
3 Rscript --no-save $(dirname $(readlink -f $0))/RnBeadsGalaxy.R $* > /tmp/rnbeads_${random_hash}.stdout 2>/tmp/rnbeads_${random_hash}.stderr
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
4 #Rscript --no-save \$R_SCRIPTS_PATH/RnBeadsGalaxy.R $*
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
5 outfile=`echo $* | cut -d\ -f2 | sed -e "s/--output-file=//g"`
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
6 echo $outfile
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
7 #outdir=`echo $* | sed -e "s/.*--report-dir=\(.*\)[[:blank:]].*/\1/g"`
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
8
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
9
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
10 errl=`cat /tmp/rnbeads_${random_hash}.stderr | grep -e "[E|e]rror" | wc -l`
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
11 if [ "$errl" -gt 0 ]
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
12 then
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
13 cat /tmp/rnbeads_${random_hash}.stdout >&2
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
14 #cat $outdir/analysis.log >&2
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
15 cat /tmp/rnbeads_${random_hash}.stderr >&2
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
16 exit 3
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
17 else
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
18 echo "<html><body>" >> $outfile
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
19 echo "<a href=\"index.html\">RnBeads report</a>" >> $outfile
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
20 echo "<br/><br/>Output was generated during the execution:<br/>" >> $outfile
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
21 echo "<pre>" >> outfile
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
22 cat /tmp/rnbeads_${random_hash}.stdout |sed -e "s/$/<br\/>/g" >> $outfile
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
23 echo "</pre>" >> outfile
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
24 echo "</p>" >> $outfile
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
25 echo "</body></html>" >> $outfile
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
26 exit 0
450c8ff1d11a Uploaded
pavlo-lutsik
parents:
diff changeset
27 fi