Snakemake一个通配符也扩展

时间:2017-12-18 16:36:44

标签: snakemake

是否可以使用带有通配符的snakemake并展开:

rule a:
    input:
        "input/{first}.txt",
        expand("data/{second}.txt", second=A_LIST)
    output:
        expand("output/{first}_{second}, second=A_LIST)

1 个答案:

答案 0 :(得分:2)

如果您的模式同时包含通配符和变量,则使用双括号表示通配符。例如,expand("output/{{first}}_{second}", second=A_LIST)

A_LIST = ['1', '2']

rule all:
    input:
        expand("output/abc_{second}", second=A_LIST)

rule a:
    input:
        "input/{first}.txt",
        expand("data/{second}.txt", second=A_LIST)
    output:
        expand("output/{{first}}_{second}", second=A_LIST)
    shell:
        "touch {output}"