nextflow.enable.dsl=2
include { bar } from "./target/nextflow/bar/main.nf" params(params)
workflow {
main:
if (!params.containsKey("input") || params.input == "") {
exit 1, "ERROR: Please provide a --input parameter."
}
output_ = Channel.fromPath(params.input)
| map { [ "foo", it, params ] }
| view { [ "DEBUG1", it[0], it[1] ] }
| bar
| view { [ "DEBUG2", it[0], it[1] ] }
Running the commands below reveals that the two output files overwrite one another:
$ viash ns build
$ ./run.sh
N E X T F L O W ~ version 21.04.1
Launching `main.nf` [nice_torricelli] - revision: 30f7d854fb
executor > local (1)
[50/2dc682] process > bar:bar_process (foo) [100%] 1 of 1 ✔
[DEBUG1, foo, /home/rcannood/Downloads/example/nextflow.config]
[DEBUG2, foo, [output1:/home/rcannood/Downloads/example/work/50/2dc68212e43b9c9fc050d2ec660ea9/foo.bar.txt]]
[DEBUG2, foo, [output2:/home/rcannood/Downloads/example/work/50/2dc68212e43b9c9fc050d2ec660ea9/foo.bar.txt]]
>> Be careful, multiple outputs from this component!
When there are multiple outputs, the output paths should probably be foo.bar.output1.txt and foo.bar.output2.txt.
Example component
src/bar/config.vsh.yaml
:Example workflow
main.nf
:Running the commands below reveals that the two output files overwrite one another:
When there are multiple outputs, the output paths should probably be
foo.bar.output1.txt
andfoo.bar.output2.txt
.example.zip