这个问题在这里已有答案:
是否可以使用带通配符的snakemake并展开:
rule a:
input:
"input/{first}.txt",
expand("data/{second}.txt", second=A_LIST)
output:
expand("output/{first}_{second}, second=A_LIST)
如果您的模式同时包含通配符和变量,请使用双括号作为通配符。例如,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}"