Skip to content

Commit

Permalink
update of parameter schema section nf-core#1045
Browse files Browse the repository at this point in the history
nf-core#1045
- update on the pipeline schema documentation for updates and changes
- added a paragraph for `nextflow schema docs`
  • Loading branch information
jenmuell authored Oct 11, 2022
1 parent b56dbdb commit 5633757
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ To help developers working with pipeline schema, nf-core tools has three `schema

- `nf-core schema validate`
- `nf-core schema build`
- `nf-core schema docs`
- `nf-core schema lint`

### Validate pipeline parameters
Expand Down Expand Up @@ -539,6 +540,31 @@ There are four flags that you can use with this command:
- `--web-only`: Skips comparison of the schema against the pipeline parameters and only launches the web tool.
- `--url <web_address>`: Supply a custom URL for the online tool. Useful when testing locally.

### Display the content of a pipeline schema

To get an impression about the current pipeline schema you can display the content of the `nextflow_schema.json` with `nf-core schema docs <pipeline-schema>`. This will print a table with the content of your schema in the standard output.

There are four flags that you can use with this command:

- `--output <filename>`: Output filename. Defaults to standard out.
- `--format [markdown|html]`: Format to output docs in.
- `--force`: Overwrite existing files
- `--columns <columns_list>`: CSV list of columns to include in the parameter tables

### Add new parameters to the pipeline schema

If you want to add an parameter to the schema, you first have to add the parameter and its default value to the `nextflow.config` file in the `params` block. Afterwards, you run the command `nf-core schema build` to add the parameters to your schema and open the graphical interface to easily modify the schema.

The graphical interface is oganzised in groups and within the groups the single parameters are stored. For an better overview you can collapse all groups with the `Collapse groups` button, than your new parameters will be the only remaining one at the bottom of the page. Now you can either create a new group with the `Add group` button or drag and drop the paramters in an existing group. Therefor the group has to be expanded. The group title will be displayed, if you run your pipeline with the `--help` flag and its description apears on the parameter page of your pipeline.

Now you can start to change the parameter itself. The description is a short explanation about the parameter, that apears if you run your pipeline with the `--help` flag. By clicking on the dictionary icon you can add a longer explanation for the parameter page of your pipeline. If you want specify some conditions for your parameter, like the file extension, you can use the nut icon to open the settings. This menu depends on the `type` you assigned to your parameter. For intergers you can define a min and max value, and for strings the file extension can be specified.

After you filled your schema, click on the `Finished` button in the top rigth corner, this will automatically update your `nextflow_schema.json`. If this is not working you can copy the schema from the graphical interface and paste it in your `nextflow_schema.json`.

### Update existing pipeline schema

Important for the update of a pipeline schema is, that if you want to change the default value of a parameter, you should change it in the `nextflow.config` file, since the value in the config file overwrites the value in the pipeline schema. To change any other parameter use `nf-core schema build --web-only` to open the graphical interface without rebuilding the pipeline schema. Now, you can change your parameters as mentioned above but keep in mind that changing the parameter datatype is depending on the default value you specified in the `nextflow.config` file.

### Linting a pipeline schema

The pipeline schema is linted as part of the main pipeline `nf-core lint` command,
Expand Down

0 comments on commit 5633757

Please sign in to comment.