Emit a named val
in DSL2
#2115
Answered
by
phue
multimeric
asked this question in
Q&A
-
I like to name all my outputs. However, if you are outputting a simple value, it is seemingly impossible to assign a name to it in DSL2. If I try to use nextflow.enable.dsl=2
process test {
output:
val "abc", emit x
script:
"""
true
"""
}
workflow {
result = test()
result.x.view()
}
If I try to re-assign a new variable: nextflow.enable.dsl=2
process test {
output:
val x
script:
x = "abc"
"""
true
"""
}
workflow {
result = test()
result.x.view()
}
(because this isn't a named input, so only And of course I can't use nextflow.enable.dsl=2
process test {
output:
val "abc" into x
script:
"""
true
"""
}
workflow {
result = test()
result.x.view()
}
How can this be done? |
Beta Was this translation helpful? Give feedback.
Answered by
phue
May 17, 2021
Replies: 1 comment 6 replies
-
The syntax requires to put a colon after the
|
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
multimeric
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The syntax requires to put a colon after the
emit
keyword, i.e: