-
Couldn't load subscription status.
- Fork 201
fix: Support both reference.dict and reference.fasta.dict in GRIDSS wrappers #4426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
7701822
2819e1c
6605296
dc3b3ef
56c2d5f
45f598b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,12 +31,10 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+34
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+34
to
38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Support both reference.fa.dict and reference.dict (and an explicit input) to avoid regressions The current check only accepts reference + ".dict". That breaks setups that still produce reference.dict, which this PR aims to support. Recommend trying both naming conventions and, if present, honoring an explicit snakemake.input.dictionary (aligning with call/preprocess wrappers). Apply this diff to make the check robust and backward-compatible: -dictionary = reference + ".dict"
-if not path.exists(dictionary):
- raise ValueError(
- f"{dictionary} missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard."
- )
+dictionary = snakemake.input.get("dictionary")
+if dictionary:
+ if not path.exists(dictionary):
+ raise ValueError(
+ f"{dictionary} missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard."
+ )
+else:
+ candidates = [f"{reference}.dict", f"{path.splitext(reference)[0]}.dict"]
+ if not any(path.exists(d) for d in candidates):
+ raise ValueError(
+ "Reference dictionary not found. Looked for: {}. Please create it (e.g., with Picard CreateSequenceDictionary).".format(
+ ", ".join(candidates)
+ )
+ )📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shell( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -45,6 +43,6 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--threads {snakemake.threads} " # Threads | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--workingdir {snakemake.params.workingdir} " # Working directory | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "--assembly {snakemake.output.assembly} " # Assembly output | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "{snakemake.input.bams} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "{snakemake.input.bam} " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "{extra}) {log}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,12 +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=dictionary | ||||||||||||||||
| ) | ||||||||||||||||
| f"{dictionary} missing. Please make sure the reference dictionary was properly created. This can be accomplished for example by CreateSequenceDictionary.jar from Picard." | ||||||||||||||||
|
Comment on lines
+34
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| shell( | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,12 +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 | ||||||||||||||||
| ) | ||||||||||||||||
| 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." | ||||||||||||||||
|
Comment on lines
+34
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| shell( | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.