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
Copy file name to clipboardExpand all lines: docs/vscode.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,19 @@ 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, function, type definition, 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:
30
+
31
+
```nextflow
32
+
/**
33
+
* Say hello to someone.
34
+
*
35
+
* @param name
36
+
*/
37
+
def sayHello(name) {
38
+
println "Hello, ${name}!"
39
+
}
40
+
```
41
+
29
42
### Code navigation
30
43
31
44
The **Outline** section in the Explorer panel lists top-level definitions when you view a script. Include declarations in scripts and config files act as links, and ctrl-clicking them opens the corresponding script or config file.
Copy file name to clipboardExpand all lines: docs/workflow.md
+55-6Lines changed: 55 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,18 +22,67 @@ workflow {
22
22
}
23
23
```
24
24
25
-
###Parameters
25
+
## Parameters
26
26
27
-
Parameters can be defined in the script with a default value that can be overridden from the CLI, params file, or config file. Parameters should only be used by the entry workflow:
27
+
Parameters can be declared in a Nextflow script with the `params` block or with *legacy* parameter declarations.
28
+
29
+
### Params block
30
+
31
+
:::{versionadded} 25.05.0-edge
32
+
:::
33
+
34
+
:::{note}
35
+
This feature requires the {ref}`strict syntax <strict-syntax-page>` to be enabled (`NXF_SYNTAX_PARSER=v2`).
36
+
:::
37
+
38
+
A script can declare parameters using the `params` block:
39
+
40
+
```nextflow
41
+
params {
42
+
/**
43
+
* Path to input data.
44
+
*/
45
+
input
46
+
47
+
/**
48
+
* Whether to save intermediate files.
49
+
*/
50
+
save_intermeds = false
51
+
}
52
+
```
53
+
54
+
Parameters can be used in the entry workflow:
55
+
56
+
```nextflow
57
+
workflow {
58
+
if( params.input )
59
+
analyze(params.input, params.save_intermeds)
60
+
else
61
+
analyze(fake_input(), params.save_intermeds)
62
+
}
63
+
```
64
+
65
+
:::{note}
66
+
While params can be used outside the entry workflow, Nextflow will not be able to validate them at compile-time. Only params used in the entry workflow are validated against the params definition. Params can be passed to workflows and processes as explicit inputs to enable compile-time validation.
67
+
:::
68
+
69
+
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`.
70
+
71
+
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.
72
+
73
+
### Legacy parameters
74
+
75
+
Parameters can be declared by assigning a `params` property to a default value:
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