Snakemake: Tranverse DAG đầu tiên?

Oct 02 2020

Snakemake dường như đi ngang qua DAG theo cách trên hết. Có thể (ví dụ: thông qua một tùy chọn / cờ / v.v.) để buộc rắn thực hiện đi qua độ sâu DAG đầu tiên không?

Trả lời

2 Maarten-vd-Sande Oct 03 2020 at 14:51

Một cách tôi có thể nghĩ ra là đặt mức độ ưu tiên cho từng quy tắc:

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

và nếu bây giờ bạn chạy nó với snakemake -j 1nó, thì độ sâu được thực thi trước tiên!