Snakemake logging error
1
1
Entering edit mode
4.9 years ago
camerond ▴ 190

I'm building a Snakefile and getting an error I'm struggling to fix when trying to add the log parameter in my homer annotation rule.

Here is the Snakefile:

threshold="25 33 5 66 75".split()

rule all:
    input:
        expand("homer_files/annotation_files/ATAC24to31_fetal_hMG_consensusPeak.{THRESH}.homerann.txt", THRESH=threshold),

rule homer_annotation:
    input:
        "diffbind_files/ATAC24_31_fetalMG_.{THRESH}peakset.bed"
    output:
        "homer_files/annotation_files/ATAC24to31_fetal_hMG_consensusPeak.{THRESH}.homerann.txt"
    log:
            "logs/homer/annotation.ATAC24to31_fetal_hMG.consensusPeak.(THRESH}.log"
    shell:
        "annotatePeaks.pl {input} hg19 > {output}"

Now when I run this without the log parameter I get 5 separate files created as expected, however if I try to include it, I get the following error:

SyntaxError:
Not all output, log and benchmark files of rule homer_annotation contain the same wildcards. This is crucial though, in order to avoid that two or more jobs write to the same file.
  File "/c8000xd3/big-c1477909/foetal_hMG_analysis/ATAC_24to31_foetal_hMG_May19/Snakefile", line 26, in <module>

I'm not sure what is going on here, and have never came across this before when running very similar rules. The way I'm reading this, a separate log file should be created for each iteration of the rule, but the error would suggest otherwise.

Any ideas on how to remedy this would be greatly appreciated.

I'm using Snakemake 5.2.2.

snakemake log • 2.8k views
ADD COMMENT
3
Entering edit mode
4.9 years ago
camerond ▴ 190

It was a typo in the braces!

log:
    "logs/homer/annotation.ATAC24to31_fetal_hMG.consensusPeak.(THRESH}.log"
ADD COMMENT
0
Entering edit mode

Thanks for following up and sharing the solution :)

ADD REPLY

Login before adding your answer.

Traffic: 2610 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