From 77018223859171c255962ef4e546d861a6871b9e Mon Sep 17 00:00:00 2001 From: Christoph Ritzel Date: Tue, 19 Aug 2025 18:13:20 +0200 Subject: [PATCH 1/3] Support both reference.dict and reference.fasta.dict in GRIDSS wrappers Reference setup has changed to produce reference.fasta.dict instead of reference.dict. Here I have changed it to just check the existance of the given dictionary without asuming a fixed ending like .dict. --- bio/gridss/assemble/test/Snakefile | 4 ++-- .../test/reference/{genome.dict => genome.fasta.dict} | 0 bio/gridss/assemble/wrapper.py | 4 ++-- .../call/test/reference/{genome.dict => genome.fasta.dict} | 0 bio/gridss/call/wrapper.py | 4 ++-- .../test/reference/{genome.dict => genome.fasta.dict} | 0 bio/gridss/preprocess/wrapper.py | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) rename bio/gridss/assemble/test/reference/{genome.dict => genome.fasta.dict} (100%) rename bio/gridss/call/test/reference/{genome.dict => genome.fasta.dict} (100%) rename bio/gridss/preprocess/test/reference/{genome.dict => genome.fasta.dict} (100%) diff --git a/bio/gridss/assemble/test/Snakefile b/bio/gridss/assemble/test/Snakefile index 81e0b786a13..91942735f2c 100644 --- a/bio/gridss/assemble/test/Snakefile +++ b/bio/gridss/assemble/test/Snakefile @@ -33,8 +33,8 @@ reference_index_endings = (".amb",".ann", ".bwt", ".pac", ".sa", ".gridsscache", rule gridss_assemble: input: - bams=expand("mapped/{sample}.bam", sample=samples), - bais=expand("mapped/{sample}.bam.bai", sample=samples), + bam=expand("mapped/{sample}.bam", sample=samples), + bai=expand("mapped/{sample}.bam.bai", sample=samples), reference="reference/genome.fasta", dictionary="reference/genome.dict", indices=multiext("reference/genome.fasta", *reference_index_endings), diff --git a/bio/gridss/assemble/test/reference/genome.dict b/bio/gridss/assemble/test/reference/genome.fasta.dict similarity index 100% rename from bio/gridss/assemble/test/reference/genome.dict rename to bio/gridss/assemble/test/reference/genome.fasta.dict diff --git a/bio/gridss/assemble/wrapper.py b/bio/gridss/assemble/wrapper.py index be5002ac0b2..e2899bf40ee 100644 --- a/bio/gridss/assemble/wrapper.py +++ b/bio/gridss/assemble/wrapper.py @@ -31,7 +31,7 @@ ) ) -dictionary = path.splitext(reference)[0] + ".dict" +dictionary = reference + ".dict" if not path.exists(dictionary): raise ValueError( "{dictionary}.dict missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( @@ -45,6 +45,6 @@ "--threads {snakemake.threads} " # Threads "--workingdir {snakemake.params.workingdir} " # Working directory "--assembly {snakemake.output.assembly} " # Assembly output - "{snakemake.input.bams} " + "{snakemake.input.bam} " # changed to bam for consistancy "{extra}) {log}" ) diff --git a/bio/gridss/call/test/reference/genome.dict b/bio/gridss/call/test/reference/genome.fasta.dict similarity index 100% rename from bio/gridss/call/test/reference/genome.dict rename to bio/gridss/call/test/reference/genome.fasta.dict diff --git a/bio/gridss/call/wrapper.py b/bio/gridss/call/wrapper.py index b07ef205d66..b67e5a4c63a 100644 --- a/bio/gridss/call/wrapper.py +++ b/bio/gridss/call/wrapper.py @@ -31,10 +31,10 @@ ) ) -dictionary = path.splitext(reference)[0] + ".dict" +#dictionary = path.splitext(reference)[0] + ".dict" if not path.exists(dictionary): raise ValueError( - "{dictionary}.dict missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( + "{dictionary} missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( dictionary=dictionary ) ) diff --git a/bio/gridss/preprocess/test/reference/genome.dict b/bio/gridss/preprocess/test/reference/genome.fasta.dict similarity index 100% rename from bio/gridss/preprocess/test/reference/genome.dict rename to bio/gridss/preprocess/test/reference/genome.fasta.dict diff --git a/bio/gridss/preprocess/wrapper.py b/bio/gridss/preprocess/wrapper.py index e60cb5232f6..cf0b7324244 100644 --- a/bio/gridss/preprocess/wrapper.py +++ b/bio/gridss/preprocess/wrapper.py @@ -31,10 +31,10 @@ ) ) -dictionary = path.splitext(reference)[0] + ".dict" +# dictionary = path.splitext(reference)[0] + ".dict" --> leads to incorrect paths (reference.dict), which is incompatible with setup reference (reference.fa.dict) if not path.exists(dictionary): raise ValueError( - "{dictionary}.dict missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( + "Dictionary {dictionary} missing or wrong naming (reference.fa.dict). Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( dictionary=dictionary ) ) From 2819e1c1bc6e37ba7cf3f1a7bea3f67147c01377 Mon Sep 17 00:00:00 2001 From: "Filipe G. Vieira" <1151762+fgvieira@users.noreply.github.com> Date: Wed, 20 Aug 2025 09:05:09 +0200 Subject: [PATCH 2/3] Small tweaks --- bio/gridss/assemble/wrapper.py | 4 ++-- bio/gridss/preprocess/wrapper.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bio/gridss/assemble/wrapper.py b/bio/gridss/assemble/wrapper.py index e2899bf40ee..e31913b2a7f 100644 --- a/bio/gridss/assemble/wrapper.py +++ b/bio/gridss/assemble/wrapper.py @@ -34,7 +34,7 @@ dictionary = reference + ".dict" if not path.exists(dictionary): raise ValueError( - "{dictionary}.dict missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( + "{dictionary} missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( dictionary=dictionary ) ) @@ -45,6 +45,6 @@ "--threads {snakemake.threads} " # Threads "--workingdir {snakemake.params.workingdir} " # Working directory "--assembly {snakemake.output.assembly} " # Assembly output - "{snakemake.input.bam} " # changed to bam for consistancy + "{snakemake.input.bam} " "{extra}) {log}" ) diff --git a/bio/gridss/preprocess/wrapper.py b/bio/gridss/preprocess/wrapper.py index cf0b7324244..02decec1b3c 100644 --- a/bio/gridss/preprocess/wrapper.py +++ b/bio/gridss/preprocess/wrapper.py @@ -34,7 +34,7 @@ # dictionary = path.splitext(reference)[0] + ".dict" --> leads to incorrect paths (reference.dict), which is incompatible with setup reference (reference.fa.dict) if not path.exists(dictionary): raise ValueError( - "Dictionary {dictionary} missing or wrong naming (reference.fa.dict). Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( + "{dictionary} missing or wrong naming (reference.fa.dict). Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( dictionary=dictionary ) ) From 6605296c9c0bbe38c380db26783e5f6c041dc3d2 Mon Sep 17 00:00:00 2001 From: "Filipe G. Vieira" <1151762+fgvieira@users.noreply.github.com> Date: Wed, 20 Aug 2025 09:08:10 +0200 Subject: [PATCH 3/3] Use f-strings for readability --- bio/gridss/assemble/wrapper.py | 4 +--- bio/gridss/call/wrapper.py | 4 +--- bio/gridss/preprocess/wrapper.py | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bio/gridss/assemble/wrapper.py b/bio/gridss/assemble/wrapper.py index e31913b2a7f..5ae52f75e0b 100644 --- a/bio/gridss/assemble/wrapper.py +++ b/bio/gridss/assemble/wrapper.py @@ -34,9 +34,7 @@ dictionary = reference + ".dict" if not path.exists(dictionary): raise ValueError( - "{dictionary} missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( - dictionary=dictionary - ) + f"{dictionary} missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard." ) shell( diff --git a/bio/gridss/call/wrapper.py b/bio/gridss/call/wrapper.py index b67e5a4c63a..7b38ed22081 100644 --- a/bio/gridss/call/wrapper.py +++ b/bio/gridss/call/wrapper.py @@ -34,9 +34,7 @@ #dictionary = path.splitext(reference)[0] + ".dict" if not path.exists(dictionary): raise ValueError( - "{dictionary} missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( - dictionary=dictionary - ) + f"{dictionary} missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard." ) shell( diff --git a/bio/gridss/preprocess/wrapper.py b/bio/gridss/preprocess/wrapper.py index 02decec1b3c..7e944846c93 100644 --- a/bio/gridss/preprocess/wrapper.py +++ b/bio/gridss/preprocess/wrapper.py @@ -34,9 +34,7 @@ # dictionary = path.splitext(reference)[0] + ".dict" --> leads to incorrect paths (reference.dict), which is incompatible with setup reference (reference.fa.dict) if not path.exists(dictionary): raise ValueError( - "{dictionary} missing or wrong naming (reference.fa.dict). Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard".format( - dictionary=dictionary - ) + f"{dictionary} missing or wrong naming (reference.fa.dict). Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard." ) shell(