From dcc032706870ff5ebf26497e4cd9845609c829af Mon Sep 17 00:00:00 2001 From: WardDeb Date: Thu, 7 Mar 2024 16:33:04 +0100 Subject: [PATCH 1/4] update help on NMaskedIndex, untemp unphased allelic bams --- snakePipes/parserCommon.py | 3 ++- snakePipes/shared/rules/Bowtie2_allelic.snakefile | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/snakePipes/parserCommon.py b/snakePipes/parserCommon.py index 0042ce5da..cf0280d43 100644 --- a/snakePipes/parserCommon.py +++ b/snakePipes/parserCommon.py @@ -168,7 +168,8 @@ def snpArguments(defaults): snpargs.add_argument("--NMaskedIndex", default='', - help="N-masked index of the reference genome (default: 'None')") + help="N-masked index of the reference genome (default: 'None'). " + "Note that this should point to a file (i.e. 'Genome' for STAR indices, genome.1.bt2 for bowtie2 indices).") return parser diff --git a/snakePipes/shared/rules/Bowtie2_allelic.snakefile b/snakePipes/shared/rules/Bowtie2_allelic.snakefile index 97756d09b..12854c3cd 100755 --- a/snakePipes/shared/rules/Bowtie2_allelic.snakefile +++ b/snakePipes/shared/rules/Bowtie2_allelic.snakefile @@ -17,7 +17,7 @@ if aligner == "Bowtie2": index = bowtie2_index_allelic output: align_summary = aligner+"/{sample}.Bowtie2_summary.txt", - bam = temp(aligner+"/{sample}.sorted.bam") + bam = aligner+"/{sample}.sorted.bam" log: "Bowtie2/logs/{sample}.sort.log" params: alignerOpts = str(alignerOpts or ''), @@ -51,7 +51,7 @@ if aligner == "Bowtie2": index = bowtie2_index_allelic output: align_summary = aligner+"/{sample}.Bowtie2_summary.txt", - bam = temp(aligner+"/{sample}.sorted.bam") + bam = aligner+"/{sample}.sorted.bam" log: "Bowtie2/logs/{sample}.sort.log" params: alignerOpts = str(alignerOpts or ''), From 1b5dfb833ab91d27816a010302f40203cda2b837 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Thu, 7 Mar 2024 16:59:33 +0100 Subject: [PATCH 2/4] change numbers in dag test due to temp omission --- .ci_stuff/test_dag.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ci_stuff/test_dag.sh b/.ci_stuff/test_dag.sh index f4f4bcf74..4716d1c87 100755 --- a/.ci_stuff/test_dag.sh +++ b/.ci_stuff/test_dag.sh @@ -175,11 +175,11 @@ WC=`DNA-mapping -i PE_input -o output .ci_stuff/organism.yaml --snakemakeOptions if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1402 ]; then exit 1 ; fi #allelic WC=`DNA-mapping -m allelic-mapping -i PE_input -o output --snakemakeOptions " --dryrun --conda-prefix /tmp" --VCFfile allelic_input/file.vcf.gz --strains strain1,strain2 .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l` -if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2466 ]; then exit 1 ; fi +if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2457 ]; then exit 1 ; fi WC=`DNA-mapping -m allelic-mapping -i PE_input -o output --snakemakeOptions " --dryrun --conda-prefix /tmp" --SNPfile allelic_input/snpfile.txt --NMaskedIndex allelic_input/Ngenome .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l` -if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2445 ]; then exit 1 ; fi +if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2436 ]; then exit 1 ; fi WC=`DNA-mapping -m allelic-mapping -i PE_input -o output --snakemakeOptions " --dryrun --conda-prefix /tmp" --VCFfile allelic_input/file.vcf.gz --strains strain1 .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l` -if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2466 ]; then exit 1 ; fi +if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2457 ]; then exit 1 ; fi # ChIP-seq WC=`ChIP-seq -d BAM_input --snakemakeOptions " --dryrun --conda-prefix /tmp" .ci_stuff/organism.yaml .ci_stuff/ChIP.sample_config.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l` From 44e828616883b533c4a2d2f574a732d3018dc7c1 Mon Sep 17 00:00:00 2001 From: WardDeb Date: Fri, 8 Mar 2024 11:03:22 +0100 Subject: [PATCH 3/4] bowtie2 - allelic mode actually returns .filtered. reports, update multiqc report as well --- snakePipes/shared/rules/SNPsplit.snakefile | 4 ++-- snakePipes/shared/rules/multiQC.snakefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/snakePipes/shared/rules/SNPsplit.snakefile b/snakePipes/shared/rules/SNPsplit.snakefile index 37169ab55..ea06f0f15 100644 --- a/snakePipes/shared/rules/SNPsplit.snakefile +++ b/snakePipes/shared/rules/SNPsplit.snakefile @@ -8,8 +8,8 @@ if aligner == "Bowtie2": output: targetbam = expand("allelic_bams/{{sample}}.filtered.{suffix}.bam", suffix = ['allele_flagged', 'genome1', 'genome2', 'unassigned']), tempbam = temp("filtered_bam/{sample}.filtered.sortedByName.bam"), - rep1 = "allelic_bams/{sample}.SNPsplit_report.yaml", - rep2 = "allelic_bams/{sample}.SNPsplit_sort.yaml" + rep1 = "allelic_bams/{sample}.filtered.SNPsplit_report.yaml", + rep2 = "allelic_bams/{sample}.filtered.SNPsplit_sort.yaml" log: "allelic_bams/logs/{sample}.snp_split.log" params: pairedEnd = '--paired' if pairedEnd else '', diff --git a/snakePipes/shared/rules/multiQC.snakefile b/snakePipes/shared/rules/multiQC.snakefile index 619a05398..308cbc060 100755 --- a/snakePipes/shared/rules/multiQC.snakefile +++ b/snakePipes/shared/rules/multiQC.snakefile @@ -61,8 +61,8 @@ def multiqc_input_check(return_value): infiles.append( expand("Qualimap_qc/{sample}.filtered.bamqc_results.txt", sample = samples) ) indir += " Qualimap_qc " if "allelic-mapping" in mode: - infiles.append( expand("allelic_bams/{sample}.SNPsplit_report.yaml", sample = samples) ) - infiles.append( expand("allelic_bams/{sample}.SNPsplit_sort.yaml", sample = samples) ) + infiles.append( expand("allelic_bams/{sample}.filtered.SNPsplit_report.yaml", sample = samples) ) + infiles.append( expand("allelic_bams/{sample}.filtered.SNPsplit_sort.yaml", sample = samples) ) indir += "allelic_bams" elif pipeline=="rna-seq": # must be RNA-mapping, add files as per the mode From ae536b9602b0d0ee21fe9df47df0fdbfe911f97e Mon Sep 17 00:00:00 2001 From: WardDeb Date: Fri, 8 Mar 2024 12:13:09 +0100 Subject: [PATCH 4/4] revert temping original bam file --- .ci_stuff/test_dag.sh | 6 +++--- snakePipes/shared/rules/Bowtie2_allelic.snakefile | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.ci_stuff/test_dag.sh b/.ci_stuff/test_dag.sh index 4716d1c87..f4f4bcf74 100755 --- a/.ci_stuff/test_dag.sh +++ b/.ci_stuff/test_dag.sh @@ -175,11 +175,11 @@ WC=`DNA-mapping -i PE_input -o output .ci_stuff/organism.yaml --snakemakeOptions if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 1402 ]; then exit 1 ; fi #allelic WC=`DNA-mapping -m allelic-mapping -i PE_input -o output --snakemakeOptions " --dryrun --conda-prefix /tmp" --VCFfile allelic_input/file.vcf.gz --strains strain1,strain2 .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l` -if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2457 ]; then exit 1 ; fi +if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2466 ]; then exit 1 ; fi WC=`DNA-mapping -m allelic-mapping -i PE_input -o output --snakemakeOptions " --dryrun --conda-prefix /tmp" --SNPfile allelic_input/snpfile.txt --NMaskedIndex allelic_input/Ngenome .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l` -if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2436 ]; then exit 1 ; fi +if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2445 ]; then exit 1 ; fi WC=`DNA-mapping -m allelic-mapping -i PE_input -o output --snakemakeOptions " --dryrun --conda-prefix /tmp" --VCFfile allelic_input/file.vcf.gz --strains strain1 .ci_stuff/organism.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l` -if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2457 ]; then exit 1 ; fi +if [ ${PIPESTATUS[0]} -ne 0 ] || [ $WC -ne 2466 ]; then exit 1 ; fi # ChIP-seq WC=`ChIP-seq -d BAM_input --snakemakeOptions " --dryrun --conda-prefix /tmp" .ci_stuff/organism.yaml .ci_stuff/ChIP.sample_config.yaml | tee >(cat 1>&2) | grep -v "conda installation\|Conda environment" | sed '/^\s*$/d' | wc -l` diff --git a/snakePipes/shared/rules/Bowtie2_allelic.snakefile b/snakePipes/shared/rules/Bowtie2_allelic.snakefile index 12854c3cd..97756d09b 100755 --- a/snakePipes/shared/rules/Bowtie2_allelic.snakefile +++ b/snakePipes/shared/rules/Bowtie2_allelic.snakefile @@ -17,7 +17,7 @@ if aligner == "Bowtie2": index = bowtie2_index_allelic output: align_summary = aligner+"/{sample}.Bowtie2_summary.txt", - bam = aligner+"/{sample}.sorted.bam" + bam = temp(aligner+"/{sample}.sorted.bam") log: "Bowtie2/logs/{sample}.sort.log" params: alignerOpts = str(alignerOpts or ''), @@ -51,7 +51,7 @@ if aligner == "Bowtie2": index = bowtie2_index_allelic output: align_summary = aligner+"/{sample}.Bowtie2_summary.txt", - bam = aligner+"/{sample}.sorted.bam" + bam = temp(aligner+"/{sample}.sorted.bam") log: "Bowtie2/logs/{sample}.sort.log" params: alignerOpts = str(alignerOpts or ''),