Skip to content

Commit

Permalink
rebrand nf-validation to nf-schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nvnieuwk committed Mar 20, 2024
1 parent 9129b3c commit 4e5472c
Show file tree
Hide file tree
Showing 118 changed files with 130 additions and 130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Obtain version from MANIFEST.MF
run: echo "plugin_version=$(grep "Plugin-Version" plugins/nf-validation/src/resources/META-INF/MANIFEST.MF | awk '{print $2}' | awk -F '.' '{print $1"."$2}')" >> $GITHUB_ENV
run: echo "plugin_version=$(grep "Plugin-Version" plugins/nf-schema/resources/META-INF/MANIFEST.MF | awk '{print $2}' | awk -F '.' '{print $1"."$2}')" >> $GITHUB_ENV
- name: Setup git user
run: |
git config --global user.name "${{github.actor}}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ jobs:
with:
name: test-reports-jdk-${{ matrix.java_version }}
path: |
./plugins/nf-validation/build/reports/tests/test/**
./plugins/nf-schema/build/reports/tests/test/**
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nextflow-io/nf-validation: Changelog
# nextflow-io/nf-schema: Changelog

# Version 2.0.0 - Kagoshima

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ![nf-validation](docs/images/nf-validation.svg)
# ![nf-schema](docs/images/nf-schema.svg)

## 📚 Docs 👉🏻 <https://nextflow-io.github.io/nf-validation>
## 📚 Docs 👉🏻 <https://nextflow-io.github.io/nf-schema>

**A Nextflow plugin to work with validation of pipeline parameters and sample sheets.**

Expand All @@ -22,7 +22,7 @@ Declare the plugin in your Nextflow pipeline configuration file:

```groovy title="nextflow.config"
plugins {
id 'nf-validation'
id 'nf-schema'
}
```

Expand All @@ -31,12 +31,12 @@ This is all that is needed - Nextflow will automatically fetch the plugin code a
> [!NOTE]
> The snippet above will always try to install the latest version, good to make sure
> that the latest bug fixes are included! However, this can cause difficulties if running
> offline. You can pin a specific release using the syntax `nf-validation@2.0.0`
> offline. You can pin a specific release using the syntax `nf-schema@2.0.0`
You can now include the plugin helper functions into your Nextflow pipeline:

```groovy title="main.nf"
include { validateParameters; paramsHelp; paramsSummaryLog; fromSamplesheet } from 'plugin/nf-validation'
include { validateParameters; paramsHelp; paramsSummaryLog; fromSamplesheet } from 'plugin/nf-schema'
// Print help message, supply typical command line usage for the pipeline
if (params.help) {
Expand Down
4 changes: 2 additions & 2 deletions docs/background.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Background
description: Get up and running with nf-validation
description: Get up and running with nf-schema
hide:
- toc
---
Expand All @@ -14,4 +14,4 @@ In addition to config params, a common best-practice for pipelines is to use a "

Nextflow itself does not provide functionality to validate config parameters or parsed sample sheets. To bridge this gap, we developed code within the [nf-core community](https://nf-co.re/) to allow pipelines to work with a standard `nextflow_schema.json` file, written using the [JSON Schema](https://json-schema.org/) format. The file allows strict typing of parameter variables and inclusion of validation rules.

The nf-validation plugin moves this code out of the nf-core template into a stand-alone package, to make it easier to use for the wider Nextflow community. It also incorporates a number of new features, such as native Groovy sample sheet validation.
The nf-schema plugin moves this code out of the nf-core template into a stand-alone package, to make it easier to use for the wider Nextflow community. It also incorporates a number of new features, such as native Groovy sample sheet validation.
6 changes: 3 additions & 3 deletions docs/contributing/setup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Contribution instructions
description: How to contribute to nf-validation
description: How to contribute to nf-schema
---

# Getting started with plugin development
Expand Down Expand Up @@ -39,7 +39,7 @@ Compile the plugin code
Run nextflow with this command:

```bash
./launch.sh run -plugins nf-validation <script/pipeline name> [pipeline params]
./launch.sh run -plugins nf-schema <script/pipeline name> [pipeline params]
```

## Change and preview the docs
Expand All @@ -51,7 +51,7 @@ You can install the required packages as follows:
pip install mkdocs-material pymdown-extensions pillow cairosvg
```

To change the docs, edit the files in the [docs/](https://github.com/nextflow-io/nf-validation/tree/master/docs) folder and run the following command to generate the docs:
To change the docs, edit the files in the [docs/](https://github.com/nextflow-io/nf-schema/tree/master/docs) folder and run the following command to generate the docs:

```bash
mkdocs serve
Expand Down
2 changes: 1 addition & 1 deletion docs/images/nf-validation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: nf-validation
title: nf-schema
description: Nextflow plugin for sample sheet validation
---

# ![nf-validation](images/nf-validation.svg)
# ![nf-schemaages/nf-scheschemg

{==

Expand Down
4 changes: 2 additions & 2 deletions docs/migration_guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Migration guide
description: Guide to migrate pipelines using nf-validation pre v2.0.0 to after v2.0.0
description: Guide to migrate pipelines using nf-schema pre v2.0.0 to after v2.0.0
hide:
- toc
---
Expand All @@ -17,7 +17,7 @@ Following list shows the major breaking changes introduced in version 2.0.0:
2. The `unique` keyword for samplesheet schemas has been removed. Please use [`uniqueItems`](https://json-schema.org/understanding-json-schema/reference/array#uniqueItems) or [`uniqueEntries`](nextflow_schema/nextflow_schema_specification.md#uniqueentries) now instead.
3. The `dependentRequired` keyword now works as it's supposed to work in JSON schema. See [`dependentRequired`](https://json-schema.org/understanding-json-schema/reference/conditionals#dependentRequired) for more information

A full list of changes can be found in the [changelog](https://github.com/nextflow-io/nf-validation/blob/master/CHANGELOG.md).
A full list of changes can be found in the [changelog](https://github.com/nextflow-io/nf-schema/blob/master/CHANGELOG.md).

## Updating your pipeline

Expand Down
2 changes: 1 addition & 1 deletion docs/nextflow_schema/create_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ nf-core schema build

!!! warning

The current version of `nf-core` tools (v2.12.1) does not support the new schema draft used in `nf-validation`. Running this command after building the schema will convert the schema to the right draft:
The current version of `nf-core` tools (v2.12.1) does not support the new schema draft used in `nf-schemaunning this command after building the schema will convert the schema to the right draft:

```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' nextflow_schema.json
Expand Down
4 changes: 2 additions & 2 deletions docs/nextflow_schema/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: Introduction
description: Introduction to the nf-validation plugin
description: Introduction to the nf-schema plugin
---

# Nextflow schema for parameters

The functionality of the nf-validation plugin centres on a pipeline _schema_ file.
The functionality of the nf-schema plugin centres on a pipeline _schema_ file.
By convention, this file is stored in the workflow root directory and called `nextflow_schema.json`.

## What it does
Expand Down
6 changes: 3 additions & 3 deletions docs/nextflow_schema/nextflow_schema_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ hide:
You can see an example JSON Schema for a Nextflow pipeline `nextflow_schema.json` file below.

This file was generated from the nf-core pipeline template, using `nf-core create`.
It is used as a test fixture in the nf-validation package [here](https://github.com/nextflow-io/nf-validation/blob/master/plugins/nf-validation/src/testResources/nextflow_schema.json).
It is used as a test fixture in the nf-schemakage [here](https://github.com/nextflow-io/nf-snf-schemaster/plugins/nf-schemnf-schemaources/nextflow_schema.json).

!!! note

More examples can be found in the plugin [`testResources` directory](https://github.com/nextflow-io/nf-validation/blob/master/plugins/nf-validation/src/testResources/).
More examples can be found in the plugin [`testResources` directory](https://github.com/nextflow-io/nf-schemab/master/plugins/nf-snf-schematResources/).

```json
--8<-- "plugins/nf-validation/src/testResources/nextflow_schema.json"
--8<-- "plugins/nf-schema/testResources/nextflow_schema.json"
```
10 changes: 5 additions & 5 deletions docs/nextflow_schema/nextflow_schema_specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can find more information about JSON Schema here:

!!! note

The nf-validation plugin, as well as several other interfaces using Nextflow schema, uses a stock JSON schema library for parameter validation.
The nf-schema plugin, as well as several other interfaces using Nextflow schema, uses a stock JSON schema library for parameter validation.
As such, any valid JSON schema _should_ work for validation.

However, please note that graphical UIs (docs, launch interfaces) are largely hand-written and may not expect JSON schema usage that is
Expand Down Expand Up @@ -247,7 +247,7 @@ and get:

A boolean JSON flag that instructs anything using the schema that this parameter/field is deprecated and should not be used. This can be useful to generate messages telling the user that a parameter has changed between versions.

JSON schema states that this is an informative key only, but in `nf-validation` this will cause a validation error if the parameter/field is used.
JSON schema states that this is an informative key only, but in `nf-schema` this will cause a validation error if the parameter/field is used.

!!! tip

Expand Down Expand Up @@ -401,7 +401,7 @@ Should only be set when `format` is `file-path`.

!!! tip

Setting this field is key to working with sample sheet validation and channel generation, as described in the next section of the nf-validation docs.
Setting this field is key to working with sample sheet validation and channel generation, as described in the next section of the nf-schema docs.

These schema files are typically stored in the pipeline `assets` directory, but can be anywhere.

Expand Down Expand Up @@ -442,7 +442,7 @@ Specify a minimum / maximum value for an integer or float number length with `mi
!!! note

The JSON schema doc also mention `exclusiveMinimum`, `exclusiveMaximum` and `multipleOf` keys.
Because nf-validation uses stock JSON schema validation libraries, these _should_ work for validating keys.
Because nf-schema uses stock JSON schema validation libraries, these _should_ work for validating keys.
However, they are not officially supported within the Nextflow schema ecosystem and so some interfaces may not recognise them.

## Array-specific keys
Expand Down Expand Up @@ -481,4 +481,4 @@ The combination of all values in the given keys should be unique. For this key t
}
```

This schema tells `nf-validation` that the combination of `foo` and `bar` should be unique across all objects in the array.
This schema tells `nf-schema` that the combination of `foo` and `bar` should be unique across all objects in the array.
8 changes: 4 additions & 4 deletions docs/nextflow_schema/sample_sheet_schema_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ You can see this, used for validating sample sheets with `--input` here: [`asset
}
```

## nf-validation test case
## nf-schema test case

You can see a very feature-complete example JSON Schema for a sample sheet schema file below.

It is used as a test fixture in the nf-validation package [here](https://github.com/nextflow-io/nf-validation/blob/master/plugins/nf-validation/src/testResources/schema_input.json).
It is used as a test fixture in the nf-schema package [here](https://github.com/nextflow-io/nf-schema/blob/master/plugins/nf-schema/src/testResources/schema_input.json).

!!! note

More examples can be found in the plugin [`testResources` directory](https://github.com/nextflow-io/nf-validation/blob/master/plugins/nf-validation/src/testResources/).
More examples can be found in the plugin [`testResources` directory](https://github.com/nextflow-io/nf-schema/blob/master/plugins/nf-schema/src/testResources/).

```json
--8<-- "plugins/nf-validation/src/testResources/schema_input.json"
--8<-- "plugins/nf-schema/src/testResources/schema_input.json"
```
4 changes: 2 additions & 2 deletions docs/nextflow_schema/sample_sheet_schema_specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Schema specification for sample sheet validation

# Sample sheet schema specification

Sample sheet schema files are used by the nf-validation plugin for validation of sample sheet contents and type conversion / channel generation.
Sample sheet schema files are used by the nf-schemagin for validation of sample sheet contents and type conversion / channel generation.

The Nextflow schema syntax is based on the JSON schema standard.
You can find more information about JSON Schema here:
Expand Down Expand Up @@ -94,4 +94,4 @@ For example:
```

will convert the `field` value to a meta value, resulting in the channel `[[id:value]...]`
See [here](https://github.com/nextflow-io/nf-validation/blob/ce3aef60e5103ea4798375fe6c59bae41b7d2a25/plugins/nf-validation/src/testResources/schema_input.json#L10-L25) for an example in the sample sheet.
See [here](https://github.com/nextflow-io/nf-schemab/ce3aef60e5103ea4798375fe6c59bae41b7d2a25/plugins/nf-scheschemctResources/schema_input.json#L10-L25) for an example in the sample sheet.
2 changes: 1 addition & 1 deletion docs/samplesheets/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Examples of advanced sample sheet creation techniques.

## Introduction

Understanding channel structure and manipulation is critical for getting the most out of Nextflow. nf-validation helps initialise your channels from the text inputs to get you started, but further work might be required to fit your exact use case. In this page we run through some common cases for transforming the output of `.fromSamplesheet`.
Understanding channel structure and manipulation is critical for getting the most out of Nextflow. nf-schema helps initialise your channels from the text inputs to get you started, but further work might be required to fit your exact use case. In this page we run through some common cases for transforming the output of `.fromSamplesheet`.

### Glossary

Expand Down
6 changes: 3 additions & 3 deletions docs/samplesheets/fromSamplesheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Channel.fromSamplesheet('input', parameters_schema: 'custom_nextflow_schema.json

## Basic example

In [this example](https://github.com/nextflow-io/nf-validation/tree/master/examples/fromSamplesheetBasic), we create a simple channel from a CSV sample sheet.
In [this example](https://github.com/nextflow-io/nf-schema/tree/master/examples/fromSamplesheetBasic), we create a simple channel from a CSV sample sheet.

```
--8<-- "examples/fromSamplesheetBasic/log.txt"
Expand Down Expand Up @@ -73,7 +73,7 @@ In [this example](https://github.com/nextflow-io/nf-validation/tree/master/examp

## Order of fields

[This example](https://github.com/nextflow-io/nf-validation/tree/master/examples/fromSamplesheetOrder) demonstrates that the order of columns in the sample sheet file has no effect.
[This example](https://github.com/nextflow-io/nf-schema/tree/master/examples/fromSamplesheetOrder) demonstrates that the order of columns in the sample sheet file has no effect.

!!! danger

Expand Down Expand Up @@ -115,7 +115,7 @@ In [this example](https://github.com/nextflow-io/nf-validation/tree/master/examp

## Channel with meta map

In [this example](https://github.com/nextflow-io/nf-validation/tree/master/examples/fromSamplesheetMeta), we use the schema to mark two columns as meta fields.
In [this example](https://github.com/nextflow-io/nf-schema/tree/master/examples/fromSamplesheetMeta), we use the schema to mark two columns as meta fields.
This returns a channel with a meta map.

```
Expand Down
2 changes: 1 addition & 1 deletion docs/samplesheets/validate_sample_sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parse and validate the provided file contents using this JSON schema.
It can validate CSV, TSV, JSON and YAML files.

The path of the schema file must be relative to the root of the pipeline directory.
See an example in the `input` field from the [example schema.json](https://raw.githubusercontent.com/nextflow-io/nf-validation/master/plugins/nf-validation/src/testResources/nextflow_schema_with_samplesheet.json#L20).
See an example in the `input` field from the [example schema.json](https://raw.githubusercontent.com/nextflow-io/nf-schema/master/plugins/nf-schema/src/testResources/nextflow_schema_with_samplesheet.json#L20).

```json
{
Expand Down
2 changes: 1 addition & 1 deletion docs/schema_input.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/nextflow-io/nf-validation/master/plugins/nf-validation/src/testResources/schema_input.json",
"$id": "https://raw.githubusercontent.com/nextflow-io/nf-schemater/plugins/nf-snf-schematResources/schema_input.json",
"title": "Samplesheet validation schema",
"description": "Schema for the samplesheet used in this pipeline",
"type": "object",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/nf-validation/example/master/assets/schema_input.json",
"title": "nf-validation example - params.input schema",
"$id": "https://raw.githubusercontent.com/nf-schema/example/master/assets/schema_input.json",
"title": "nf-schema example - params.input schema",
"description": "Schema for the file provided with params.input",
"type": "array",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion examples/fromSamplesheetBasic/pipeline/main.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include { fromSamplesheet } from 'plugin/nf-validation'
include { fromSamplesheet } from 'plugin/nf-schema'

ch_input = Channel.fromSamplesheet("input")

Expand Down
2 changes: 1 addition & 1 deletion examples/fromSamplesheetBasic/pipeline/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'nf-validation@2.0.0'
id 'nf-schema@2.0.0'
}

params {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/nf-validation/example/master/assets/schema_input.json",
"title": "nf-validation example - params.input schema",
"$id": "https://raw.githubusercontent.com/nf-schemample/master/assets/schema_input.json",
"title": "nf-schemample - params.input schema",
"description": "Schema for the file provided with params.input",
"type": "array",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion examples/fromSamplesheetMeta/pipeline/main.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include { fromSamplesheet } from 'plugin/nf-validation'
include { fromSamplesheet } from 'plugin/nf-schema'

ch_input = Channel.fromSamplesheet("input")

Expand Down
2 changes: 1 addition & 1 deletion examples/fromSamplesheetMeta/pipeline/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'nf-validation@2.0.0'
id 'nf-schema@2.0.0'
}

params {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/nf-validation/example/master/assets/schema_input.json",
"title": "nf-validation example - params.input schema",
"$id": "https://raw.githubusercontent.com/nf-schema/example/master/assets/schema_input.json",
"title": "nf-schema example - params.input schema",
"description": "Schema for the file provided with params.input",
"type": "array",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion examples/fromSamplesheetOrder/pipeline/main.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include { fromSamplesheet } from 'plugin/nf-validation'
include { fromSamplesheet } from 'plugin/nf-schema'

ch_input = Channel.fromSamplesheet("input")

Expand Down
2 changes: 1 addition & 1 deletion examples/fromSamplesheetOrder/pipeline/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'nf-[email protected].0'
id 'nf-schema.0'
}

params {
Expand Down
2 changes: 1 addition & 1 deletion examples/paramsHelp/pipeline/main.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include { paramsHelp } from 'plugin/nf-validation'
include { paramsHelp } from 'plugin/nf-schema'

if (params.help) {
log.info paramsHelp("nextflow run my_pipeline --input input_file.csv")
Expand Down
2 changes: 1 addition & 1 deletion examples/paramsHelp/pipeline/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'nf-validation@2.0.0'
id 'nf-schema@2.0.0'
}

params {
Expand Down
Loading

0 comments on commit 4e5472c

Please sign in to comment.