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

MacBook M1上用Nextflow+Docker运行Salmon索引任务报错求助

问题排查:Salmon索引生成失败(exit status 139/段错误)

环境与代码

Dockerfile

FROM --platform=linux/amd64 ubuntu:22.04
RUN apt-get update && apt-get install -y curl
RUN apt-get install -y python3 python3-pip
RUN curl -sSL https://github.com/COMBINE-lab/salmon/releases/download/v1.5.2/salmon-1.5.2_linux_x86_64.tar.gz | tar xz \
&& mv /salmon-*/bin/* /usr/bin/ \
&& mv /salmon-*/lib/* /usr/lib/

Nextflow流程脚本

#!/usr/bin/env nextflow
 
/*
 * The following pipeline parameters specify the reference genomes
 * and read pairs and can be provided as command line options
 */
params.reads = "/nextflow_training/data_subset/SRR11508672_{1,2}.fastq"
params.transcriptome = "/nextflow_training/data/Clownfish/A.percula_final.fasta"
params.outdir = "/nextflow_training/results"
 
workflow { 
    INDEX(params.transcriptome)
}
 
process INDEX {
    tag "$transcriptome.simpleName"
    publishDir params.outdir

    input:
    path transcriptome
 
    output:
    path 'index'
 
    script:
    """
    salmon index --threads 1 -t $transcriptome -i index
    """
}

错误信息

executor >  local (1)
[ee/e6b00e] process > INDEX (A) [100%] 1 of 1, failed: 1 ✘
ERROR ~ Error executing process > 'INDEX (A)'

Caused by:
  Process `INDEX (A)` terminated with an error exit status (139)

Command executed:

  salmon index --threads 1 -t A.percula_final.fasta -i index

Command exit status:
  139

Command output:
  Threads = 1
  Vertex length = 31
  Hash functions = 5
  ...

Command error:
  qemu: uncaught target signal 11 (Segmentation fault) - core dumped
  .command.sh: line 2:     8 Segmentation fault      salmon index --threads 1 -t A.percula_final.fasta -i index

Work dir:
  /Users/victorcat/nextflow_training/work/ee/e6b00e5bb93ce2f017c9e2242ea0f3

Tip: when you have fixed the problem you can continue the execution adding the option `-resume` to the run command line

 -- Check '.nextflow.log' file for details

排查与解决方案

  • 架构兼容性问题:当前Docker镜像指定linux/amd64架构,M1芯片为arm64架构,qemu模拟x86程序时易出现段错误。建议构建arm64版本镜像:

    1. 移除Dockerfile中的--platform=linux/amd64
    2. 替换Salmon下载链接为arm64版本:https://github.com/COMBINE-lab/salmon/releases/download/v1.5.2/salmon-1.5.2_linux_arm64.tar.gz
  • 内存不足:Salmon建索引对内存需求较高,尤其是大转录组文件。

    1. 在Nextflow的INDEX process中添加内存限制:memory '8GB'(可根据转录组大小调整)
    2. 关闭系统中其他高内存占用程序,确保有足够可用内存
  • 流程与文件校验:

    1. 在INDEX process中添加container '你的镜像名称:标签',确保Nextflow使用Docker容器执行该步骤
    2. 验证转录组文件完整性,使用md5sum检查文件是否损坏
    3. 尝试升级Salmon至最新稳定版本,新版本通常修复了更多架构兼容问题

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.03 15:53:10