Snakemake Error (incorrect wildcard use)
0
0
Entering edit mode
4.7 years ago

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. https://snakemake.readthedocs.io/en/stable/tutorial/basics.html#step-2-generalizing-the-read-mapping-rule 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)
    shell:"""
            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 • 2.8k views
ADD COMMENT
2
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1766 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6