Is there a way to reuse a rule in snakemake changing only the params
?
For instance:
rule job1:
...
params:
reference = "path/to/ref1"
...
rule job2:
input: rules.job1.output
...
params:
reference = "path/to/ref2"
job1
and job2
rules are doing the same stuff, but I need to call them successively and the reference
parameter has to be modified. It generates lot's of code for a very similar task.
I tried to make a sub-workflow for this step, and the main Snakefile is more readable. However, the sub-workflow code still repeated.
Any idea or suggestion? Did I miss something?
EDIT
To be more specific, job2 has to be executed after job1, using the output of the latter.