CB1915
CB1915

Reputation: 1

Passing specific outputs between nextflow processes

My DSL2 Nextflow pipeline is having some issues with passing the correct outputs to the next process. Below is a code example.

process X { 

  input: 
    path A

  output:
    path B
  script:
    
    """
    foo A > B
    """
    
}
process Y { 

  input: 
    path C

  output:
    path D
  script:
    
    """
    foo C > D
    """
    
}
process Z { 

  input: 
    path A
    path B
    path D

  output:
    path E
    path F
  script:
    
    """
    foo A > E
    bar B D > F
    """
    
}

Processes X and Y are passing outputs B and D to process Z but when there are multiple samples being run through it often times will pass miss-matched outputs from different samples that will not match with A.

I have tried using the sample IDs to dictate the correct input paths for B and D but process Z will still pick a random iteration of B and D and rename it to match the iteration of A.

Upvotes: 0

Views: 32

Answers (1)

Pallie
Pallie

Reputation: 1109

Use the join operator to join A, B and D on the value that identifies them as being from the same sample.

Upvotes: 1

Related Questions