Question: Snakemake Error (incorrect wildcard use)
gravatar for timothy.delory
7 months ago by
timothy.delory10 wrote:

I am trying to run a simple snakemake rule for a basic bwa mem on several paired end reads. I am getting the error:

Target rules may not contain wildcards. Please specify concrete files or a rule without wildcards.

However, my rule inputs and outputs are structured much like the bwa example on the snakemake site. As I understand, you can have wildcards if they are filenames. I do have two file in my inputs, but I specify the different reads at the end of each of these files Here is my script

rule align:
    input: read1="/path/{sample}_R1_001.fastq",read2="path/{sample}_R2_002.fastq,genome=/path/genome.fa"
    output: bam = "/path/to/alignments/{sample}.bam"
    #the latest version of bwa (directory name was the date of installation)
            module load  bwa/2020_03_19
            bwa index -a is {input.genome}
            bwa mem -t 16 {input.genome} {input.read1} {input.read2}  > {output.bam}

I am not sure what I am doing wrong with respect to using the wildcards.

snakemake software error • 485 views
ADD COMMENTlink written 7 months ago by timothy.delory10

You need to have at least one rule (target rule) that does not produce any output, but takes as input all your expected output.

Snakemake will take that rule as first rule, and then checks which rules produce the input of the rule. Then it checks, which rules produce the inputs for those rules, etc.

For your case:

rule all:
  input: "/path/to/alignments/{sample}.bam"
ADD REPLYlink written 7 months ago by cschu1812.5k

in snakemake you provide a recipe for making a target, but then you have to actually ask for the target. You can even ask on the command line but it's preferable to set a target rule as cschu181 suggested.

ADD REPLYlink modified 7 months ago • written 7 months ago by Jeremy Leipzig19k

Thank you. This was helpful to me! I added in the expand option as well.

ADD REPLYlink written 7 months ago by timothy.delory10
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1909 users visited in the last hour