How to access files/process from two different workflows to integrate?

Hi there,

I’ve a main.nf where there are multiple workflows present. Each workflow is run based on user inputs.

workflow {

    if (params.analysis=="both"){
        wes()
        rna()
     }
    if (params.analysis=="wes"){
        wes()
    }
    
    if (params.analysis=="rna"){
        rna() 
    }
}

How do I integrate data under both condition from WES and RNA?

For instance, there’s a process in WES called parse_CNV and in RNA it’s merge_feature, I’d like to integrate their output.

How do I access output of these workflows to process together?

I’ve tried:
1)

  wes:parse_cnv.out.view()
wes::parse_cnv.out.view()
wes:parse_cnv.out.parsed_cnv_file.view()

Error:
ERROR ~ No such variable: parse_cnv

Please help to proceed further.

You can use the emit keyword in the workflow block.

workflow FOO {
  ...
 
  emit:
  parsed_cnv = parse_cnv.out
}

Then you can access what you want with FOO.out.parsed_cnv.