Cannot get dump to print variable

Hi developers,
I’m interested to use dump to print variables.
In the code below dump doesn’t do anything.

workflow {

Channel.fromPath("long_format_data.csv")
        .splitCsv(header: true).map { it ->
            [
                it.subMap("batch", "timepoint", "tissue", "sequencing_type"),
                [
                    file(it.fastq_1),
                    file(it.fastq_2)
                ]
            ]
        }
        .branch { meta, fastq ->
            rna: meta.tissue == "rna" && meta.sequencing_type == "rna"
            germline: meta.tissue == "normal" && meta.sequencing_type == "wes"
            tumor: meta.tissue == "tumor" && meta.sequencing_type == "wes"
            other: true
        }
        .set { input_ch }

input_ch.germline| dump{tag: 'analysis', pretty: true}

}

Let me know if any other details are needed.

Please see attached input file.
long_format_data.csv (11.8 KB)

Are you running with the -dump-channels option? Something like:

nextflow run main.nf -dump-channels

@mribeirodantas
I wasn’t running with -dump-channels
When I use it, still no output.

workflow {

Channel.fromPath("long_format_data.csv")
        .splitCsv(header: true).map { it ->
            [
                it.subMap("batch", "timepoint", "tissue", "sequencing_type"),
                [
                    file(it.fastq_1),
                    file(it.fastq_2)
                ]
            ]
        }
        .branch { meta, fastq ->
            rna: meta.tissue == "rna" && meta.sequencing_type == "rna"
            germline: meta.tissue == "normal" && meta.sequencing_type == "wes"
            tumor: meta.tissue == "tumor" && meta.sequencing_type == "wes"
            other: true
        }
        .set { input_ch }

input_ch.dump()
    
}

/mnt/data1/software/nextflow run filter_branch.nf -dump-channels

Thanks.

You can’t dump a multi-channel variable. Your code works if you pick a channel inside input_ch, for example:

  
  ...
  
  input_ch.germline.dump()
}

Output:

Thank you. It helps.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.