snakemake 只运行第一条规则而不是全部

snakemake only runs the first rule not all

我的 snakefile 看起来像这样。

rule do00_download_step01_download_:
    input:
        
    output:
        "data/00_download/scores.pqt"
    run:
        from lib.do00_download import do00_download_step01_download_
        do00_download_step01_download_()
rule do00_download_step02_get_the_mean_:
    input:
        "data/00_download/scores.pqt"
    output:
        "data/00_download/cleaned.pqt"
    run:
        from lib.do00_download import do00_download_step02_get_the_mean_
        do00_download_step02_get_the_mean_()
rule do01_corr_step01_correlate:
    input:
        "data/00_download/cleaned.pqt"
    output:
        "data/01_corr/corr.pqt"
    run:
        from lib.do01_corr import do01_corr_step01_correlate
        do01_corr_step01_correlate()
rule do95_plot_step01_correlations:
    input:
        "data/01_corr/corr.pqt"
    output:
        "plot/heatmap.png"
    run:
        from lib.do95_plot import do95_plot_step01_correlations
        do95_plot_step01_correlations()
rule do95_plot_step02_plot_dist:
    input:
        "data/00_download/cleaned.pqt"
    output:
        "plot/dist.png"
    run:
        from lib.do95_plot import do95_plot_step02_plot_dist
        do95_plot_step02_plot_dist()
rule do99_figures_step01_make_figure:
    input:
        "plot/dist.png"
        "plot/heatmap.png"
    output:
        "figs/fig01.svg"
    run:
        from lib.do99_figures import do99_figures_step01_make_figure
        do99_figures_step01_make_figure()
rule all:
    input:
        "figs/fig01.svg"

我按顺序安排了规则,希望这将确保所有步骤都按顺序 运行。但是,当我 运行 snakemake 时,它只是 运行 第一个规则然后退出。

我已经单独检查了所有步骤(我导入的函数)是否运行良好,输入和输出文件的路径。一切看起来都很好。所以我猜问题出在我如何格式化蛇文件。我是 snakemake(初学者级别)的新手。所以如果有人指出我应该如何解决这个问题,那将非常有帮助。

这是预期的行为。这是 the docs 的相关部分:

Moreover, if no target is given at the command line, Snakemake will define the first rule of the Snakefile as the target. Hence, it is best practice to have a rule all at the top of the workflow which has all typically desired target files as input files. The output of the first rule is assumed to be the target.

如果将 rule all: 移动到 Snakefile 的顶部,它应该会按预期工作。