You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Snakemake >=8版本如何在Slurm集群上运行?

在Snakemake 8中运行Slurm集群工作流的解决方案

方案1:使用官方Slurm专属执行器插件

Snakemake 8将集群执行逻辑拆分为独立插件,针对Slurm有专门的snakemake-executor-slurm插件,可正常通过pip/conda安装:

  1. 安装插件

    • 使用pip:
      pip install snakemake-executor-slurm
      
    • 使用conda/mamba(推荐生物信息学环境):
      mamba install -c bioconda snakemake-executor-slurm
      
  2. 运行工作流
    基础命令示例(替换为你的Slurm队列、资源参数):

    snakemake --cores 10 --executor slurm --slurm-submit-cmd "sbatch --partition=your_queue --mem=8G --cpus-per-task=4"
    

    更灵活的方式是在Snakefile的规则中定义Slurm资源,避免每次命令行输入:

    rule your_rule:
        input: "input.txt"
        output: "output.txt"
        resources:
            slurm_partition="your_queue",
            slurm_mem="8G",
            slurm_cpus_per_task=4
        shell: "your_command {input} {output}"
    

    此时只需执行:

    snakemake --cores 10 --executor slurm
    

方案2:降级到Snakemake 7.x版本

如果不想折腾插件,可降级到仍支持--cluster参数的Snakemake 7.x稳定版:

  1. 降级安装

    • pip:
      pip install snakemake==7.32.4
      
    • conda/mamba:
      mamba install -c bioconda snakemake=7.32.4
      
  2. 使用原集群命令
    按之前熟悉的方式运行:

    snakemake --cores 10 --cluster "sbatch --partition=your_queue --mem=8G"
    

补充说明

你提到的snakemake-executor-cluster-generic插件目前尚未正式发布到PyPI和conda公共通道,属于开发阶段的组件,因此无法通过常规包管理工具安装,官方当前更推荐使用Slurm专属执行器插件。

内容的提问来源于stack exchange,提问作者Sergio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 03:11:00