Snakemake: specify cluster per rule

Question:

I am running a large workflow in snakemake, that employs cluster execution (–cluster qsub) and a custom profile (–profile custom) for execution in a user-specific computing environment. How can I specify which computing environment (cluster, profile or local) to use for every rule?

Otherwise, would it be possible to chain multiple sub-workflows with different execution options?

Asked By: newuser

||

Answers:

Specifying rules for local execution can be done via localrules:

The keyword localrules allows to mark a rule as local, so that it is not submitted to the cluster and instead executed on the host node

See docs.

localrules: all, foo

rule all:
    input: ...

rule foo:
    ...

rule bar:
    ...

AFAIK it’s not possible to specify a custom profile per individual rule.

Answered By: SultanOrazbayev
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.