Add sample list file as argument

parent 1e638b24
...@@ -20,13 +20,14 @@ For now, scripts have to be launched from the clone directory. ...@@ -20,13 +20,14 @@ For now, scripts have to be launched from the clone directory.
- `wrapper_gangstr.sh` - `wrapper_gangstr.sh`
- `wrapper_transfer.sh` - `wrapper_transfer.sh`
- `wrapper_tredparse.sh` - `wrapper_tredparse.sh`
4. Optional: launch `launch_pipeline_ehdn_outlier.sh`: `nohup ./launch_pipeline_ehdn_outlier.sh &`. Dependencies: 4. Optional: launch `launch_pipeline_ehdn_outlier.sh`: `nohup ./launch_pipeline_ehdn_outlier.sh samples.list &`. Dependencies:
- `config.sh` - `config.sh`
- `samples.list`
- `pipeline_ehdn_outlier.sh` - `pipeline_ehdn_outlier.sh`
- `wrapper_ehdn_outlier.sh` - `wrapper_ehdn_outlier.sh`
5. Launch `launch_results.sh`: `nohup ./launch_results.sh samples.list &`. Dependencies: 5. Launch `launch_results.sh`: `nohup ./launch_results.sh samples.list &`. Dependencies:
- `config.sh` - `config.sh`
- `sample.list` - `samples.list`
- `patho.csv` - `patho.csv`
- `getResults.py` - `getResults.py`
- `launch_str_outliers.sh` - `launch_str_outliers.sh`
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
## Author: Anne-Sophie Denommé-Pichon ## Author: Anne-Sophie Denommé-Pichon
## Description: script to launch the pipeline for STR detection. Receive multiple samples: one sample per line ## Description: script to launch the pipeline for STR detection. Receive multiple samples: one sample per line
# $1 : first argument in the command line : a list containing one sample per line, for exemple samples.list # $1 : first argument in the command line : a list containing one sample per line, for example samples.list
SAMPLES="$1" SAMPLES="$1"
# Check if sample is specified # Check if sample is specified
......
...@@ -6,14 +6,23 @@ ...@@ -6,14 +6,23 @@
## Author : Anne-Sophie Denommé-Pichon ## Author : Anne-Sophie Denommé-Pichon
## Description : script to launch the pipeline for STR detection with EHDN outlier ## Description : script to launch the pipeline for STR detection with EHDN outlier
# $1 : first argument in the command line : a list containing one sample per line, for example samples.list
SAMPLES="$1"
# Check if samples list file is specified
if [ -z "$SAMPLES" ]
then
echo "List of samples is not specified"
echo "$(date +"%F_%H-%M-%S"): END"
exit 1
fi
# Source configuration file # Source configuration file
. "$(dirname "$0")/config.sh" . "$(dirname "$0")/config.sh"
( # Parallel allow to parallelize the processing of multiple samples ({}: one line in samples.list ; $SAMPLES: the file name: samples.list)
cd "$OUTPUTDIR" "$PARALLEL" \
printf "%s\n" *
) |
"$PARALLEL" \
--jobs "$PARALLEL_JOB_COUNT" \ --jobs "$PARALLEL_JOB_COUNT" \
--line-buffer \ --line-buffer \
"$(dirname "$0")/pipeline_ehdn_outlier.sh" "$(dirname "$0")/pipeline_ehdn_outlier.sh" {} "$SAMPLES" \
< "$SAMPLES"
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
## Author: Anne-Sophie Denommé-Pichon ## Author: Anne-Sophie Denommé-Pichon
## Description: script to launch the pipeline for getting STR detection results. Receive multiple samples: one sample per line ## Description: script to launch the pipeline for getting STR detection results. Receive multiple samples: one sample per line
# $1 : first argument in the command line : a list containing one sample per line, for exemple samples.list # $1 : first argument in the command line : a list containing one sample per line, for example samples.list
SAMPLES="$1" SAMPLES="$1"
# Check if sample is specified # Check if sample is specified
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# Source configuration file # Source configuration file
. "$(dirname "$0")/config.sh" . "$(dirname "$0")/config.sh"
# $1 : first argument in the command line : a list containing one sample per line, for exemple samples.list # $1 : first argument in the command line : a list containing one sample per line, for example samples.list
SAMPLES="$1" SAMPLES="$1"
# Check if sample is specified # Check if sample is specified
......
...@@ -61,7 +61,7 @@ qsub -wd "$WD" -pe smp 4 -o "$LOGDIR" -e "$LOGDIR" -q "$COMPUTE_QUEUE" -N "gangs ...@@ -61,7 +61,7 @@ qsub -wd "$WD" -pe smp 4 -o "$LOGDIR" -e "$LOGDIR" -q "$COMPUTE_QUEUE" -N "gangs
# Launch ehdn profile # Launch ehdn profile
mkdir -p "$STRDIR/ehdn" mkdir -p "$STRDIR/ehdn"
qsub -wd "$WD" -pe smp 4 -o "$LOGDIR" -e "$LOGDIR" -q "$COMPUTE_QUEUE" -N "ehdn_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTPREFIX="$STRDIR/ehdn/$SAMPLE",LOGFILE="$LOGDIR/ehdn_$SAMPLE.$DATE.log" "$WD/wrapper_ehdn_profile.sh" qsub -wd "$WD" -pe smp 4 -o "$LOGDIR" -e "$LOGDIR" -q "$COMPUTE_QUEUE" -N "ehdn_$SAMPLE" -hold_jid "$TRANSFER_JOB" -v INPUTFILE="$INPUTFILE",OUTPUTPREFIX="$STRDIR/ehdn/$SAMPLE",LOGFILE="$LOGDIR/ehdn_profile_$SAMPLE.$DATE.log" "$WD/wrapper_ehdn_profile.sh"
# Delete transfered bam and bai # Delete transfered bam and bai
#if [ "x$TRANSFER" = "xyes" ] #if [ "x$TRANSFER" = "xyes" ]
......
...@@ -10,6 +10,15 @@ ...@@ -10,6 +10,15 @@
. "$(dirname "$0")/config.sh" . "$(dirname "$0")/config.sh"
CASE="$1" CASE="$1"
SAMPLES="$2"
DATE="$(date +"%F_%H-%M-%S")"
WD="$(dirname "$(readlink -f "$0")")"
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 LOGDIR="$OUTPUTDIR/logs"
STRDIR="$OUTPUTDIR/str"
mkdir -p "$LOGDIR" "$STRDIR"
qsub -wd "$WD" -pe smp 1 -o "$LOGDIR" -e "$LOGDIR" -q "$COMPUTE_QUEUE" -N "ehdn_outlier_$CASE" -sync y -v CASE="$CASE",SAMPLES="$SAMPLES",LOGFILE="$LOGDIR/ehdn_outlier_$CASE.$DATE.log" "$WD/wrapper_ehdn_outlier.sh"
...@@ -102,7 +102,7 @@ def display_outliers(locus, limits, samples): ...@@ -102,7 +102,7 @@ def display_outliers(locus, limits, samples):
print('Input file is empty', file=sys.stderr) print('Input file is empty', file=sys.stderr)
sys.exit(1) sys.exit(1)
# outlier threshold (exemple: 5%) # outlier threshold (example: 5%)
for tool, tool_values in tools_values.items(): for tool, tool_values in tools_values.items():
# Test if there is at least one value given by the tool # Test if there is at least one value given by the tool
if tool_values: if tool_values:
......
...@@ -9,8 +9,13 @@ ...@@ -9,8 +9,13 @@
# Source the configuration file # Source the configuration file
. ./config.sh . ./config.sh
# Log file path option
if [ -z "$LOGFILE" ]
then
LOGFILE=ehdn_outlier.$(date +"%F_%H-%M-%S").log
fi
# Logging # Logging
LOGFILE="$OUTPUTDIR/$CASE/ehdn/$CASE.ehdn_outlier.$(date +"%F_%H-%M-%S").log"
exec 1>> "$LOGFILE" 2>&1 exec 1>> "$LOGFILE" 2>&1
echo "$(date +"%F_%H-%M-%S"): START" echo "$(date +"%F_%H-%M-%S"): START"
...@@ -22,21 +27,28 @@ then ...@@ -22,21 +27,28 @@ then
exit 1 exit 1
fi fi
# Check if samples list file is specified
if [ -z "$SAMPLES" ]
then
echo "Sample list file is not specified"
echo "$(date +"%F_%H-%M-%S"): END"
exit 1
fi
# Generate manifest for one patient with all samples (to write lines in the file) # Generate manifest for one patient with all samples (to write lines in the file)
cd "$OUTPUTDIR" while read sample
for sample in *
do do
# Check if str_profile.json exists # Check if str_profile.json exists
if [ -f "$OUTPUTDIR/$sample/ehdn/$sample.str_profile.json" ] if [ -f "$OUTPUTDIR/$sample/str/ehdn/$sample.str_profile.json" ]
then then
if [ "x$sample" = "x$CASE" ] if [ "x$sample" = "x$CASE" ]
then then
echo -e "$sample\tcase\t$OUTPUTDIR/$sample/ehdn/$sample.str_profile.json" echo -e "$sample\tcase\t$OUTPUTDIR/$sample/str/ehdn/$sample.str_profile.json"
else else
echo -e "$sample\tcontrol\t$OUTPUTDIR/$sample/ehdn/$sample.str_profile.json" echo -e "$sample\tcontrol\t$OUTPUTDIR/$sample/str/ehdn/$sample.str_profile.json"
fi fi
fi fi
done > "$OUTPUTDIR/$CASE/ehdn/$CASE.manifest.tsv" done < "$SAMPLES" > "$OUTPUTDIR/$CASE/str/ehdn/$CASE.manifest.tsv"
ehdn_outlier_exitcode=$? ehdn_outlier_exitcode=$?
...@@ -50,8 +62,8 @@ fi ...@@ -50,8 +62,8 @@ fi
# Generate multisampleprofile for one patient with all samples # Generate multisampleprofile for one patient with all samples
"$EHDN" merge \ "$EHDN" merge \
--reference "$REFERENCE" \ --reference "$REFERENCE" \
--manifest "$OUTPUTDIR/$CASE/ehdn/$CASE.manifest.tsv" \ --manifest "$OUTPUTDIR/$CASE/str/ehdn/$CASE.manifest.tsv" \
--output-prefix "$CASE/ehdn/$CASE" --output-prefix "$CASE/str/ehdn/$CASE"
ehdn_outlier_exitcode=$? ehdn_outlier_exitcode=$?
...@@ -64,9 +76,9 @@ fi ...@@ -64,9 +76,9 @@ fi
# Run locus-based comparison analysis # Run locus-based comparison analysis
"$EHDN_OUTLIER" locus \ "$EHDN_OUTLIER" locus \
--manifest "$OUTPUTDIR/$CASE/ehdn/$CASE.manifest.tsv" \ --manifest "$OUTPUTDIR/$CASE/str/ehdn/$CASE.manifest.tsv" \
--multisample-profile "$OUTPUTDIR/$CASE/ehdn/$CASE.multisample_profile.json" \ --multisample-profile "$OUTPUTDIR/$CASE/str/ehdn/$CASE.multisample_profile.json" \
--output "$OUTPUTDIR/$CASE/ehdn/$CASE.outlier_locus.tsv" --output "$OUTPUTDIR/$CASE/str/ehdn/$CASE.outlier_locus.tsv"
ehdn_outlier_exitcode=$? ehdn_outlier_exitcode=$?
...@@ -80,9 +92,9 @@ fi ...@@ -80,9 +92,9 @@ fi
# Run motif_based comparison analysis # Run motif_based comparison analysis
"$EHDN_OUTLIER" motif \ "$EHDN_OUTLIER" motif \
--manifest "$OUTPUTDIR/$CASE/ehdn/$CASE.manifest.tsv" \ --manifest "$OUTPUTDIR/$CASE/str/ehdn/$CASE.manifest.tsv" \
--multisample-profile "$OUTPUTDIR/$CASE/ehdn/$CASE.multisample_profile.json" \ --multisample-profile "$OUTPUTDIR/$CASE/str/ehdn/$CASE.multisample_profile.json" \
--output "$OUTPUTDIR/$CASE/ehdn/$CASE.outlier_motif.tsv" --output "$OUTPUTDIR/$CASE/str/ehdn/$CASE.outlier_motif.tsv"
ehdn_outlier_exitcode=$? ehdn_outlier_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