From ce4ecb434dfd528cd6f0009d58099769c7535a81 Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Mon, 22 Apr 2024 16:12:09 +0200 Subject: [PATCH 1/5] add small message stating the connection to nf-validation --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b1871e8..a4a70f0 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ ## Introduction +> [!IMPORTANT] +> nf-schema is the new version of the now deprecated [nf-validation](https://github.com/nextflow-io/nf-validation). Please follow the [migration guide](https://nextflow-io.github.io/nf-schema/latest/migration_guide/) to migrate your code to this new version. + This [Nextflow plugin](https://www.nextflow.io/docs/latest/plugins.html#plugins) 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`) @@ -22,7 +25,7 @@ Declare the plugin in your Nextflow pipeline configuration file: ```groovy title="nextflow.config" plugins { - id 'nf-schema' + id 'nf-schema@2.0.0' } ``` From e31f5a48e9fdabf59411f2d62d0fd6d71124ac8c Mon Sep 17 00:00:00 2001 From: Nicolas Vannieuwkerke Date: Mon, 22 Apr 2024 16:12:26 +0200 Subject: [PATCH 2/5] Reorganise the migration guide --- docs/migration_guide.md | 100 ++++++++++++++++++++++++++-------------- 1 file changed, 66 insertions(+), 34 deletions(-) diff --git a/docs/migration_guide.md b/docs/migration_guide.md index b999b09..620514a 100644 --- a/docs/migration_guide.md +++ b/docs/migration_guide.md @@ -23,6 +23,30 @@ A full list of changes can be found in the [changelog](https://github.com/nextfl ## Updating your pipeline +Updating your pipeline can be done in a couple simple steps. + +### Updating the name and version of the plugin + +The name and the version of the plugin should be updated from `nf-validation` to `nf-schema@2.0.0`: + +=== "nf-validation" + + ```groovy + plugins { + id 'nf-validation@1.1.3' + } + ``` + +=== "nf-schema" + + ```groovy + plugins { + id 'nf-schema@2.0.0' + } + ``` + +### Updating the JSON schema files + If you aren't using any special features in your schemas, you can simply update your `nextflow_schema.json` file using the following command: ```bash @@ -33,10 +57,16 @@ This will replace the old schema draft specification (`draft-07`) by the new one !!! note - Repeat this command for every JSON schema you use in your pipeline. e.g. for the default samplesheet schema in nf-core pipelines: - `bash sed -i -e 's/http:\/\/json-schema.org\/draft-07\/schema/https:\/\/json-schema.org\/draft\/2020-12\/schema/g' -e 's/definitions/defs/g' assets/schema_input.json ` + Repeat this command for every JSON schema used in your pipeline. e.g. for the default samplesheet schema in nf-core pipelines: + `bash sed -i -e 's/http:\/\/json-schema.org\/draft-07\/schema/https:\/\/json-schema.org\/draft\/2020-12\/schema/g' -e 's/definitions/defs/g' assets/schema_input.json` + +!!! warning + + This will not update changes to special fields in the schema, see the [guide](#updating-special-keywords-in-json-schemas) for special JSON schema keywords on how to update these -Next you should update the `.fromSamplesheet` channel factory to the `samplesheetToList` function. Following tabs shows the difference between the versions: +### Update the samplesheet conversion + +The `.fromSamplesheet` channel factory should be converted to the `samplesheetToList` function. Following tabs shows how to use the function to get the same effect as the channel factory: === "nf-validation" @@ -56,6 +86,39 @@ Next you should update the `.fromSamplesheet` channel factory to the `sampleshee This change was necessary to make it possible for pipelines to be used as pluggable workflows. This also enables the validation and conversion of files generated by the pipeline. +### Updating configuration + +The configuration parameters have been converted to a Nextflow configuration option. You can now access these options using the `validation` config scope: + +```groovy +validation.