Reputation: 218
i'm loading single end files into an align process in nextflow. I view the channel and it shows both files (there are only two files in my exmple):
Channel.fromFilePairs(params.fastqfiles,size: 1,checkIfExists: true ).set{file_list_ch}
file_list_ch.view()
[193fin, [193fin.fastq.gz]]
[829fin, [829fin.fastq.gz]]
But then when run a process with this channel, it only uses the first one and
[1a/11f063] process > INDEX (1) [100%] 1 of 1 ✔
[e7/89e2be] process > ALIGN (1) [100%] 1 of 1 ✔
part of the process is as follows:
ALIGN(index_ch,file_list_ch)
process ALIGN{
input:
path index, stageAs: "bowtie_index/*"
tuple val(sample_id), path(reads)
I have the example of the nf-core workshop and it's identical except it is single ended, but it still just runs one process.
how can i make it run all the processes?
Thanks
Upvotes: 1
Views: 816
Reputation: 54502
Issues like this almost always involve the use of multiple input channels:
When two or more channels are declared as process inputs, the process waits until there is a complete input configuration, i.e. until it receives a value from each input channel. When this condition is satisfied, the process consumes a value from each channel and launches a new task, repeating this logic until one or more channels are empty.
You didn't show how index_ch was created, but I suspect it is actually a queue channel. What you want instead is a value channel:
A different semantic is applied when using a value channel. This kind of channel is created by the Channel.value factory method or implicitly when a process is invoked with an argument that is not a channel. By definition, a value channel is bound to a single value and it can be read an unlimited number of times without consuming its content. Therefore, when mixing a value channel with one or more (queue) channels, it does not affect the process termination because the underlying value is applied repeatedly.
Upvotes: 0