Skip to content

how to iterate over multi map values in a process? #4650

Closed Answered by robsyme
complexgenome asked this question in Q&A
Discussion options

You must be logged in to vote

The issue here is that the it variable is reserved for the iterator value and should not be used in the process scope.

This version of your workflow should produce the expected result:

process test {
    input: val(num)
    output: stdout
    script: "echo ${num}"
}

workflow {
    Channel.of(1, 2, 3, 4)
    .multiMap {
        foo: it + 1
        bar: it * it
    }
    .set { result }

    test(result.foo).view()
}

In future, if your query is a question related to Nextflow syntax, please consider the Nextflow community forum: https://community.seqera.io.

If you query is a Nextflow bug report, this Github repository is still the appropriate venue.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by complexgenome
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants