Reputation: 7819
How can I programmatically refer to attributes of another Snakemake rule? What do I need to replace <whatever is in test1's input>
with, for this to work?
rule test1:
input: 'a.txt'
rule test2:
output: <whatever is in test1's input> <---- ?
shell: 'touch {output}'
Upvotes: 2
Views: 475
Reputation: 7819
Other rules can be referred to by rules.<rule_name>
as explained in the documentation. However, the rule that's referenced needs to come first, that is be defined above the rule that's referencing:
rule test1:
input: 'a.txt'
rule test2:
output: rules.test1.input <---
shell: 'touch {output}'
Upvotes: 1