MissingRule Exception in Snakemake

Viewed 544

I am new to snakemake workflow management and I'm struggling to grasp how the wildcards input works. I tried to do QC of some SRR data but the snakemake is giving the "MissingRuleException error".

my config file(config.yaml) contain the content:

samples: sample.csv

path: /Users/path/Bioinformatics/srr_practice

sample.csv is

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

Error Building DAG of jobs... MissingRuleException: No rule to produce Snakefile (if you use input functions make sure that they don't raise unexpected exceptions).

1 Answers

By issues command snakemake -np Snakefile you are asking snakemake to produce Snakefile, and it doesn't know how to do it.

If your file is named Snakefile, there is no need to specify its name, if it has a different name then you can specify it using -s option. So right now, running snakemake -n should be sufficient to show you what snakemake would run.

Related