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/hello_nextflow/03_hello_workflow.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -272,12 +272,12 @@ HOLà
272
272
273
273
That is the result we want to achieve with our workflow.
274
274
275
-
### 2.1. Create a new process to do the collection step
275
+
### 2.2. Create a new process to do the collection step
276
276
277
277
Let's create a new process and call it `collectGreetings()`.
278
278
We can start writing it based on the previous one.
279
279
280
-
#### 2.1.1. Write the 'obvious' parts of the process
280
+
#### 2.2.1. Write the 'obvious' parts of the process
281
281
282
282
Add the following process definition to the workflow script:
283
283
@@ -306,7 +306,7 @@ This is what we can write with confidence based on what you've learned so far.
306
306
But this is not functional!
307
307
It leaves out the input definition(s) and the first half of the script command because we need to figure out how to write that.
308
308
309
-
#### 2.1.2. Define inputs to `collectGreetings()`
309
+
#### 2.2.2. Define inputs to `collectGreetings()`
310
310
311
311
We need to collect the greetings from all the calls to the `convertToUpper()` process.
312
312
What do we know we can get from the previous step in the workflow?
@@ -333,7 +333,7 @@ _After:_
333
333
Notice we use the `path` prefix even though we expect this to contain multiple files.
334
334
Nextflow doesn't mind, so it doesn't matter.
335
335
336
-
#### 2.1.3. Compose the concatenation command
336
+
#### 2.2.3. Compose the concatenation command
337
337
338
338
This is where things could get a little tricky, because we need to be able to handle an arbitrary number of input files.
339
339
Specifically, we can't write the command up front, so we need to tell Nextflow how to compose it at runtime based on what inputs flow into the process.
@@ -372,11 +372,11 @@ In theory this should handle any arbitrary number of input files.
372
372
373
373
<!--[ADD LINK to note above] -->
374
374
375
-
### 2.2. Add the collection step to the workflow
375
+
### 2.3. Add the collection step to the workflow
376
376
377
377
Now we should just need to call the collection process on the output of the uppercasing step.
378
378
379
-
#### 2.2.1. Connect the process calls
379
+
#### 2.3.1. Connect the process calls
380
380
381
381
In the workflow block, make the following code change:
382
382
@@ -401,7 +401,7 @@ _After:_
401
401
402
402
This connects the output of `convertToUpper()` to the input of `collectGreetings()`.
403
403
404
-
#### 2.2.2. Run the workflow with `-resume`
404
+
#### 2.3.2. Run the workflow with `-resume`
405
405
406
406
Let's try it.
407
407
@@ -435,13 +435,13 @@ Oh no. The collection step was run individually on each greeting, which is NOT w
435
435
436
436
We need to do something to tell Nextflow explicitly that we want that third step to run on all the elements in the channel output by `convertToUpper()`.
437
437
438
-
### 2.3. Use an operator to collect the greetings into a single input
438
+
### 2.4. Use an operator to collect the greetings into a single input
439
439
440
440
Yes, once again the answer to our problem is an operator.
441
441
442
442
Specifically, we are going to use the aptly-named [`collect()`](https://www.nextflow.io/docs/latest/reference/operator.html#collect) operator.
443
443
444
-
#### 2.3.1. Add the `collect()` operator
444
+
#### 2.4.1. Add the `collect()` operator
445
445
446
446
This time it's going to look a bit different because we're not adding the operator in the context of a channel factory, but to an output channel.
447
447
@@ -466,7 +466,7 @@ _After:_
466
466
}
467
467
```
468
468
469
-
#### 2.3.2. Add some `view()` statements
469
+
#### 2.4.2. Add some `view()` statements
470
470
471
471
Let's also include a couple of `view()` statements to visualize the before and after states of the channel contents.
472
472
@@ -492,7 +492,7 @@ _After:_
492
492
493
493
The `view()` statements can go anywhere you want; we put them after the call for readability.
0 commit comments