Hello,
I am trying to load some files from a config file in snakemake. I'm using snakemake 7.22 on MacOS Monterey with M1 chip. My config file is:
files:
A: file1.txt
B: file2.txt
My Snakemake file is:
configfile: "config.yaml"
rule all:
input:
expand("{file}", file=config["files"])
output:
"summary.txt"
shell:
"ls {input} > {output}"
When running with:
snakemake --cores 1
I get:
MissingInputException in rule all in file projects/data-science/test/Snakefile, line 3:
Missing input files for rule all:
output: summary.txt
affected files:
B
A
The keys of the config dictionary appear to be used instead of the values. I was working based on the example in the Snakemake tutorial:
https://snakemake.readthedocs.io/en/v7.22.0/tutorial/advanced.html#step-2-config-files
I can't see how my example differs from the example in the docs. I should point out that I am aware that the problem can be solved by changing the config file to:
files:
- file1.txt
- file2.txt
However, I'm curious why the dictionary approach is not working for me. Any help would be appreciated.
in config.yaml, file A and B must be exists,
Thanks, file1.txt and file2.txt exist. In the linked example in the tutorial (https://snakemake.readthedocs.io/en/v7.22.0/tutorial/advanced.html#step-2-config-files), it appears that the value of the dictionary is used instead of the keys. Am I missing something with the difference between my example and the example in the docs?
your snakemake file change like this: