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' } ``` diff --git a/docs/index.md b/docs/index.md index cb39f7a..e81d154 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,4 +11,10 @@ description: Nextflow plugin for sample sheet validation ==} ---8<-- "README.md:6:" +!!! info + + 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. + +## Introduction + +--8<-- "README.md:11:" diff --git a/docs/migration_guide.md b/docs/migration_guide.md index b999b09..f33f102 100644 --- a/docs/migration_guide.md +++ b/docs/migration_guide.md @@ -23,6 +23,37 @@ 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' + } + ``` + +Additionally, all includes from `nf-validation` should be updated to `nf-schema`. This can easily be done with the following command: + +```bash +find . -type f -name "*.nf" -exec sed -i -e "s/from 'plugin\/nf-validation'/from 'plugin\/nf-schema'/g" - +e 's/from "plugin\/nf-validation"/from "plugin\/nf-schema"/g' {} + +``` + +### 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 +64,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 -Next you should update the `.fromSamplesheet` channel factory to the `samplesheetToList` function. Following tabs shows the difference between the versions: + 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 + +### 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 +93,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.