Skip to content
Discussion options

You must be logged in to vote

I think the maxFork should not be used to force the sequential execution of tasks. nextflow is inherently parallel, therefore it's not guaranteed that different processes will be executed in the expected order (without mention the lack of performance).

A better solution consists in keeping the channel order using the join operator using the task.index value as the joining column. I've rewritten the example for your convenience

csvinputs = Channel
  .of('a,b,c,d,e,f\n10,10,10,10,10,10\n20,20,20,20,20,20\n30,30,30,30,30,30')
  .splitCsv(header: true)

def index=0
a = csvinputs.map { row -> row.a }
b = csvinputs.map { row -> [++index, row.b] }

process PROCESS1 {
    input:
        val(a)

 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mribeirodantas
Comment options

mribeirodantas Nov 30, 2022
Collaborator Author

Answer selected by mribeirodantas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants