Use a group of multiple paired files as input #5592
-
Hi, I am new to Nextflow and trying to understand how to work with complex inputs. I have a process that I would like to ingest multiple paired-end fqs from the same sample.
I thought the input channel could be constructed as below:
process input as
so I can define my inputs as: The idea is to get the following command: I got the error: So I guessed array list cannot be passed as input, but I don't know how to construct the input channel in this case. Wonder if anyone can advice on this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When you do the groupTuple, it is creating a list of lists for the reads. So you need to flatten the reads after the groupTuple: Channel.fromPath(params.sample_csv)
.splitCsv(header: true, sep: ',')
.map { row ->
def meta = [id: row.sample_id]
[meta, [file(row.fq1), file(row.fq2)]]
}
.groupTuple()
.map { meta, reads -> [ meta, reads.flatten() ] }
.view() |
Beta Was this translation helpful? Give feedback.
When you do the groupTuple, it is creating a list of lists for the reads. So you need to flatten the reads after the groupTuple: