Skip to content

nextflow-io/nf-plugin-template

Repository files navigation

nf-plugin-template

Summary

nf-plugin-template is a Nextflow plugin scaffolded from the official plugin template. Out of the box it provides:

  • A custom function sayHello that 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.

Get Started

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.

Examples

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! 👋

Plugin development

This project was created from the Nextflow plugin template.

Building

To build the plugin:

make assemble

Testing with Nextflow

The plugin can be tested without a local Nextflow installation:

  1. Build and install the plugin to your local Nextflow installation: make install
  2. Run a pipeline with the plugin: nextflow run hello -plugins nf-plugin-template@0.1.0

Publishing

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:

  1. Create a file named $HOME/.gradle/gradle.properties, where $HOME is your home directory. Add the following properties:
    • npr.apiKey: Your Nextflow Registry access token.
  2. Package your plugin and publish it to the registry: make release.

License

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.

About

Template project for creating Nextflow plugins (beta)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors