Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use special symbols in Snakemake parameter section

I have created the following snakemake rule:

rule cutadapt:
    input:
        input
    output:
        output
    log:
        logs
    params:
        "-a 'A{100}' --nextseq-trim=20 -m 20"
    wrapper:
        "0.50.4/bio/cutadapt/se"

and I get the following error message:

Wildcards in params cannot be determined from output files.

Snakemake realizes -a 'A{100}' as a Wildcard due to the {}. I tried to escape the {} by -a 'A{{100}}' but it produces the same error.

Is there any chance to escape the parameter section in a snakemake rule?

Thanks

like image 231
pat2402 Avatar asked Oct 16 '25 15:10

pat2402


1 Answers

It appears the fix is a bit ugly (see issue https://bitbucket.org/snakemake/snakemake/issues/584/unable-to-escape-curly-braces-in-params) - I don't know if a better solution has been implemented.

Basically, use a dummy lambda function:

lambda wc: "-a 'A{100}' --nextseq-trim=20 -m 20"
like image 142
dariober Avatar answered Oct 19 '25 15:10

dariober



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!