首页 > 解决方案 > Nextflow 具有不同文件数量的多个输入

问题描述

我正在尝试输入两个频道。但是,seacr_res_ch2 有 4 个文件,bigwig_ch3 有 5 个文件,其中包含一个控件和 4 个样本。所以我试图运行以下过程来计算峰值中心。当我运行这个过程时,我得到了这个错误:在寻找匹配的 `"' 时出现意外 EOF

process compute_matrix_peak_center {

    input:
    set val(sample_id), file(seacr_bed) from seacr_res_ch2
    set val(sample_id), file(bigwig) from bigwig_ch3

    output:
    set val(sample_id), file("${sample_id}.peak_centered.mat.gz") into peak_center_ch

    script:
    """

    "computeMatrix reference-point \
        -S ${bigwig} \
        -R ${seacr_bed} \
        -a 1000 \
        -b 1000 \
        -o ${sample_id}.peak_centered.mat.gz \
        --referencePoint center \
        -p 10

    """
}

标签: nextflow

解决方案


您的输入块声明了两次名为sample_id. 如果值来自两个(或更多)通道,则无法保证这些值相同。一个值将简单地破坏其他值。您需要先加入()这些频道:

input:
set val(sample_id), file(seacr_bed), file(bigwig) from seacr_res_ch2.join(bigwig_ch3)

推荐阅读