如何使用 Snakemake 的命令行配置选项传递列表或字典

How to pass a list or dictionary using Snakemake's command line config option

我想使用 --config CLI 选项传递文件名列表以通过我的 Snakemake 工作流程生成。我需要什么语法?

只需在命令行中以python语法指定列表:

snakemake -n --config files=['file1.txt','file2.csv']

然后您可以在示例 Snakemake 规则中访问此列表,如下所示:

rule all:
    input: expand({filename},filename=config['files'])