Snakemake 无法确定通配符

问题描述 投票:0回答:1

我不明白为什么 Snakemake 无法识别这个简单示例中的依赖关系。我期望它识别出

main
的输入是在
simulation
中生成的,最后一个输入是在
setup
中生成的。然而,看起来情况并非如此。这种“规则架构”的想法是在
simulation
级别并行。

root_path = 'a'
names = ['A', 'B', 'C']

rule main:
    input:
        "final.result"
    run:
        pass

rule setup:
    output:
        ABC = expand(root_path + "/{name}/prod.abc", name=names)
    run:
        pass

rule simulation:
    input:
        ABC = root_path + "/{name}/prod.abc"
    output:
        "final.result"
    run:
        pass
snakemake --dag

最后一条命令将返回:

Building DAG of jobs...
WildcardError in rule simulation in file /Users/klimt/test/Snakefile, line 19:
Wildcards in input files cannot be determined from output files:
'name'
snakemake
1个回答
0
投票

这会起作用:

root_path = 'a'
names = ['A', 'B', 'C']

rule all:
    input:
        "final.result"
    run:
        pass

rule setup:
    output:
        ABC = expand(root_path + "/{name}/prod.abc", name=names)
    run:
        pass

rule simulation:
    input:
        ABC = root_path + "/{name}/prod.abc"
    output:
        XYZ = root_path + "/{name}/prod.XYZ"
    run:
        pass

rule gather:
    input:
        XYZ = expand(root_path + "/{name}/prod.XYZ", name=names)
    output:
        "final.result"
    run:
        pass

在我最初的问题中,每个

simulation
实例都生成相同的输出
final.result
。添加
gather
规则后,各个结果将收集到
final.results
中。这将生成预期的 DAG。但是,我仍然没有收到我最初问题的打印错误。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.