cluster-computinghpcsnakemakeqsub

snakemake: Run some tasks on cluster and some locally


I'm using snakemake to orchestrate an analysis pipeline. Some tasks are very small (e.g. create some symlinks) while others take hours. Is there a way to use --cluster for some of them but execute others just locally?


Solution

  • localrules does just this. When the example below is run with --cluster, bar jobs are run in cluster and foo jobs are run locally.

    localrules: foo
    
    rule foo:
        ...
    
    rule bar:
        ...