-
Notifications
You must be signed in to change notification settings - Fork 634
Description
Snakemake version
9.11.5 (bug was introduced in 9.11.4)
Describe the bug
When loading an external workflow as module and importing all of its rule using the use rule * as ... directive, redefining rules of the module results in workflow errors. More specifically, it appears that some recursively referenced rules are not in scope anymore and snakemake complains about certain rules not being defined. It is sufficient to use a dry-run to trigger this bug.
The error occurred in a large workflow and I have not narrowed it down to the core of conflicting rules or definitions. The offending rule of the error (star_align) is not contained in the imported workflow but rather in a snakemake wrapper that is referenced by the imported workflow. In line 45, star_align is referenced but supposedly not found by snakemake, even though the rule is defined above in line 18.
Logs
workspace/workflows/dna-seq-module via 🅒 sm took 6s
❯ snakemake -np calling_all -c1
No validator found for JSON Schema version identifier 'http://json-schema.org/draft-07/schema#'
Defaulting to validator for JSON Schema version 'https://json-schema.org/draft/2020-12/schema'
Note that schema file may not be validated correctly.
No validator found for JSON Schema version identifier 'http://json-schema.org/draft-04/schema#'
Defaulting to validator for JSON Schema version 'https://json-schema.org/draft/2020-12/schema'
Note that schema file may not be validated correctly.
No validator found for JSON Schema version identifier 'http://json-schema.org/draft-07/schema#'
Defaulting to validator for JSON Schema version 'https://json-schema.org/draft/2020-12/schema'
Note that schema file may not be validated correctly.
No validator found for JSON Schema version identifier 'http://json-schema.org/draft-04/schema#'
Defaulting to validator for JSON Schema version 'https://json-schema.org/draft/2020-12/schema'
Note that schema file may not be validated correctly.
WorkflowError in file "https://github.com/snakemake/snakemake-wrappers/raw/v3.13.3/meta/bio/star_arriba/test/Snakefile", line 45:
Rule star_align is not defined in this workflow. Available rules:
File "https://raw.githubusercontent.com/snakemake-workflows/dna-seq-varlociraptor/v5.16.0/workflow/Snakefile", line 43, in <module>
File "https://raw.githubusercontent.com/snakemake-workflows/dna-seq-varlociraptor/v5.16.0/workflow/rules/fusion_calling.smk", line 8, in <module>
File "https://github.com/snakemake/snakemake-wrappers/raw/v3.13.3/meta/bio/star_arriba/test/Snakefile", line 45, in <module>
Minimal example
I attached a small workflow that references the dna-seq-varlociraptor workflow, contains two dummy files that are registered in the config file, and makes a trivial change to one of the imported rules.
Steps to reproduce the error:
- Unpack the archive into some directory
- Create a conda environment with snakemake v9.11.4 or higher (or use other means to run the latest snakemake version)
- Next to the contained Snakefile, call
snakemake -np calling_all -c1
Additional context
The bug seems to be introduced in v9.11.4, as it does not occur in v9.11.3. The error does not occur when removing the rule re-definition (use rule delly from dna_seq_varlociraptor as calling_delly with:) in the Snakefile.