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

Nextflow输出tuple时报sampleId变量不存在问题求助

问题原因

你遇到的报错是因为Nextflow的output块中,tuple内的值类型元素需要显式用val()修饰符声明,否则Nextflow会默认将其识别为待匹配的输出文件名称,而无法关联到输入声明的sampleId变量。你单独输出sampleId时应该是显式加了val()修饰符所以可以正常运行,单独输出路径时不需要处理值变量所以也不会触发报错。

修复方案

仅需修改output行,给sampleId加上val()修饰符即可,修改后完整代码如下:

process 'rsem_quant' {

  input:
      val genome from params.genome 
      tuple val(sampleId), file(read1), file(read2) from samples_ch

  output:
    tuple val(sampleId), path("${sampleId}.genes.results") into rsem_ce 

  script:
    """
    module load RSEM
    rsem-calculate-expression --star --keep-intermediate-files \
    --sort-bam-by-coordinate  --star-output-genome-bam --strandedness reverse \
    --star-gzipped-read-file --paired-end $genome \
    $read1 $read2 $sampleId
    """
}

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.30 13:15:01