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/nextflow/building_blocks.md
+39-29Lines changed: 39 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,7 @@ These channels can then be used by operators or serve as an input for the proces
148
148
````{tab} Exercise 1.1
149
149
Inspect and edit the `exercises/01_building_blocks/template.nf` script. Create a channel consisting of multiple paired-end files. For more information, read [`fromFilePairs`](https://www.nextflow.io/docs/latest/channel.html#fromfilepairs).
150
150
151
-
Once the Nextflow script is saved, run it with: `nextflow run template.nf`.
151
+
Once the Nextflow script is saved, run it with: `nextflow run exercises/01_building_blocks/template.nf`.
152
152
153
153
````
154
154
@@ -165,6 +165,8 @@ This is a `tuple` qualifier which we will use a lot during this workshop and dis
165
165
### 2. Operators
166
166
Operators are necessary to transform the content of channels in a format that is necessary for usage in the processes. There is a plethora of different operators[[5](https://www.nextflow.io/docs/latest/operator.html?highlight=view#)], however only a handful are used extensively. Here are some examples that you might come accross:
167
167
-`collect`: e.g. when using a channel consisting of multiple independent files (e.g. fastq-files) and need to be assembled for a next process (output in a list data-type).
Each process is executed independently and isolated from any other process. They communicate via asynchronous FIFO queues, i.e. one process will wait for the output of another and then runs reactively when the channel has contents.
279
-
280
-
281
-
282
-
```{image} ../img/nextflow/asynchronous-FIFO.png
283
-
:align: center
284
-
```
285
-
286
284
Here are a couple of examples of processes:
287
285
288
286
@@ -383,7 +381,37 @@ The **output** declaration block defines the channels created by the process to
383
381
384
382
---
385
383
386
-
A script, as part of the process, can be written in any language (bash, Python, Perl, Ruby, etc.). This allows to add self-written scripts in the pipeline. The script can be written in the process itself, or can be present as a script in another folder and is run from the process here. An example can be found in `exercises/01_building_blocks/hellofrompython.nf`.
384
+
385
+
Each process is executed independently and isolated from any other process. They communicate via asynchronous FIFO queues, i.e. one process will wait for the output of another and then runs reactively when the channel has contents.
386
+
387
+
388
+
389
+
```{image} ../img/nextflow/asynchronous-FIFO.png
390
+
:align: center
391
+
```
392
+
393
+
Let's exemplify this by running the script [`exercises/01_building_blocks/fifo.nf`](https://github.com/vibbits/nextflow-workshop/blob/main/exercises/01_building_blocks/fifo.nf) and inspect the order that the channels are being processed.
[4b/aff57f] process > whosfirst (10) [100%] 10 of 10
410
+
```
411
+
412
+
---
413
+
414
+
A script, as part of the process, can be written in any language (bash, Python, Perl, Ruby, etc.). This allows to add self-written scripts in the pipeline. The script can be written in the process itself, or can be present as a script in another folder and is run from the process here. An example can be found in [`exercises/01_building_blocks/hellofrompython.nf`](https://github.com/vibbits/nextflow-workshop/blob/main/exercises/01_building_blocks/hellofrompython.nf).
387
415
388
416
```
389
417
#!/usr/bin/env nextflow
@@ -413,24 +441,6 @@ In this case, the output would be in the directory starting `work/f6/4916cd...`
413
441
414
442
---
415
443
416
-
Earlier, we described that Nextflow uses an asynchronous FIFO principle. Let's exemplify this by running the script `fifo.nf` and inspect the order that the channels are being processed.
[4b/aff57f] process > whosfirst (10) [100%] 10 of 10
433
-
```
434
444
435
445
````{tab} Exercise 1.4
436
446
A `tag` directive can be added at the top of the process definition and allows you to associate each process execution with a custom label. Hence, it is really useful for logging or debugging. Add a tag for `num` and `str` in the process of the script `exercises/01_building_blocks/firstscript.nf` and inspect the output.
@@ -477,7 +487,7 @@ workflow {
477
487
478
488
## Extra exercises
479
489
````{tab} Extra exercise 1
480
-
Use the `view` operator on the output of the `valuesToFile` process in the script `firstscript.nf`. For this, you will first need to add an `emit` argument to the output of the process. More information is available in the documentation [here](https://www.nextflow.io/docs/edge/dsl2.html#process-named-output).
490
+
Use the `view` operator on the output of the `valuesToFile` process in the script `exercises/01_building_blocks/firstscript.nf`. For this, you will first need to add an `emit` argument to the output of the process. More information is available in the documentation [here](https://www.nextflow.io/docs/edge/dsl2.html#process-named-output).
Copy file name to clipboardExpand all lines: docs/nextflow/first_pipeline.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ The final FastQC script, with some additional comments is provided in `exercises
128
128
129
129
Now we will add the next step in our pipeline, which is **trimming and filtering the low quality reads**. For this process, we will use the tool `trimmomatic`.
130
130
131
-
The `fastqc.nf` script was extended with the trimmomatic process and is available in `trimmomatic.nf`.
131
+
The `fastqc.nf` script was extended with the trimmomatic process and is available in `exercises/03_first_pipeline/trimmomatic.nf`.
132
132
- A number of parameters have been added related to the trimmomatic process
133
133
- The process `trimmomatic` with its inputs and outputs and the script has been created
134
134
- The `workflow` now also contains the process trimmomatic, called as a function
@@ -167,7 +167,7 @@ include { fastqc as fastqc_raw; fastqc as fastqc_trim } from "${projectDir}/modu
167
167
```
168
168
Now we're ready to use a process, defined in a module, multiple times in a workflow.
169
169
170
-
Investigate & run the script `modules.nf` which contains the following code snippet
170
+
Investigate & run the script `exercises/03_first_pipeline/modules.nf` which contains the following code snippet
171
171
```
172
172
...
173
173
include { fastqc as fastqc_raw; fastqc as fastqc_trim } from "${projectDir}/../../modules/fastqc"
0 commit comments