-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from nextflow-io/docs/nested-params
Update docs with latest changes
- Loading branch information
Showing
9 changed files
with
385 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,13 @@ | |
> [!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: | ||
This [Nextflow plugin](https://www.nextflow.io/docs/latest/plugins.html#plugins) provides functionality that can be used in a Nextflow pipeline to work with parameter and sample sheet schema. The added functionality is: | ||
|
||
- 📖 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 | ||
- 🛠️ Create a type-casted list from a parsed sample sheet | ||
|
||
Supported sample sheet formats are CSV, TSV, JSON and YAML. | ||
|
||
|
@@ -25,27 +25,21 @@ Declare the plugin in your Nextflow pipeline configuration file: | |
|
||
```groovy title="nextflow.config" | ||
plugins { | ||
id 'nf-schema@2.0.0' | ||
id 'nf-schema@2.1.0' | ||
} | ||
``` | ||
|
||
This is all that is needed - Nextflow will automatically fetch the plugin code at run time. | ||
|
||
> [!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 `[email protected]` | ||
> The snippet above will always try to install the specified version. We encourage always pinning the | ||
> plugin version to make sure the used pipeline will keep working when a new version of `nf-schema` | ||
> with breaking changes has been released. | ||
You can now include the plugin helper functions into your Nextflow pipeline: | ||
|
||
```groovy title="main.nf" | ||
include { validateParameters; paramsHelp; paramsSummaryLog; samplesheetToList } from 'plugin/nf-schema' | ||
// 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 | ||
} | ||
include { validateParameters; paramsSummaryLog; samplesheetToList } from 'plugin/nf-schema' | ||
// Validate input parameters | ||
validateParameters() | ||
|
@@ -57,10 +51,21 @@ log.info paramsSummaryLog(workflow) | |
ch_input = Channel.fromList(samplesheetToList(params.input, "assets/schema_input.json")) | ||
``` | ||
|
||
Or enable the creation of the help message (using `--help`) in the configuration file: | ||
|
||
```groovy title="nextflow.config" | ||
validation { | ||
help { | ||
enabled: true | ||
} | ||
} | ||
``` | ||
|
||
## Dependencies | ||
|
||
- Java 11 or later | ||
- <https://github.com/harrel56/json-schema> | ||
- Nextflow 23.10.0 or later | ||
|
||
## Slack channel | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,30 +13,54 @@ 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 | ||
|
||
Clone the Nextflow repo into a sibling directory | ||
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 | ||
|
||
```bash | ||
cd .. && git clone https://github.com/nextflow-io/nextflow | ||
cd nextflow && ./gradlew exportClasspath | ||
``` | ||
|
||
Append to the `settings.gradle` in this project the following line: | ||
- Append to the `settings.gradle` in this project the following line: | ||
|
||
```bash | ||
includeBuild('../nextflow') | ||
``` | ||
|
||
Compile the plugin code | ||
- Compile the plugin code | ||
|
||
```bash | ||
./gradlew compileGroovy | ||
``` | ||
|
||
Run nextflow with this command: | ||
- Run nextflow with this command: | ||
|
||
```bash | ||
./launch.sh run -plugins nf-schema <script/pipeline name> [pipeline params] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.