π Docs ππ» https://nextflow-io.github.io/nf-validation
A Nextflow plugin to work with validation of pipeline parameters and sample sheets.
This Nextflow plugin provides a number of functions that can be included into a Nextflow pipeline script to work with parameter and sample sheet schema. Using these functions you can:
- π Print usage instructions to the terminal (for use with
--help
) - βοΈ Print log output showing parameters with non-default values
- β Validate supplied parameters against the pipeline schema
- π Validate the contents of supplied sample sheet files
- π οΈ Create a Nextflow channel with a parsed sample sheet
Supported sample sheet formats are CSV, TSV and YAML (simple).
Declare the plugin in your Nextflow pipeline configuration file:
(make sure you pin the latest stable release version after the @
)
plugins {
id '[email protected]'
}
This is all that is needed - Nextflow will automatically fetch the plugin code at run time.
You can now include the plugin helper functions into your Nextflow pipeline:
include { validateParameters; paramsHelp; paramsSummaryLog; fromSamplesheet } from 'plugin/nf-validation'
// Print help message, supply typical command line usage for the pipeline
if (params.help) {
log.info paramsHelp("nextflow run my_pipeline --input input_file.csv")
exit 0
}
// Validate input parameters
validateParameters()
// Print summary of supplied parameters
log.info paramsSummaryLog(workflow)
// Create a new channel of metadata from a sample sheet
// NB: `input` corresponds to `params.input` and associated sample sheet schema
ch_input = Channel.fromSamplesheet("input")
- Java 11 or later
- https://github.com/everit-org/json-schema
This plugin was written based on code initially written within the nf-core community, as part of the nf-core pipeline template.
We would like to thank the key contributors who include (but are not limited to):
- JΓΊlia Mir Pedrol (@mirpedrol)
- Nicolas Vannieuwkerke (@nvnieuwk)
- Kevin Menden (@KevinMenden)
- Phil Ewels (@ewels)