Using regex in snakemake wildcards

772 views Asked by At

I'm using regex in snakemake wildcards but I've come accross an error that I don't understand.

In this shortened example it works:

rule graphviz:
    input: "{graph}.dot"
    output: "{graph}.{ext,(pdf|png)}"
    shell: "dot -T{wildcards.ext} -o {output} {input}"

In this example, it doesn't:

## This is working
rule fastqc:
    input: "{reads}.fastq"
    output: "{reads}_fastqc/{sample}_fastqc.html"
    shell:"fastqc --format fastq {input}"

## This is not working
rule fastqc:
    input: "{reads}.{ext,(bam|fastq)}"
    output: "{reads}_fastqc/{sample}_fastqc.html"
    shell:"fastqc --format {wildcards.ext} {input}"

I'm attaching a screencap of the error message I'm getting. Thanks for your help.

Here is a screencap of the error message.

0

There are 0 answers