From ba80c977784774a2ae31e89756082f0091e67e7a Mon Sep 17 00:00:00 2001 From: s-boardman Date: Wed, 2 Sep 2015 11:37:04 +0100 Subject: [PATCH 1/4] Corrected CNVnator verbose output. Echo of file renaming corrected for verbose output. --- bin/speedseq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/speedseq b/bin/speedseq index cd3a1de..c942e33 100755 --- a/bin/speedseq +++ b/bin/speedseq @@ -1468,7 +1468,7 @@ global options: if [[ "$VERBOSE" -eq 1 ]] then - echo "mv $TEMP_DIR/$OUTBASE.rd.sv.vcf $TEMP_DIR/$OUTBASE.rd.sv.vcf" + echo "mv $TEMP_DIR/$OUTBASE.rd.sv.vcf $TEMP_DIR/$OUTBASE.sv.vcf" echo "mv $TEMP_DIR/$FULL_BASE.readdepth.txt $OUTPUT.$FULL_BASE.sv.readdepth.txt" echo "mv $TEMP_DIR/$FULL_BASE.readdepth.bed $OUTPUT.$FULL_BASE.sv.readdepth.bed" fi From afb16f3b261a45f34eec2cb06b01ce74ecf4e21c Mon Sep 17 00:00:00 2001 From: s-boardman Date: Wed, 2 Sep 2015 11:52:18 +0100 Subject: [PATCH 2/4] Window size flag and testing Pass CNVnator window size as a flagged option. Test if window size passed without read depth flag and return usage and informative error message. --- bin/speedseq | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/speedseq b/bin/speedseq index c942e33..540ea31 100755 --- a/bin/speedseq +++ b/bin/speedseq @@ -1157,6 +1157,7 @@ sv options: -x FILE BED file to exclude -g genotype SV breakends with svtyper -d calculate read-depth with CNVnator + -w CNVnator window size [100] -A annotate the vcf with VEP -P output LUMPY probability curves in VCF -m INT minimum sample weight for a call [4] @@ -1188,8 +1189,9 @@ global options: OUTPUT="" MAX_SPLIT_COUNT=2 MIN_NON_OVERLAP=20 + WIN_SIZE=100 - while getopts ":hB:S:D:R:o:m:r:x:T:t:AdgPkvK:" OPTION + while getopts ":hB:S:D:R:o:m:r:x:T:t:AdwgPkvK:" OPTION do case "${OPTION}" in h) @@ -1235,6 +1237,9 @@ global options: d) READDEPTH=1 ;; + w) + WINDOW_SIZE="$OPTARG" + ;; g) GENOTYPE=1 ;; @@ -1344,6 +1349,14 @@ global options: exit 1 fi fi + + # if window size specified, check CNVnator is also specified + if [[ "$WINDOW_SIZE" -eq 100 ]] && [[ "$READDEPTH" ! -eq 1 ]] + then + sv_usage + echo -e "CNVnator window size passed without CNVnator; please use -d in conjunction with -w" + exit 1 + fi # check for required python modules (pysam, numpy, scipy, etc) check_python_modules $PYTHON @@ -1439,7 +1452,6 @@ global options: if [[ "$READDEPTH" -eq 1 ]] then echo "Calculating read depth" - WINDOW_SIZE=100 for i in $( seq 0 $(( ${#FULL_BAM_LIST[@]}-1 )) ) do From 0fbe2544acef8916b39433008615aa0e329db900 Mon Sep 17 00:00:00 2001 From: s-boardman Date: Mon, 21 Sep 2015 12:02:59 +0100 Subject: [PATCH 3/4] OPTARGs flag for windowsize updated to w: --- bin/speedseq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/speedseq b/bin/speedseq index 540ea31..1cba36f 100755 --- a/bin/speedseq +++ b/bin/speedseq @@ -1191,7 +1191,7 @@ global options: MIN_NON_OVERLAP=20 WIN_SIZE=100 - while getopts ":hB:S:D:R:o:m:r:x:T:t:AdwgPkvK:" OPTION + while getopts ":hB:S:D:R:o:m:r:x:T:t:Adw:gPkvK:" OPTION do case "${OPTION}" in h) From e6938b9eaa8f3f11aa64b6a5bbe8244cb03431f8 Mon Sep 17 00:00:00 2001 From: s-boardman Date: Mon, 21 Sep 2015 15:30:12 +0100 Subject: [PATCH 4/4] Set default window size for CNVnator. --- bin/speedseq | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/speedseq b/bin/speedseq index 1cba36f..6441a4d 100755 --- a/bin/speedseq +++ b/bin/speedseq @@ -1157,7 +1157,7 @@ sv options: -x FILE BED file to exclude -g genotype SV breakends with svtyper -d calculate read-depth with CNVnator - -w CNVnator window size [100] + -w INT CNVnator window size [100] -A annotate the vcf with VEP -P output LUMPY probability curves in VCF -m INT minimum sample weight for a call [4] @@ -1189,7 +1189,6 @@ global options: OUTPUT="" MAX_SPLIT_COUNT=2 MIN_NON_OVERLAP=20 - WIN_SIZE=100 while getopts ":hB:S:D:R:o:m:r:x:T:t:Adw:gPkvK:" OPTION do @@ -1347,11 +1346,15 @@ global options: sv_usage echo -e "Error: annotate_rd.py executable not found. Please set path in $SPEEDSEQ_DIR/speedseq.config file\n" exit 1 + elif [[ -z "$WINDOW_SIZE"]] + then + WINDOW_SIZE=100 + echo -e "Using default window size: 100\n" fi fi # if window size specified, check CNVnator is also specified - if [[ "$WINDOW_SIZE" -eq 100 ]] && [[ "$READDEPTH" ! -eq 1 ]] + if [[ -n "$WINDOW_SIZE" ]] && [[ "$READDEPTH" -ne 1 ]] then sv_usage echo -e "CNVnator window size passed without CNVnator; please use -d in conjunction with -w"