Mercurial > repos > diego > rtg_investigator
view tools/rtg/galaxy-rtg-snpsim-wrapper.sh @ 1:8593828f91e7 default tip
Full galaxy wrapper
author | diego |
---|---|
date | Sat, 21 Apr 2012 21:36:15 -0400 |
parents | |
children |
line wrap: on
line source
#!/bin/sh DIR="$( cd "$( dirname "$0" )" && pwd )" source $DIR/rtg-galaxy.cfg # Temporary storage for STDERR # Temporary storage for mapping output TMP_STDERR=$(mktemp) || exit 1 #echo "$(date) START $@" >>~/galaxy-rtg-wrapper.log snpfile=$1 shift snpoutputdir=$1 shift # Run the program, send STDERR to temporary file mkdir $snpoutputdir tmpout=$snpoutputdir/snps.vcf $rtg "$@" -s $tmpout -Z 2> $TMP_STDERR #check program's exit code if (( $? )); then #echo "$(date) FAIL $@" >>~/galaxy-rtg-wrapper.log #cat $TMP_STDERR >>~/galaxy-rtg-wrapper.log #Program failed, send STDERR to real STDERR cat $TMP_STDERR >&2 rm $TMP_STDERR rm -rf $tmpout exit 1 fi mv $tmpout $snpfile #echo "$(date) DONE $@" >>~/galaxy-rtg-wrapper.log #Program succeeded, delete STDERR file rm $TMP_STDERR rm -rf $snpoutputdir exit 0