snakemake
snakemake copied to clipboard
Using wildcards or params in the wrapper identifier
Snakemake version 8.6.0
Describe the bug From the documentation: "It is possible to refer to wildcards and params in the wrapper identifier, e.g. by specifying "0.0.8/bio/{params.wrapper}" or "0.0.8/bio/{wildcards.wrapper}"."
However, this does not seem to be the case. I tried with a direct wildcard (e.g. {value}), {wildcards.value} and {params.wrapper} (having a parameter named wrapper) without success. The pipeline+wrapper work just fine when using a hardcoded string for the wrapper identifier.
Logs
Minimal example
When using the wildcard directly the --dry-run executes fine, but the real execution fails with:
wrapper:
"file:wrappers/tool/{value}/task/"
RuleException:
WorkflowError in file test_wrapper.snk, line 24:
Unable to locate wrapper script for wrapper file:wrappers/tool/{value}/task/. This can be a network issue or a mistake in the wrapper URL.
When trying to access {wildcards.value} or {params.wrapper} it fails already in the --dry-run:
params:
wrapper="1.0.0"
wrapper:
"file:wrappers/tool/{params.wrapper}/task/"
WorkflowError:
Failed to open source file wrappers/tool/{params.wrapper}/task/environment.yaml
FileNotFoundError: [Errno 2] No such file or directory: 'wrappers/tool/{params.wrapper}/task/environment.yaml'
Additional context
I'm having the same problem with 8.16.0. It's a documented feature but it doesn't work you can't actually specify e.g. {params.wrapper} or {wildcards.wrapper} in the wrapper directive!