我知道collect()
当我们运行一个将两个通道作为输入的过程时,我们必须使用,其中第一个通道有一个元素,然后第二个通道有 > 1 个元素:
#! /usr/bin/env nextflow
nextflow.enable.dsl=2
process A {
input:
val(input1)
output:
path 'index.txt', emit: foo
script:
"""
echo 'This is an index' > index.txt
"""
}
process B {
input:
val(input1)
path(input2)
output:
path("${input1}.txt")
script:
"""
cat <(echo ${input1}) ${input2} > \"${input1}.txt\"
"""
}
workflow {
A( Channel.from( 'A' ) )
// This would only run for one element of the first channel:
B( Channel.from( 1, 2, 3 ), A.out.foo )
// and this for all of them as intended:
B( Channel.from( 1, 2, 3 ), A.out.foo.collect() )
}
现在的问题是:为什么 nextflow-io ( https://github.com/nextflow-io/rnaseq-nf/blob/master/modules/rnaseq.nf#L15 ) 的示例工作流中的这一行可以在不使用collect()
or的情况下工作toList()
?
同样的情况,一个元素(索引)的通道和一个大于 1 的通道(fastq 对)应该被同一个进程(quant)使用,并且它在所有 fastq 文件上运行。与我的虚拟示例相比,我缺少什么?