Instead of having one huge Nextflow script that run all the pipelines. To make to easier to read the file and edit pipeline down the road. Can we write a Nextflow script that executes Multiple Nextflow scripts?
Instead of having one huge Nextflow script that run all the pipelines. To make to easier to read the file and edit pipeline down the road. Can we write a Nextflow script that executes Multiple Nextflow scripts?
The new DSL2 lets you define modules which can contain workflow components (i.e. functions, processes and worflows) which can be imported into another Nextflow script using the include keyword. The module inclusion example in the docs has a typo, but it should look like:
include { foo } from './some/module.nf'
workflow {
data = channel.fromPath('/some/data/*.txt')
foo(data)
}
The above snippet includes a process with name
foodefined in the module script in the main execution context. This way,foocan be invoked in theworkflowscope.Nextflow implicitly looks for the script file
./some/module.nfresolving the path against the including script location.