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/02_hello_channels.md
+25-12Lines changed: 25 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -522,7 +522,7 @@ Here we added the operator on the next line for readability, but you can add ope
522
522
523
523
#### 3.2.2. Add `view()` to inspect channel contents
524
524
525
-
We could run this right away to test if it works, but while we're at it, we're also going to add a couple of [`view()`](https://www.nextflow.io/docs/latest/reference/operator.html#view)directives, which allow us to inspect the contents of a channel.
525
+
We could run this right away to test if it works, but while we're at it, we're also going to add a couple of [`view()`](https://www.nextflow.io/docs/latest/reference/operator.html#view)operators, which allow us to inspect the contents of a channel.
526
526
You can think of `view()` as a debugging tool, like a `print()` statement in Python, or its equivalent in other languages.
527
527
528
528
In the workflow block, make the following code change:
@@ -540,12 +540,25 @@ _After:_
540
540
```groovy title="hello-channels.nf" linenums="31"
541
541
// create a channel for inputs
542
542
greeting_ch = Channel.of(greetings_array)
543
-
.view { "Before flatten: $it" }
543
+
.view { greeting -> "Before flatten: $greeting" }
544
544
.flatten()
545
-
.view { "After flatten: $it" }
545
+
.view { greeting -> "After flatten: $greeting" }
546
546
```
547
547
548
-
Here `$it` is an implicit variable that represents each individual item loaded in a channel.
548
+
We are using an operator _closure_ here - the curly brackets.
549
+
This code executes for each item in the channel.
550
+
We define a temporary variable for the inner value, here called `greeting` (it could be anything).
551
+
This variable is only used within the scope of that closure.
552
+
553
+
In this example, `$greeting` represents each individual item loaded in a channel.
554
+
555
+
!!! note "Note on `$it`"
556
+
557
+
In some pipelines you may see a special variable called `$it` used inside operator closures.
558
+
This is an _implicit_ variable that allows a short-hand access to the inner variable,
559
+
without needing to define it with a `->`.
560
+
561
+
We prefer to be explicit to aid code clarity, as such the `$it` syntax is discouraged and will slowly be phased out of the Nextflow language.
549
562
550
563
#### 3.2.3. Run the workflow
551
564
@@ -723,9 +736,9 @@ _After:_
723
736
```groovy title="hello-channels.nf" linenums="31"
724
737
// create a channel for inputs from a CSV file
725
738
greeting_ch = Channel.fromPath(params.greeting)
726
-
.view { "Before splitCsv: $it" }
739
+
.view { csv -> "Before splitCsv: $csv" }
727
740
.splitCsv()
728
-
.view { "After splitCsv: $it" }
741
+
.view { csv -> "After splitCsv: $csv" }
729
742
```
730
743
731
744
As you can see, we also include before/after view statements while we're at it.
@@ -787,7 +800,7 @@ This is what the syntax looks like:
787
800
788
801
This means 'for each element in the channel, take the first of any items it contains'.
789
802
790
-
So let's apply that to our CVS parsing.
803
+
So let's apply that to our CSV parsing.
791
804
792
805
#### 4.3.1. Apply `map()` to the channel
793
806
@@ -798,21 +811,21 @@ _Before:_
798
811
```groovy title="hello-channels.nf" linenums="31"
799
812
// create a channel for inputs from a CSV file
800
813
greeting_ch = Channel.fromPath(params.greeting)
801
-
.view { "Before splitCsv: $it" }
814
+
.view { csv -> "Before splitCsv: $csv" }
802
815
.splitCsv()
803
-
.view { "After splitCsv: $it" }
816
+
.view { csv -> "After splitCsv: $csv" }
804
817
```
805
818
806
819
_After:_
807
820
808
821
```groovy title="hello-channels.nf" linenums="31"
809
822
// create a channel for inputs from a CSV file
810
823
greeting_ch = Channel.fromPath(params.greeting)
811
-
.view { "Before splitCsv: $it" }
824
+
.view { csv -> "Before splitCsv: $csv" }
812
825
.splitCsv()
813
-
.view { "After splitCsv: $it" }
826
+
.view { csv -> "After splitCsv: $csv" }
814
827
.map { item -> item[0] }
815
-
.view { "After map: $it" }
828
+
.view { csv -> "After map: $csv" }
816
829
```
817
830
818
831
Once again we include another `view()` call to confirm that the operator does what we expect.
collectGreetings.out.count.view { "There were $it greetings in this batch" }
819
+
collectGreetings.out.count.view { num_greetings -> "There were $num_greetings greetings in this batch" }
820
820
```
821
821
822
-
Here we are using `$it` in the same way we did earlier, as an implicit variable to access the contents of the channel.
823
-
824
822
!!! note
825
823
826
824
There are a few other ways we could achieve a similar result, including some more elegant ones like the `count()` operator, but this allows us to show how to handle multiple outputs, which is what we care about.
Copy file name to clipboardExpand all lines: docs/hello_nextflow/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ The rise of big data has made it increasingly necessary to be able to analyze an
12
12
13
13
During this training, you will be introduced to Nextflow in a series of complementary hands-on workshops.
14
14
15
-
Let's get started! Click on the "Open in GitHub Codespaces" button below.
15
+
Let's get started! Click on the "Open in GitHub Codespaces" button below to launch the training environment (preferably in a separate tab), then read on while it loads.
16
16
17
17
[](https://codespaces.new/nextflow-io/training?quickstart=1&ref=master)
Copy file name to clipboardExpand all lines: docs/nf4_science/genomics/index.md
+2-9Lines changed: 2 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,9 @@ It builds on the [Hello Nextflow](../../hello_nextflow/) beginner training and d
11
11
12
12
Specifically, this course demonstrates how to implement a simple variant calling pipeline with [GATK](https://gatk.broadinstitute.org/) (Genome Analysis Toolkit), a widely used software package for analyzing high-throughput sequencing data.
13
13
14
-
!!! note
14
+
Let's get started! Click on the "Open in GitHub Codespaces" button below to launch the training environment (preferably in a separate tab), then read on while it loads.
15
15
16
-
Don't worry if you're not familiar with GATK specifically.
17
-
We'll summarize the necessary concepts as we go, and the workflow implementation principles we demonstrate here apply broadly to any command line tool that processes genomics data.
16
+
[](https://codespaces.new/nextflow-io/training?quickstart=1&ref=master)
18
17
19
18
## Learning objectives
20
19
@@ -40,9 +39,3 @@ The course assumes some minimal familiarity with the following:
40
39
- Foundational Nextflow concepts and tooling covered in the [Hello Nextflow](../../hello_nextflow/) beginner training.
41
40
42
41
For technical requirements and environment setup, see the [Environment Setup](../../envsetup/) mini-course.
43
-
44
-
## Get started
45
-
46
-
To get started, open the training environment by clicking the 'Open in GitHub Codespaces' button below.
47
-
48
-
[](https://codespaces.new/nextflow-io/training?quickstart=1&ref=master)
Copy file name to clipboardExpand all lines: docs/nf4_science/rnaseq/00_orientation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
The training environment contains all the software, code and data necessary to work through this training course, so you don't need to install anything yourself.
4
4
However, you do need a (free) account to log in, and you should take a few minutes to familiarize yourself with the interface.
5
5
6
-
If you have not yet done so, please follow [this link](../../envsetup/) before going any further.
6
+
If you have not yet done so, please the [Environment Setup](../../envsetup/) mini-course before going any further.
Copy file name to clipboardExpand all lines: docs/nf4_science/rnaseq/index.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,23 @@ It builds on the [Hello Nextflow](../../hello_nextflow/) beginner training and d
11
11
12
12
Specifically, this course demonstrates how to implement a simple bulk RNAseq processing pipeline to trim adapter sequences, align the reads to a genome reference and performs quality control (QC) at several stages.
13
13
14
+
Let's get started! Click on the "Open in GitHub Codespaces" button below to launch the training environment (preferably in a separate tab), then read on while it loads.
15
+
16
+
[](https://codespaces.new/nextflow-io/training?quickstart=1&ref=master)
17
+
14
18
## Learning objectives
15
19
16
20
By working through this course, you will learn how to apply foundational Nextflow concepts and tooling to a typical RNAseq use case.
17
21
18
22
By the end of this workshop you will be able to:
19
23
20
24
- Write a linear workflow to apply basic RNAseq processing and QC methods
21
-
- Handle domain-specific files such as FastQ and reference genome resources appropriately
25
+
- Handle domain-specific files such as FASTQ and reference genome resources appropriately
22
26
- Handle single-end and paired-end sequencing data
23
27
- Leverage Nextflow's dataflow paradigm to parallelize per-sample RNAseq processing
28
+
- Aggregate QC reports across multiple steps and samples using relevant channel operators
29
+
24
30
<!-- TODO
25
-
- Implement **[quality control aggregation??]** using relevant channel operators
26
31
- Configure pipeline execution and manage and optimize resource allocations
27
32
- Implement per-step and end-to-end pipeline tests that handle RNAseq-specific idiosyncrasies appropriately
28
33
-->
@@ -37,9 +42,3 @@ The course assumes some minimal familiarity with the following:
37
42
- Foundational Nextflow concepts and tooling covered in the [Hello Nextflow](../../hello_nextflow/) beginner training.
38
43
39
44
For technical requirements and environment setup, see the [Environment Setup](../../envsetup/) mini-course.
40
-
41
-
## Get started
42
-
43
-
To get started, open the training environment by clicking the 'Open in GitHub Codespaces' button below.
44
-
45
-
[](https://codespaces.new/nextflow-io/training?quickstart=1&ref=master)
0 commit comments