Skip to content

Commit

Permalink
update contribution docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nvnieuwk committed Aug 14, 2024
1 parent d599785 commit fc1d463
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
28 changes: 26 additions & 2 deletions docs/contributing/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,33 @@ To compile and run the tests use the following command:
./gradlew check
```

## Launch it with Nextflow
## Launch it with installed Nextflow

To test with Nextflow for development purpose:
!!! warning

This method will add the development version of the plugin to your Nextflow plugins
Take care when using this method and make sure that you are never using a
development version to run real pipelines.
You can delete all `nf-schema` versions using this command:
```bash
rm -rf ~/.nextflow/plugins/nf-schema*
```

Install the current version of the plugin in your `.nextflow/plugins` folder

```bash
make install
```

Update or add the nf-schema plugin with the installed version in your test pipeline

```groovy title="nextflow.config"
plugins {
id '[email protected]'
}
```

## Launch it with a local version of Nextflow

Clone the Nextflow repo into a sibling directory

Expand Down
25 changes: 18 additions & 7 deletions docs/nextflow_schema/nextflow_schema_specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ However, they will be displayed as ungrouped in tools working off the schema.

## Nested parameters

!!! warning "Warning (TLDR;)"

Although the JSON Schema allows schema objects (eg.` params.foo.bar = "baz"`) or arrays, this is not supported by this plugin.
!!! example "New feature in v2.1.0"

Nextflow config allows parameters to be nested as objects, for example:

Expand All @@ -102,12 +100,25 @@ or on the CLI:
nextflow run <pipeline> --foo.bar "baz"
```

But - the current implementations of the Nextflow _schema_ do not (for now).
Nested parameters can be specified in the schema by adding a `properties` keyword to the root parameters:

This was done as a conscious decision when the code was first written, to try to reduce complexity.
```json
{
"type": "object",
"properties": {
"nested": { // Annotation for the --nested parameter
"type": "object", // Parameters that contain subparameters need to have the "object" type
"properties": { // Add other parameters in here
"deep": { // Annotation for the --nested.deep parameter
"type": "string"
}
}
},
}
}
```

It would be great to implement this at some point - there is a GitHub issue to track the feature request here:
[`nf-core/tools#1554`](https://github.com/nf-core/tools/issues/1554). Contributions welcome!
There is no limit to how deeply nested parameters can be. Mind however that deeply nested parameters are not that user friendly and will create some very ugly help messages. It's adviced to not go deeper than two levels of nesting, but it's entirely possible to go deeper.

## Required parameters

Expand Down

0 comments on commit fc1d463

Please sign in to comment.