I'm trying to first generate 4 files, for the LETTERS x NUMS combinations, then summarize over the NUMS to obtain one file per element in LETTERS:
LETTERS = ["A", "B"]
NUMS = ["1", "2"]
rule all:
input:
expand("combined_{letter}.txt", letter=LETTERS)
rule generate_text:
output:
"text_{letter}_{num}.txt"
shell:
"""
echo "test" > {output}
"""
rule combine text:
input:
expand("text_{letter}_{num}.txt", num=NUMS)
output:
"combined_{letter}.txt"
shell:
"""
cat {input} > {output}
"""
Executing this snakefile results in the following error:
WildcardError in line 19 of /tmp/Snakefile:
No values given for wildcard 'letter'.
File "/tmp/Snakefile", line 19, in <module>
It seems that partial expand
is not possible. Is it a limitation of expand
? If so, how should I circumvent it ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…