Create wrapper and wrapper launcher for Tredparse

parent f930d128
#! /bin/sh
### ASDP PIPELINE ###
## launch_wrapper_tredparse.sh
## Version : 0.0.1
## Licence : FIXME
## Description : script to launch the wrapper for qsubing Tredparse script for STR detection
## Usage : FIXME
## Output : FIXME
## Requirements : FIXME
## Author : anne-sophie.denomme-pichon@u-bourgogne.fr
## Creation Date : 20191103
## last revision date : 20191103
## Known bugs : None
INPUTFILE=/archive/gad/shared/bam_new_genome_temp/dijen017.bam
OUTPUTDIR=/user1/gad/an1770de/Tools/Tredparse/"$(date +"%F_%H-%M-%S")"
LOGFILE="$OUTPUTDIR/log.log"
# Launch the script on local host with --local option and on SGE with qsub without the --local option
if [ $# -eq 1 ] && [ "x$1" = x--local ]
then
mkdir -p "$OUTPUTDIR"
INPUTFILE="$INPUTFILE" OUTPUTDIR="$OUTPUTDIR" LOGFILE="$LOGFILE" "$(dirname "$0")/wrapper_tredparse.sh"
else
qsub -pe smp 1 -q batch -v INPUTFILE="$INPUTFILE",OUTPUTDIR="$OUTPUTDIR",LOGFILE="$LOGFILE" wrapper_tredparse.sh
fi
#! /bin/sh
### ASDP PIPELINE ###
## wrapper_tredparse.sh
## Version : 0.0.1
## Licence : FIXME
## Description : a wrapper for qsubing Tredparse script for STR detection
## Usage : qsub -pe smp 1 -v INPUTFILE=<path to the bam file>,OUTPUTDIR=<output directory>,[LOGFILE=<path to the log file>] wrapper_tredparse.sh
## Output : FIXME
## Requirements : FIXME
## Author : anne-sophie.denomme-pichon@u-bourgogne.fr
## Creation Date : 20191103
## last revision date : 20191103
## Known bugs : None
# Log file path option
if [ -z "$LOGFILE" ]
then
LOGFILE=tredparse.$(date +"%F_%H-%M-%S").log
fi
# Logging
exec 1>> "$LOGFILE" 2>&1
echo "$(date +"%F_%H-%M-%S"): START"
# Check if input file exists
if [ ! -f "$INPUTFILE" ]
then
echo "Input file '$INPUTFILE' does not exist"
echo "$(date +"%F_%H-%M-%S"): END"
touch tredparse.failed
exit 1
fi
# Check if output prefix is specified
if [ -z "$OUTPUTDIR" ]
then
echo "Output directory is not specified"
echo "$(date +"%F_%H-%M-%S"): END"
touch tredparse.failed
exit 1
fi
# Enable the virtualenv
TREDPARSE="/work/gad/shared/bin/tredparse/Tredparse-20190901"
. "$TREDPARSE/bin/activate"
# Launch script command and check exit code
echo "command : FIXME"
"$TREDPARSE/bin/tred.py" "$INPUTFILE" --workdir "$OUTPUTDIR" --ref hg19
tredparse_exitcode=$?
echo "tredparse exit code : $tredparse_exitcode"
if [ $tredparse_exitcode != 0 ]
then
echo "$(date +"%F_%H-%M-%S"): END"
touch tredparse.failed
exit 1
fi
echo "$(date +"%F_%H-%M-%S"): END"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment