Skip to content

Linking

Young edited this page Mar 1, 2024 · 4 revisions

linking

This wiki page is dedicated to all the developers who prefer not to re-invent the wheel. You are our people.

Nextflow has the capacity to link workflows to workflows to workflows to modules. It's a beautiful thing and more information is available on this concept in the nextflow documentation.

Not all nextflow workflows can be linked together, however, mostly due to essential scripts in 'bin'. There has been an effort made to make Donut Falls "linkable", mainly because WE wanted to link this workflow to another workflow.

THIS IS WHY DONUT FALLS IS A SINGLE FILE!!!

Getting the DONUT FALLS subworkflow:

wget https://raw.githubusercontent.com/UPHL-BioNGS/Donut_Falls/main/donut_falls.nf

Ta da!

You can also do things with git submodules, but we've found that's harder to explain.

Parameters

Donut Falls has no input parameters when used as a subworfklow.

Input channels:

There are two input channels:

  • ch_nanopore_input : tuple (meta, nanopore.fastq.gz)
  • ch_illumina_input : tuple (meta, [illumina_R1.fastq.gz, illumina_R2.fastq.gz])

Note: The meta of both channels must be the same as it is used to tie nanopore and illumina files together for polishing.

If there are no Illumina files, set the Illumina channel to empty (ch_illumina_input.ifEmpty([]) or something similar.

Emit channels

If you need additional channels, please submit an issue

  • fasta : tuple (meta, fasta files from each stage of assembly)

Basic usage

Below is a pseudo code example of how to to include Donut Falls in another Nextflow workflow

include { DONUT_FALLS } from "<path to donut falls root directory>"
include { other_workflow_or_module } from "<path to other_workflow_or_module>"

Channel
 .<get input>
 .<manipulate input to create chanells>
 .set(ch_nanopore_input or ch_illumina_input)

workflow {
 DONUT_FALLS(ch_nanopore_input, ch_illumina_input.ifEmpty([]))
 other_workflow_or_module(donut_falls.out.fasta)
}