Snakemake version
> snakemake --version
9.11.2
Describe the bug
When procedurally generating rules the rules are registered in the Rules object with numbers as name and not with the defined names and cannot easily be referenced, e.g. in dependencies
Logs
> snakemake --cores=1
Registered rules: dict_keys(['1', '2'])
WorkflowError in file "/tmp/bug/Snakefile", line 15:
Rule run_task1 is not defined in this workflow. Available rules: 1, 2
Minimal example
tasks = ["task1", "task2"]
for task in tasks:
rule:
name: f"run_{task}"
output:
"{task}.txt"
shell:
"touch {output}"
print("Registered rules: " + str(rules._rules.keys()))
rule run:
input:
rules.run_task1.output
shell:
"cat {input}"
Additional context