Snakemake appears to traverse the DAG in a breadth-first manner. Is it possible (e.g. through an option / flag / etc.) to force snakemake to traverse the DAG depth-first?
Snakemake appears to traverse the DAG in a breadth-first manner. Is it possible (e.g. through an option / flag / etc.) to force snakemake to traverse the DAG depth-first?
One way I can come up with is by setting priorities for each rule:
rule all:
input:
["third_a.txt", "third_b.txt", "third_c.txt"]
rule first:
output:
touch("first_{sample}.txt")
priority: 1
rule second:
input:
rules.first.output
output:
touch("second_{sample}.txt")
priority: 2
rule third:
input:
rules.second.output
output:
touch("third_{sample}.txt")
priority: 3
and if you now run it with snakemake -j 1 it is executed depth-first!