Adding modules to pipelines
nf-core modules are standardized, reusable components that wrap individual bioinformatics tools. Each module includes the tool’s process definition, container specifications, and metadata. By using modules from the central nf-core/modules repository, you benefit from community testing, standardized structure, and easier maintenance.
You can use nf-core tools to add these modules directly to your pipeline. Follow these steps to integrate a new nf-core module.
Pipeline workflows may vary. This guide covers the most common integration steps.
Add an nf-core module
To add an nf-core module to your pipeline with nf-core tools:
-
Install the module to your pipeline using the nf-core command-line tool:
nf-core modules install <tool>/<subtool> -
Add the
includestatement at the workflow level to import the module.- The installation command from the previous step will provide the exact syntax you need.
-
Insert the module call in the relevant workflow script.
- Ensure version information is mixed into the versions channel and route output files to MultiQC if applicable.
-
Create a dedicated section in
conf/modules.confthat specifies the default output directory and file patterns for the module. -
Add module-specific parameters in
nextflow.configwith sensible defaults.-
For pipeline-level parameters that need to be passed to the module, insert them into
ext.argsusing proper closure syntax:ext.args = { "--option $params.option" }
-
-
Update
nextflow_schema.jsonto include the new parameters:nf-core pipelines schema build -
Update the following documentation files:
- Add tool citations to
CITATIONS.md - Document usage information in
docs/usage.md - Describe output directories in
docs/output.md - Update the pipeline README and workflow diagrams
- Update the MultiQC configuration file
- Add tool citations to
-
Run the nf-core linting tool to ensure your code meets nf-core standards:
nf-core pipelines lint -
Run Prettier to format your code.
prettier -w -
Run the pipeline locally with test data to verify:
- The module executes successfully
- Outputs are generated correctly
- No errors or warnings occur