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/reference/process.md
+13-10Lines changed: 13 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -290,9 +290,6 @@ The following options are available for all process outputs:
290
290
291
291
### accelerator
292
292
293
-
:::{versionadded} 19.09.0-edge
294
-
:::
295
-
296
293
The `accelerator` directive allows you to request hardware accelerators (e.g. GPUs) for the task execution. For example:
297
294
298
295
```nextflow
@@ -313,17 +310,23 @@ This directive is only used by certain executors. Refer to the {ref}`executor-pa
313
310
:::
314
311
315
312
:::{note}
316
-
Additional options may be required to fully enable the use of accelerators. When using containers with GPUs, you must pass the GPU drivers through to the container. For Docker, this requires the option `--gpus all` in the docker run command. For Apptainer/Singularity, this requires the option `--nv`. The specific implementation details depend on the accelerator and container type being used.
313
+
Additional options may be required to fully enable the use of accelerators. When using containers with GPUs, you must pass the GPU drivers through to the container. For Docker, this requires the option `--gpus all` in the `docker run` command. For Apptainer/Singularity, this requires the option `--nv`. The specific implementation details depend on the accelerator and container type being used.
317
314
:::
318
315
319
-
:::{note}
320
-
The accelerator `type` option depends on the target execution platform. Refer to the platform-specific documentation for details on the available accelerators:
: Specifying this directive with a number (e.g., `accelerator 4`) is equivalent to the `request` option (e.g., `accelerator request: 4`).
324
321
325
-
The accelerator `type` option is not supported for AWS Batch. You can control the accelerator type indirectly through the allowed instance types in your Compute Environment. See the [AWS Batch FAQs](https://aws.amazon.com/batch/faqs/?#GPU_Scheduling_) for more information.
326
-
:::
322
+
`type: String`
323
+
: The accelerator type.
324
+
: The meaning of this option depends on the target execution platform. See the platform-specific documentation for more information about the available accelerators:
: This option is not supported for AWS Batch. You can control the accelerator type indirectly through the allowed instance types in your Compute Environment. See the [AWS Batch FAQs](https://aws.amazon.com/batch/faqs/?#GPU_Scheduling_) for more information.
However, the type checker cannot validate code that uses `set` or `tap`. Use standard assignments in your dataflow logic to enable full type checking.
387
387
388
-
<h3>Avoid <code>each</code> input qualifier</h3>
388
+
### Avoid `|` and `&` operators
389
+
390
+
The {ref}`special operators <workflow-special-operators>``|` and `&` provide shorthands for writing dataflow logic:
391
+
392
+
```nextflow
393
+
channel.of('Hello', 'Hola', 'Ciao')
394
+
| greet
395
+
| map { v -> v.toUpperCase() }
396
+
| view
397
+
```
398
+
399
+
However, the type checker cannot validate code that uses these special operators. Use standard assignments and method calls instead:
400
+
401
+
```nextflow
402
+
ch_input = channel.of('Hello', 'Hola', 'Ciao')
403
+
ch_greet = greet(ch_input)
404
+
ch_greet
405
+
.map { v -> v.toUpperCase() }
406
+
.view()
407
+
```
408
+
409
+
### Avoid `each` input qualifier
389
410
390
411
The {ref}`each <process-input-each>` input qualifier is not supported by typed processes. Use the {ref}`operator-combine` operator to create a single tuple channel instead.
391
412
@@ -436,7 +457,7 @@ workflow {
436
457
The `each` qualifier is discouraged in modern Nextflow code. While it provides a convenient shorthand for combining multiple inputs, it couples the process definition with external workflow logic. Since the introduction of DSL2, Nextflow aims to treat processes as standalone modules that are decoupled from workflow logic.
437
458
:::
438
459
439
-
<h3>Aviod functions with ambiguous return types</h3>
460
+
### Avoid functions with ambiguous return types
440
461
441
462
Some {ref}`standard library <stdlib-types>` functions and {ref}`operators <operator-page>` have ambiguous return types. While you can still use them with static types, the type checker will not be able to fully validate your code.
Copy file name to clipboardExpand all lines: docs/workflow.md
+14-6Lines changed: 14 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ workflow {
28
28
29
29
Parameters can be declared in a Nextflow script with the `params` block or with *legacy* parameter declarations.
30
30
31
-
### Params block
31
+
### Typed parameters
32
32
33
33
:::{versionadded} 25.10.0
34
34
:::
@@ -66,7 +66,7 @@ workflow {
66
66
```
67
67
68
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.
69
+
As a best practice, parameters should only be referenced in the entry workflow or `output` block. Parameters can be passed to workflows and processes as explicit inputs.
70
70
:::
71
71
72
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.
@@ -354,10 +354,16 @@ The same process can be called in different workflows without using an alias, li
354
354
The fully qualified process name can be used as a {ref}`process selector <config-process-selectors>` in a Nextflow configuration file, and it takes priority over the simple process name.
355
355
:::
356
356
357
+
(workflow-special-operators)=
358
+
357
359
## Special operators
358
360
359
361
The following operators have a special meaning when used in a workflow with process and workflow calls.
360
362
363
+
:::{note}
364
+
As a best practice, avoid these operators when {ref}`type checking <preparing-static-types>` is enabled. Using these operators will prevent the type checker from validating your code.
365
+
:::
366
+
361
367
### Pipe `|`
362
368
363
369
The `|`*pipe* operator can be used to chain processes, operators, and workflows:
@@ -375,7 +381,7 @@ process greet {
375
381
}
376
382
377
383
workflow {
378
-
channel.of('Hello','Hola','Ciao')
384
+
channel.of('Hello','Hola','Ciao')
379
385
| greet
380
386
| map { v -> v.toUpperCase() }
381
387
| view
@@ -388,9 +394,11 @@ The same code can also be written as:
0 commit comments