英文:
execute a rule that the wildcard is obtained via the params in the rule
问题
我有一个包含通配符的规则,通配符是从参数中获取的(由函数决定)。是否可以通过名称调用这个单个规则,例如,通过调用 snakemake a 来运行它?
rule a:
input: file1, file2
output: directory(1), directory("2/{domain}.txt")
params:
domain_cat = lambda wc, input: pd.read_csv(input[1], index_col=0).loc[wc.domain, "cat"]
shell:
"""
example.py {input} {output} {params.domain_cat}
"""
英文:
I have a rule that contains a wildcard that is taken from the params (decided by a function). Is it possible to run this single rule by calling it by name, e.g., snakemake a
rule a:
input: file1, file2
output: directory(1), directory("2/{domain}.txt")
params:
domain_cat = lambda wc, input: pd.read_csv(input[1], index_col=0).loc[wc.domain, "cat"]
shell:
"""
example.py {input} {output} {params.domain_cat}"
"""
答案1
得分: 1
如果规则包含通配符,就不能再通过名称调用它来运行。snakemake
需要知道通配符的值,这通过文件名传递。
英文:
No. If a rule contains a wildcard, you can no longer run it by calling it by name. snakemake
needs to know the value for the wildcard, which is passed through the filename.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论