nf-plugin-template is a Nextflow plugin scaffolded from the official plugin
template. Out of the box it provides:
- A custom function
sayHellothat can be imported into Nextflow scripts. - A workflow observer that reacts to pipeline lifecycle events (start and completion).
Replace this section with a description of what your plugin actually does.
Note: The Summary, Get Started, Examples, and License sections are mandatory: they are required by the Nextflow Registry, which uses this file as the plugin description. The Plugin development section below is guidance for working on the plugin and can be removed before publishing.
Enable the plugin in your pipeline nextflow.config:
plugins {
id 'nf-plugin-template@0.1.0'
}Nextflow downloads the plugin from the Nextflow Registry the first time the pipeline runs.
Import and call the sayHello function from a Nextflow script:
include { sayHello } from 'plugin/nf-plugin-template'
workflow {
channel.of('Mundo', 'World').map { target -> sayHello(target) }
}The bundled observer prints a message when the pipeline starts and completes, so running any pipeline with the plugin enabled produces:
Pipeline is starting! 🚀
Pipeline complete! 👋
This project was created from the Nextflow plugin template.
To build the plugin:
make assembleThe plugin can be tested without a local Nextflow installation:
- Build and install the plugin to your local Nextflow installation:
make install - Run a pipeline with the plugin:
nextflow run hello -plugins nf-plugin-template@0.1.0
Plugins can be published to a central Nextflow registry to make them accessible to the Nextflow community.
Follow these steps to publish the plugin to the Nextflow Registry:
- Create a file named
$HOME/.gradle/gradle.properties, where$HOMEis your home directory. Add the following properties:npr.apiKey: Your Nextflow Registry access token.
- Package your plugin and publish it to the registry:
make release.
Apache License 2.0. See the COPYING file for details.
Note: The above license is given for guidance only; however the Nextflow Registry requires the plugin to include an OSS (open source software) license.