Snakemake 中的 MissingRule 异常

MissingRule Exception in Snakemake

我是 snakemake 工作流管理的新手,我很难理解通配符输入的工作原理。我尝试对一些 SRR 数据进行质量控制,但 snakemake 给出了“MissingRuleException 错误”。

我的配置文件(config.yaml)包含内容:

样本:sample.csv

路径:/Users/path/Bioinformatics/srr_practice

sample.csv 是

sample_name,fq1

A,SRR11412215

B,SRR11412216

C,SRR11412217

D,SRR11412218

E,SRR11412219

Snakefile

import os
import pandas as pd

configfile:"config.yaml"

samples=pd.read_csv(config["samples"], sep=",").set_index("sample_name", drop=False)


def get_fastq(wildcards):

        units=samples.loc[wildcards.sample]
fq=units["fq1"]
        return expand(os.path.join(config["path"], "{fq}.fastq.gz"), fq=fq)

rule all:

    input:

        expand(os.path.join(config["path"], "fastq_output/{sample}.fastqc.html"),sample=samples["fq1"].to_list()),
        expand(os.path.join(config["path"], "fastq_output/{sample}_fastqc.zip"), sample=samples["fq1"].to_list())

rule fastq:

    input:

            get_fastq,
    output:

            zip=os.path.join(config["path"], "fastq_output/{wildcards.sample_name}_fastqc.zip"),
                html=os.path.join(config["path"], "fastq_output/{wildcards.sample_name}_fastqc.html")

    wrapper:
            "0.78.0/bio/fastqc"

snakemake -np Snakefile

错误 构建作业的 DAG... 缺少规则异常: 没有生成 Snakefile 的规则(如果您使用输入函数,请确保它们不会引发意外异常)。

通过发出命令 snakemake -np Snakefile,您要求 snakemake 生成 Snakefile,但它不知道该怎么做。

如果您的文件名为 Snakefile,则无需指定其名称,如果它有不同的名称,则您可以使用 -s 选项指定。所以现在,运行ning snakemake -n 应该足以向您展示 snakemake 会 运行.