Skip to content

Commit b736454

Browse files
Replace channel constructor with channel factory
That's the official way we refer to these functions on Nextflow official docs. Signed-off-by: Marcel Ribeiro-Dantas <[email protected]>
1 parent a5e3b45 commit b736454

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

docs/hello_nextflow/02_hello_world.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ This is where channels come in: Nextflow uses channels to feed inputs to process
501501

502502
There are multiple ways to do this, but for now, we're just going to use the simplest possible channel, containing a single value.
503503

504-
We're going to create the channel using the `Channel.of()` constructor, which sets up a simple value channel, and give it a hardcoded string to use as greeting by declaring `greeting_ch = Channel.of('Hello world!')`.
504+
We're going to create the channel using the `Channel.of()` factory, which sets up a simple value channel, and give it a hardcoded string to use as greeting by declaring `greeting_ch = Channel.of('Hello world!')`.
505505

506506
_Before:_
507507

@@ -840,11 +840,11 @@ Learn how to make the workflow run on a batch of input values.
840840

841841
Workflows typically run on batches of inputs that are meant to be processed in bulk, so we want to upgrade the workflow to accept multiple input values.
842842

843-
Conveniently, the `Channel.of()` constructor we've been using is quite happy to accept more than one value, so we don't need to modify that at all; we just have to load more values into the channel.
843+
Conveniently, the `Channel.of()` factory we've been using is quite happy to accept more than one value, so we don't need to modify that at all; we just have to load more values into the channel.
844844
845845
### 8.1. Load multiple greetings into the input channel
846846
847-
To keep things simple, we go back to hardcoding the greetings in the constructor instead of using a parameter for the input, but we'll improve on that shortly.
847+
To keep things simple, we go back to hardcoding the greetings in the channel factory instead of using a parameter for the input, but we'll improve on that shortly.
848848
849849
_Before:_
850850
@@ -1058,8 +1058,8 @@ params.input_file = "data/greetings.csv"
10581058
10591059
### 9.2. Update the channel declaration to handle the input file
10601060
1061-
At this point we introduce a new channel constructor, `Channel.fromPath()`, which has some built-in functionality for handling file paths.
1062-
We're going to use that instead of the `Channel.of()` constructor we used previously; the base syntax looks like this:
1061+
At this point we introduce a new channel factory, `Channel.fromPath()`, which has some built-in functionality for handling file paths.
1062+
We're going to use that instead of the `Channel.of()` factory we used previously; the base syntax looks like this:
10631063
10641064
```groovy title="channel construction syntax"
10651065
Channel.fromPath(input_file)

docs/hello_nextflow/04_hello_genomics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ workflow {
234234
}
235235
```
236236

237-
You'll notice we're using the same `.fromPath` channel constructor as we used at the end of Part 1 (Hello World) of this training series.
237+
You'll notice we're using the same `.fromPath` channel factory as we used at the end of Part 1 (Hello World) of this training series.
238238
Indeed, we're doing something very similar.
239239
The difference is that this time we're telling Nextflow to load the file path itself into the channel as an input element, rather than reading in its contents.
240240

@@ -466,7 +466,7 @@ params.reads_bam = [
466466
]
467467
```
468468

469-
And that's actually all we need to do, because the channel constructor we use in the workflow body (`.fromPath`) is just as happy to accept multiple file paths to load into the input channel as it was to load a single one.
469+
And that's actually all we need to do, because the channel factory we use in the workflow body (`.fromPath`) is just as happy to accept multiple file paths to load into the input channel as it was to load a single one.
470470

471471
!!! note
472472

@@ -748,9 +748,9 @@ params.reads_bam = "${projectDir}/data/sample_bams.txt"
748748

749749
This way we can continue to be lazy, but the list of files no longer lives in the workflow code itself, which is a big step in the right direction.
750750

751-
### 4.3. Update the channel constructor to read lines from a file
751+
### 4.3. Update the channel factory to read lines from a file
752752

753-
Currently, our input channel constructor treats any files we give it as the data inputs we want to feed to the indexing process.
753+
Currently, our input channel factory treats any files we give it as the data inputs we want to feed to the indexing process.
754754
Since we're now giving it a file that lists input file paths, we need to change its behavior to parse the file and treat the file paths it contains as the data inputs.
755755

756756
Fortunately we can do that very simply, just by adding the [`.splitText()` operator](https://www.nextflow.io/docs/latest/reference/operator.html#operator-splittext) to the channel construction step.

0 commit comments

Comments
 (0)