Skip to content

Commit 6c21e1b

Browse files
docs: Add output labels use cases and details (nextflow-io#6986)
Co-authored-by: Ben Sherman <bentshermann@gmail.com>
1 parent 1e9a830 commit 6c21e1b

5 files changed

Lines changed: 40 additions & 6 deletions

File tree

docs/module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ Those scripts will be made accessible like any other command in the task environ
277277
This feature requires the use of a local or shared file system for the pipeline work directory, or {ref}`wave-page` when using cloud-based executors.
278278
:::
279279

280-
:::{info}
280+
:::{note}
281281
When {ref}`wave-page` is enabled, the contents of the module `resources/` directory are automatically included in the provisioned container. Wave treats the `resources/` directory as the container root. For example, `resources/some/data/file.txt` becomes `/some/data/file.txt` in the container.
282282
:::
283283

docs/tutorials/data-lineage.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ Every output file is represented in the lineage store as a `FileOutput` record.
139139

140140
As this record is a workflow output, it is not linked directly to a task run. Instead, it is linked to the original task output.
141141

142+
:::{note}
143+
The `labels` field is `null` because no labels were assigned to this file. Labels are set using the `label` directive in the `output` block. See {ref}`workflow-output-labels` for more information.
144+
:::
145+
142146
Any LID in a lineage record can be viewed, allowing you to traverse the lineage metadata interactively. Use the value of `source` to view the original task output:
143147

144148
```console
@@ -303,10 +307,10 @@ Note the difference between the task scripts, highlighting the change that cause
303307

304308
Workflow outputs declared in the `output` block are also recorded in the lineage store. The output of a workflow run is accessible as `lid://<WORKFLOW_RUN_HASH>#output`.
305309

306-
For example, run the `rnaseq-nf` pipeline using the `preview-25-04` branch, which uses the `output` block to publish outputs:
310+
For example, run the `rnaseq-nf` pipeline with the `preview-25-04` branch, which uses the `output` block to publish outputs:
307311

308312
```console
309-
$ nextflow -r preview-25-04 -profile conda
313+
$ nextflow run rnaseq-nf -r preview-25-04 -profile conda
310314
```
311315

312316
View the workflow output in the lineage metadata:
@@ -337,7 +341,20 @@ The following types are used in workflow output lineage records:
337341
| `Map` | object | `Map`, `Record` |
338342
| `Path` | string with `lid://` prefix | `Path` |
339343

340-
See {ref}`workflow-output-def` for more information about the `output` block.
344+
When labels are assigned to a workflow output with the `label` directive, they appear in the `labels` field of each corresponding `FileOutput` record:
345+
346+
```console
347+
$ nextflow lineage view lid://9410d13abeec617640b5fe9735ba12fc/multiqc_report.html
348+
{
349+
"version": "lineage/v1beta1",
350+
"type": "FileOutput",
351+
"path": "/results/multiqc_report.html",
352+
...
353+
"labels": ["qc", "summary"]
354+
}
355+
```
356+
357+
Labels can be used to filter files when querying lineage records with the `nextflow lineage find` command. See {ref}`workflow-output-labels` for details on assigning labels to workflow outputs.
341358

342359
## Use lineage in a Nextflow script
343360

docs/wave.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ wave.strategy = ['dockerfile','container']
6262

6363
This setting instructs Wave to prioritize the module Dockerfile over process `container` directives.
6464

65-
:::{info}
65+
:::{note}
6666
When building containers, Wave does not support `ADD`, `COPY`, or any other Dockerfile commands that access files in the host file system. To include custom scripts or files, use the module `resources/` directory instead. Wave automatically includes its contents in the container build context. See {ref}`module-binaries` for more details.
6767
:::
6868

docs/workflow.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,23 @@ Files that do not originate from the work directory are not published, but are i
337337

338338
See [Output directives](#output-directives) for the list of available index directives.
339339

340+
(workflow-output-labels)=
341+
342+
### Labels
343+
344+
You can apply labels to each workflow output using the `label` directive:
345+
346+
```nextflow
347+
output {
348+
multiqc_report {
349+
label 'qc'
350+
label 'summary'
351+
}
352+
}
353+
```
354+
355+
Labels can be used to find and filter output files across workflow runs with data lineage. They are stored in the `labels` field of each `FileOutput` record published by the workflow output in the lineage store. See {ref}`data-lineage-page` for details on how to query output files by label.
356+
340357
### Output directives
341358

342359
The following directives are available for each output in the output block:

docs/your-first-script.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This guide details fundamental skills to run a basic Nextflow pipeline. It inclu
1212

1313
You will need the following to get started:
1414

15-
- Nextflow version 25.10 or later. See {ref}`install-page` for installation instructions. If you have an older version, see {ref}`updating-nextflow` to update.
15+
- Nextflow version 25.10 or later. See {ref}`install-page` for installation instructions. If you have an older version, see {ref}`updating-nextflow-page` to update.
1616

1717
## Run a pipeline
1818

0 commit comments

Comments
 (0)