Question: Snakemake logging error
1
gravatar for camerond
25 days ago by
camerond70
camerond70 wrote:

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 • 94 views
ADD COMMENTlink modified 25 days ago • written 25 days ago by camerond70
3
gravatar for camerond
25 days ago by
camerond70
camerond70 wrote:

It was a typo in the braces!

log:
    "logs/homer/annotation.ATAC24to31_fetal_hMG.consensusPeak.(THRESH}.log"
ADD COMMENTlink written 25 days ago by camerond70

Thanks for following up and sharing the solution :)

ADD REPLYlink written 25 days ago by ATpoint17k
Please log in to add an answer.

Help
Access

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