You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This syntax allows you to declare all parameters in one place with explicit type annotations, and it allows Nextflow to validate parameters at runtime.
33
+
34
+
See {ref}`workflow-params-def` for details.
35
+
11
36
## Enhancements
12
37
13
38
<h3>New syntax for workflow handlers</h3>
@@ -74,4 +99,6 @@ This feature addresses previous inconsistencies in timestamp representations.
74
99
75
100
## Deprecations
76
101
102
+
- The legacy type detection of CLI parameters is disabled when using the strict syntax (`NXF_SYNTAX_PARSER=v2`). {ref}`Legacy parameters <workflow-params-legacy>` in the strict syntax should not rely on legacy type detection. Alternatively, use the new `params` block to convert CLI parameters based on their type annotations. Legacy type detection can be disabled globally by setting the environment variable `NXF_DISABLE_PARAMS_TYPE_DETECTION=true`.
103
+
77
104
- The use of workflow handlers in the configuration file has been deprecated. You should define workflow handlers in the pipeline script or a plugin instead. See {ref}`config-workflow-handlers` for details.
Copy file name to clipboardExpand all lines: docs/vscode.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ The language server parses scripts and config files according to the {ref}`Nextf
26
26
27
27
When you hover over certain source code elements, such as variable names and function calls, the extension provides a tooltip with related information, such as the definition and/or documentation for the element.
28
28
29
-
If a [Javadoc](https://en.wikipedia.org/wiki/Javadoc) comment is defined above a workflow, process, or function, the extension will include the contents of the comment in hover hints. The following is an example Javadoc comment:
29
+
If a [Javadoc](https://en.wikipedia.org/wiki/Javadoc) comment is defined above a workflow, process, function, or parameter in a `params` block, the extension will include the contents of the comment in hover hints. The following is an example Javadoc comment:
Copy file name to clipboardExpand all lines: docs/workflow.md
+54-5Lines changed: 54 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,60 @@ workflow {
22
22
}
23
23
```
24
24
25
-
### Parameters
25
+
(workflow-params-def)=
26
+
27
+
## Parameters
28
+
29
+
Parameters can be declared in a Nextflow script with the `params` block or with *legacy* parameter declarations.
30
+
31
+
### Params block
32
+
33
+
:::{versionadded} 25.10.0
34
+
:::
35
+
36
+
:::{note}
37
+
This feature requires the {ref}`strict syntax <strict-syntax-page>` to be enabled (`NXF_SYNTAX_PARSER=v2`).
38
+
:::
39
+
40
+
A script can declare parameters using the `params` block:
41
+
42
+
```nextflow
43
+
params {
44
+
// Path to input data.
45
+
input: Path
46
+
47
+
// Whether to save intermediate files.
48
+
save_intermeds: Boolean = false
49
+
}
50
+
```
51
+
52
+
The following types can be used for parameters:
53
+
54
+
- {ref}`stdlib-types-boolean`
55
+
- {ref}`stdlib-types-float`
56
+
- {ref}`stdlib-types-integer`
57
+
- {ref}`stdlib-types-path`
58
+
- {ref}`stdlib-types-string`
59
+
60
+
Parameters can be used in the entry workflow:
61
+
62
+
```nextflow
63
+
workflow {
64
+
analyze(params.input, params.save_intermeds)
65
+
}
66
+
```
67
+
68
+
:::{note}
69
+
As a best practice, parameters should only be used directly in the entry workflow and passed to workflows and processes as explicit inputs.
70
+
:::
71
+
72
+
The default value can be overridden by the command line, params file, or config file. Parameters from multiple sources are resolved in the order described in {ref}`cli-params`. Parameters specified on the command line are converted to the appropriate type based on the corresponding type annotation.
73
+
74
+
A parameter that doesn't specify a default value is a *required* param. If a required param is not given a value at runtime, the run will fail.
75
+
76
+
(workflow-params-legacy)=
77
+
78
+
### Legacy parameters
26
79
27
80
Parameters can be declared by assigning a `params` property to a default value:
28
81
@@ -38,10 +91,6 @@ workflow {
38
91
}
39
92
```
40
93
41
-
:::{note}
42
-
As a best practice, `params` should be used only in the entry workflow and passed to workflows and processes as explicit inputs.
43
-
:::
44
-
45
94
The default value can be overridden by the command line, params file, or config file. Parameters from multiple sources are resolved in the order described in {ref}`cli-params`.
if(!workDir.mkdirs()) thrownewAbortOperationException("Cannot create work-dir: $workDir -- Make sure you have write permissions or specify a different directory by using the `-w` command line option")
0 commit comments