3

I am trying to use a different directory for logs of a snakemake workflow run on a cluster. Therefore, my cluster.yaml file looks like:

__default__:
    time: 5:00:00
    threads: 5
    vmem: 10G
    #stderr: logs/snakejob.{rule}.{wildcards.sample}.{jobid}.err
    stdout: logs/snakejob.{rule}.{wildcards.sample}.{jobid}.out

# custom parameters for each rule

However, this configuration yields this error:

NameError: The name 'jobid' is unknown in this context. Please make sure that you defined that variable. Also note that braces not used for variable access have to be escaped by repeating them, i.e. {{print $1}}

Since I'd like to keep the jobid in the stdout file (like in the default value), how can I access it?

Many thanks,

Domenico

1 Answers1

0

I am assuming you are referring to job ID provided by cluster's job scheduler. For LSF, job id can be obtained using %J and for SLURM, it is %j. So your config for LSF would be:

stdout: logs/snakejob.{rule}.{wildcards.sample}.%J.out
Manavalan Gajapathy
  • 3,900
  • 2
  • 20
  • 43