Fix some bugs

parent 2b4c77e7
......@@ -9,6 +9,6 @@
- [ ] Brancher EHDN et outlier
- [ ] Séparer case et contrôles
- [ ] Ajouter EHDN dans GetResults
- [ ] Ajouter le sample dans le nom de fichier de log
- [ ] Ajouter le sample dans le nom de fichier de log pour pieline.sh
- [ ] Changer le répertoire de sortie : /STR/pipeline car pipeline n'est pas explicite (répertoire avec fichiers de sortie des outils de détection de STR)
- [ ] Remove dijen from str_outliers.py
......@@ -21,46 +21,47 @@ fi
# Source the configuration file
. "$(dirname "$0")/config.sh"
if [ "x$INPUTDIR" = "x$OUTPUTDIR"]
if [ "x$INPUTDIR" = "x$OUTPUTDIR" ]
then
echo "Input directory is the same as output directory. Please change it to prevent the pipeline from deleting or overwriting raw data."
exit 1
fi
INPUTFILE="INPUTDIR/$SAMPLE.bam"
INPUTFILE="$INPUTDIR/$SAMPLE.bam"
DATE="$(date +"%F_%H-%M-%S")"
OUTPUTDIR="OUTPUTDIR/$SAMPLE"
OUTPUTDIR="$OUTPUTDIR/$SAMPLE"
TRANSFER_JOB=""
WD="$(dirname "$(readlink -f "$0")")"
# Transfer bam and bai from archive to work
Transfer bam and bai from archive to work
if [ "x$TRANSFER" = "xyes" ]
then
mkdir -p "$OUTPUTDIR"
TRANSFER_JOB="transfer_$SAMPLE"
qsub -pe smp 1 -q "$TRANSFER_QUEUE" -N "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTDIR="$OUTPUTDIR",LOGFILE="$OUTPUTDIR/transfer_$DATE.log" "$(dirname "$0")/wrapper_transfer.sh"
qsub -wd "$WD" -pe smp 1 -q "$TRANSFER_QUEUE" -N "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",TRANSFER_OUTPUTDIR="$OUTPUTDIR",LOGFILE="$OUTPUTDIR/transfer_$DATE.log" wrapper_transfer.sh
INPUTFILE="$OUTPUTDIR/$SAMPLE.bam"
fi
# Launch ExpansionHunter
mkdir -p "$OUTPUTDIR/eh"
qsub -pe smp 4 -q "$COMPUTE_QUEUE" -N "eh_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTPREFIX="$OUTPUTDIR/eh/$SAMPLE",LOGFILE="$OUTPUTDIR/eh/$DATE.log" "$(dirname "$0")/wrapper_expansionhunter.sh"
qsub -wd "$WD" -pe smp 4 -q "$COMPUTE_QUEUE" -N "eh_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTPREFIX="$OUTPUTDIR/eh/$SAMPLE",LOGFILE="$OUTPUTDIR/eh/$DATE.log" wrapper_expansionhunter.sh
# Launch Tredparse
mkdir -p "$OUTPUTDIR/tredparse"
qsub -pe smp 4 -q "$COMPUTE_QUEUE" -N "tredparse_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTDIR="$OUTPUTDIR/tredparse",LOGFILE="$OUTPUTDIR/tredparse/$DATE.log" "$(dirname "$0")/wrapper_tredparse.sh"
qsub -wd "$WD" -pe smp 4 -q "$COMPUTE_QUEUE" -N "tredparse_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",TREDPARSE_OUTPUTDIR="$OUTPUTDIR/tredparse",LOGFILE="$OUTPUTDIR/tredparse/$DATE.log" wrapper_tredparse.sh
# Launch GangSTR
mkdir -p "$OUTPUTDIR/gangstr"
qsub -pe smp 4 -q "$COMPUTE_QUEUE" -N "gangstr_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTPREFIX="$OUTPUTDIR/gangstr/$SAMPLE",LOGFILE="$OUTPUTDIR/gangstr/$DATE.log" "$(dirname "$0")/wrapper_gangstr.sh"
qsub -wd "$WD" -pe smp 4 -q "$COMPUTE_QUEUE" -N "gangstr_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTPREFIX="$OUTPUTDIR/gangstr/$SAMPLE",LOGFILE="$OUTPUTDIR/gangstr/$DATE.log" wrapper_gangstr.sh
# Launch ehdn profile
mkdir -p "$OUTPUTDIR/ehdn"
qsub -pe smp 4 -q "$COMPUTE_QUEUE" -N "ehdn_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTPREFIX="$OUTPUTDIR/ehdn/$SAMPLE",LOGFILE="$OUTPUTDIR/ehdn/$DATE.log" "$(dirname "$0")/wrapper_ehdn_profile.sh"
qsub -wd "$WD" -pe smp 4 -q "$COMPUTE_QUEUE" -N "ehdn_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTPREFIX="$OUTPUTDIR/ehdn/$SAMPLE",LOGFILE="$OUTPUTDIR/ehdn/$DATE.log" wrapper_ehdn_profile.sh
# Delete transfered bam and bai
if [ "x$TRANSFER" = "xyes" ]
then
qsub -pe smp 1 -q "$COMPUTE_QUEUE" -N "delete_$SAMPLE" -hold_jid "eh_$SAMPLE,tredparse_$SAMPLE,gangstr_$SAMPLE,ehdn_$SAMPLE" -sync y -v SAMPLE="$SAMPLE",LOGFILE="$OUTPUTDIR/delete_$DATE.log" "$(dirname "$0")/wrapper_delete.sh"
qsub -wd "$WD" -pe smp 1 -q "$COMPUTE_QUEUE" -N "delete_$SAMPLE" -hold_jid "eh_$SAMPLE,tredparse_$SAMPLE,gangstr_$SAMPLE,ehdn_$SAMPLE" -sync y -v SAMPLE="$SAMPLE",LOGFILE="$OUTPUTDIR/delete_$DATE.log" wrapper_delete.sh
else
qsub -pe smp 1 -q "$COMPUTE_QUEUE" -N "delete_$SAMPLE" -hold_jid "eh_$SAMPLE,tredparse_$SAMPLE,gangstr_$SAMPLE,ehdn_$SAMPLE" -sync y -b y echo "Nothing to delete."
qsub -wd "$WD" -pe smp 1 -q "$COMPUTE_QUEUE" -N "delete_$SAMPLE" -hold_jid "eh_$SAMPLE,tredparse_$SAMPLE,gangstr_$SAMPLE,ehdn_$SAMPLE" -sync y -b y echo "Nothing to delete."
fi
......@@ -11,5 +11,5 @@
CASE="$1"
qsub -pe smp 1 -q "$COMPUTE_QUEUE" -N "ehdn_outlier_$CASE" -sync y -v CASE="$CASE" "$(dirname "$0")/wrapper_ehdn_outlier.sh"
qsub -wd "$(dirname "$(readlink -f "$0")")" -pe smp 1 -q "$COMPUTE_QUEUE" -N "ehdn_outlier_$CASE" -sync y -v CASE="$CASE" wrapper_ehdn_outlier.sh
......@@ -8,7 +8,7 @@
## Usage: qsub -pe smp 1 -v SAMPLE=<sample>,[LOGFILE=<path to the log file>] wrapper_delete.sh
# Source the configuration file
. "$(dirname "$0")/config.sh"
. ./config.sh
# Log file path option
if [ -z "$LOGFILE" ]
......
......@@ -7,7 +7,7 @@
## Description: script to generate automatically a manifest and multisampleprofile in a tsv format, then do outlier analyses for a single patient
# Source the configuration file
. "$(dirname "$0")/config.sh"
. ./config.sh
# Logging
LOGFILE="$OUTPUTDIR/$CASE/ehdn/$CASE.ehdn_outlier.$(date +"%F_%H-%M-%S").log"
......
......@@ -8,7 +8,7 @@
## Usage: qsub -pe smp 1 -v INPUTFILE=<path to the bam file>,OUTPUTPREFIX=<output prefix>,[LOGFILE=<path to the log file>] wrapper_ehdn_profile.sh
# Source the configuration file
. "$(dirname "$0")/config.sh"
. ./config.sh
# Log file path option
if [ -z "$LOGFILE" ]
......
......@@ -8,7 +8,8 @@
## Usage: qsub -pe smp 1 -v INPUTFILE=<path to the bam file>,OUTPUTPREFIX=<output prefix>,[LOGFILE=<path to the log file>] wrapper_expansionhunter.sh
# Source the configuration file
. "$(dirname "$0")/config.sh"
. ./config.sh
# Log file path option
if [ -z "$LOGFILE" ]
......
......@@ -8,7 +8,7 @@
## Usage: qsub -pe smp 1 -v INPUTFILE=<path to the bam file>,OUTPUTPREFIX=<output prefix>,[LOGFILE=<path to the log file>] wrapper_gangstr.sh
# Source the configuration file
. "$(dirname "$0")/config.sh"
. ./config.sh
# Log file path option
if [ -z "$LOGFILE" ]
......
......@@ -5,7 +5,7 @@
## Licence: AGPLv3
## Author: anne-sophie.denomme-pichon@u-bourgogne.fr
## Description: a wrapper for qsubing bam transfer for STR pipeline
## Usage: qsub -pe smp 1 -v INPUTFILE=<path to the bam file>,OUTPUTDIR=<output directory>,[LOGFILE=<path to the log file>] wrapper_transfer.sh
## Usage: qsub -pe smp 1 -v INPUTFILE=<path to the bam file>,TRANSFER_OUTPUTDIR=<output directory>,[LOGFILE=<path to the log file>] wrapper_transfer.sh
# Log file path option
......@@ -28,7 +28,7 @@ then
fi
# Check if output directory is specified
if [ -z "$OUTPUTDIR" ]
if [ -z "$TRANSFER_OUTPUTDIR" ]
then
echo "Output directory is not specified"
echo "$(date +"%F_%H-%M-%S"): END"
......@@ -36,12 +36,12 @@ then
fi
# Transfer and check exit code
echo "command : rsync -aAX \
echo "command : rsync -aX \
$INPUTFILE $(echo "$INPUTFILE" | sed 's/\.bam$/.bai/') \
$OUTPUTDIR"
rsync -aAX \
$TRANSFER_OUTPUTDIR"
rsync -aX \
"$INPUTFILE" "$(echo "$INPUTFILE" | sed 's/\.bam$/.bai/')" \
"$OUTPUTDIR"
"$TRANSFER_OUTPUTDIR"
transfer_exitcode=$?
......
......@@ -5,10 +5,10 @@
## Licence: AGPLv3
## Author: anne-sophie.denomme-pichon@u-bourgogne.fr
## 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
## Usage: qsub -pe smp 1 -v INPUTFILE=<path to the bam file>,TREDPARSE_OUTPUTDIR=<output directory>,[LOGFILE=<path to the log file>] wrapper_tredparse.sh
# Source the configuration file
. "$(dirname "$0")/config.sh"
. ./config.sh
# Log file path option
if [ -z "$LOGFILE" ]
......@@ -30,7 +30,7 @@ then
fi
# Check if output prefix is specified
if [ -z "$OUTPUTDIR" ]
if [ -z "$TREDPARSE_OUTPUTDIR" ]
then
echo "Output directory is not specified"
echo "$(date +"%F_%H-%M-%S"): END"
......@@ -44,8 +44,8 @@ then
fi
# Launch script command and check exit code
echo "command : $TREDPARSE $INPUTFILE --workdir $OUTPUTDIR --ref hg19"
"$TREDPARSE" "$INPUTFILE" --workdir "$OUTPUTDIR" --ref hg19
echo "command : $TREDPARSE $INPUTFILE --workdir $TREDPARSE_OUTPUTDIR --ref hg19"
"$TREDPARSE" "$INPUTFILE" --workdir "$TREDPARSE_OUTPUTDIR" --ref hg19
tredparse_exitcode=$?
......
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