通配符/正则表达式在 snakemake 中不起作用?

Wildcard / regular expression not working in snakemake?

我是 snakemake 的初学者。我试图了解如何使用变量和正则表达式。我已尝试按照教程进行操作,但...我仍然需要帮助。在下面的示例中,我希望我的代码执行的操作是 "run this, for files in directory 'data' that are named gene_dna and have any extension"。 我想了解为什么这段代码不起作用:

rule test:
    input:
        "data/gene_dna.{.+}"
    output:
        "test.txt"
    shell:
        "echo 1 > {output}"

...但是这个确实如此(至少在干燥期间 - 运行)。区别在于“.txt”。相反,如果 {.+}:

rule test:
    input:
        "data/gene_dna.txt"
    output:
        "test.txt"
    shell:
        "echo 1 > {output}"

请帮忙?

file_pattern = "data/gene_dna.{ext}"
extensions = glob_wildcards(file_pattern).ext

rule all:
    input:
        expand("test.{ext}", ext=extensions)


rule test:
    input:
        "data/gene_dna.{ext}"
    output:
        "test.{ext}"
    shell:
        "echo 1 > {output}"