# What kind of variable is created from subMap and branch

**URL:** <https://community.seqera.io/t/what-kind-of-variable-is-created-from-submap-and-branch/523>\
**Category:** Ask for help\
**Created:** [February 28, 2024, 8:43pm UTC](https://community.seqera.io/t/what-kind-of-variable-is-created-from-submap-and-branch/523 "2024-02-28T20:43:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![complexgenome](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/complexgenome/32/392_2.png) [@complexgenome](https://community.seqera.io/u/complexgenome)\
**Post date:** [February 28, 2024, 8:43pm UTC](https://community.seqera.io/t/what-kind-of-variable-is-created-from-submap-and-branch/523/1 "2024-02-28T20:43:47Z")

</div>

Hi Developers,

I’m using following code to read in some data (attached)

```auto
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}

input_ch.germline.view()
    
}

```

It prints following as expected I guess:

> [[batch:SEMA-MM-001, timepoint:MM-3309-T-01, tissue:normal, sequencing\_type:wes], [/data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-3309-DNA-N-01-01\_L001\_R1\_001.fastq.gz, /data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-3309-DNA-N-01-01\_L001\_R2\_001.fastq.gz]]
> 
> [[batch:SEMA-MM-001, timepoint:MM-0489-T-01, tissue:normal, sequencing\_type:wes], [/data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0489-DNA-N-01-01\_L001\_R1\_001.fastq.gz, /data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0489-DNA-N-01-01\_L001\_R2\_001.fastq.gz]]
> 
> [[batch:SEMA-MM-001, timepoint:MM-0487-T-01, tissue:normal, sequencing\_type:wes], [/data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0487-DNA-N-01-01\_L001\_R1\_001.fastq.gz, /data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0487-DNA-N-01-01\_L001\_R2\_001.fastq.gz]]
> 
> [[batch:SEMA-MM-001, timepoint:MM-0486-T-01, tissue:normal, sequencing\_type:wes], [/data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0486-DNA-N-01-01\_L001\_R1\_001.fastq.gz, /data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0486-DNA-N-01-01\_L001\_R2\_001.fastq.gz]]
> 
> [[batch:SEMA-MM-001, timepoint:MM-0256-T-02, tissue:normal, sequencing\_type:wes], [/data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0256-DNA-N-01-01\_L001\_R1\_001.fastq.gz, /data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0256-DNA-N-01-01\_L001\_R2\_001.fastq.gz]]
> 
> [[batch:SEMA-MM-001, timepoint:MM-0364-T-02, tissue:normal, sequencing\_type:wes], [/data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0364-DNA-N-01-01\_L001\_R1\_001.fastq.gz, /data1/raw\_data/WES/sema4/SEMA-MM-001DNA/MM-0364-DNA-N-01-01\_L001\_R2\_001.fastq.gz]]

I’m new to the world of groovy, nextflow thus I’m having some difficulty.

What kind of variable is `input_ch`? Is it a list or a multi-channel or an array or  
something else?

Please help me to understand the variable.  
Thanks  
[long\_format\_data.csv](https://community.seqera.io/uploads/short-url/wyvvoimoennM1EjqiVrslLrR9KY.csv) (11.8 KB)

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [February 29, 2024, 1:44am UTC](https://community.seqera.io/t/what-kind-of-variable-is-created-from-submap-and-branch/523/2 "2024-02-29T01:44:26Z")

</div>

Hey, @complexgenome.

`input_ch` is a Nextflow multi-channel variable. `input_ch.germline` is a Nextflow channel.

---

<div class="post-metadata">

**Author:** ![complexgenome](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/complexgenome/32/392_2.png) [@complexgenome](https://community.seqera.io/u/complexgenome)\
**Post date:** [February 29, 2024, 11:16am UTC](https://community.seqera.io/t/what-kind-of-variable-is-created-from-submap-and-branch/523/3 "2024-02-29T11:16:25Z")

</div>

@mribeirodantas Thank you for your reply.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/system/32/2402_2.png) [@system](https://community.seqera.io/u/system)\
**Post date:** [March 7, 2024, 11:17am UTC](https://community.seqera.io/t/what-kind-of-variable-is-created-from-submap-and-branch/523/4 "2024-03-07T11:17:15Z")

</div>

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