Skip to content

Commit 206ed1b

Browse files
Merge branch 'master' into i18n/hello-world-hello-nextflow
2 parents c65e0aa + d20500f commit 206ed1b

File tree

234 files changed

+6402
-801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+6402
-801
lines changed

.devcontainer/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM ghcr.io/nextflow-io/training:latest
2+
3+
ENV NXF_VER=24.10.0
4+
ENV NXF_EDGE=0

.devcontainer/devcontainer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
22
"name": "nfcore",
3-
"image": "ghcr.io/nextflow-io/training:latest",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": ".."
6+
},
47
"remoteUser": "gitpod",
58
"features": {
69
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
710
},
11+
"workspaceFolder": "${localWorkspaceFolder}",
12+
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
813
"remoteEnv": {
914
"NXF_HOME": "/workspaces/.nextflow",
1015
"HOST_PROJECT_PATH": "${localWorkspaceFolder}"
@@ -32,5 +37,6 @@
3237
"label": "Application",
3338
"onAutoForward": "openPreview"
3439
}
35-
}
40+
},
41+
"postCreateCommand": "mkdir -p /workspace && ln -s /workspaces /workspace/gitpod"
3642
}

.github/gitpod.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ RUN curl -fSL https://github.com/seqeralabs/tower-agent/releases/latest/download
4747
USER gitpod
4848

4949
# Uncomment if we need to pin the Nextflow version
50-
ENV NXF_EDGE=1
51-
ENV NXF_VER=24.02.0-edge
50+
ENV NXF_EDGE=0
51+
ENV NXF_VER=24.10.0
5252

5353
# Install nextflow, nf-core, Mamba, and pytest-workflow
5454
RUN conda config --add channels defaults && \

.gitpod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ tasks:
2929
command: docker pull -q nextflow/rnaseq-nf
3030

3131
- name: Start Nextflow Tutorial
32+
env:
33+
NXF_HOME: "/workspace/gitpod/.nextflow"
3234
command: |
3335
cd hello-nextflow
3436
source $HOME/.bashrc

docs/advanced/configuration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This is an aspect of Nextflow that can be confusing. There are multiple ways of
44

55
This gives us two complications:
66

7-
- At which location should I be loading a configuration value?
8-
- Given a particular parameter, how do I know where it was set?
7+
- At which location should I be loading a configuration value?
8+
- Given a particular parameter, how do I know where it was set?
99

1010
## Precedence
1111

@@ -152,15 +152,15 @@ The most common use for dynamic process directives is to enable tasks that fail
152152

153153
To enable this, two directives are needed:
154154

155-
- `maxRetries`
156-
- `errorStrategy`
155+
- `maxRetries`
156+
- `errorStrategy`
157157

158158
The `errorStrategy` directive determines what action Nextflow should take in the event of a task failure (a non-zero exit code). The available options are:
159159

160-
- `terminate`: Nextflow terminates the execution as soon as an error condition is reported. Pending jobs are killed (default)
161-
- `finish`: Initiates an orderly pipeline shutdown when an error condition is raised, waiting the completion of any submitted job.
162-
- `ignore`: Ignores processes execution errors.
163-
- `retry`: Re-submit for execution a process returning an error condition.
160+
- `terminate`: Nextflow terminates the execution as soon as an error condition is reported. Pending jobs are killed (default)
161+
- `finish`: Initiates an orderly pipeline shutdown when an error condition is raised, waiting the completion of any submitted job.
162+
- `ignore`: Ignores processes execution errors.
163+
- `retry`: Re-submit for execution a process returning an error condition.
164164

165165
If the `errorStrategy` is "retry", then it will retry up to the value of `maxRetries` times.
166166

docs/advanced/grouping.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ process GenotypeOnInterval {
256256
tuple val(meta), path(bam), path(bed)
257257
258258
output:
259-
tuple val(meta), path("genotyped.bam")
259+
tuple val(meta), path("genotyped.vcf")
260260
261-
"cat $bam $bed > genotyped.bam"
261+
"cat $bam $bed > genotyped.vcf"
262262
}
263263
```
264264

@@ -282,12 +282,12 @@ Finally, we can combine these genotyped bams back using `groupTuple` and another
282282
```groovy linenums="1"
283283
process MergeGenotyped {
284284
input:
285-
tuple val(meta), path("input/in_*_.bam")
285+
tuple val(meta), path("input/in_*_.vcf")
286286
287287
output:
288-
tuple val(meta), path("merged.genotyped.bam")
288+
tuple val(meta), path("merged.genotyped.vcf")
289289
290-
"cat input/*.bam > merged.genotyped.bam"
290+
"cat input/*.vcf > merged.genotyped.vcf"
291291
}
292292
```
293293

@@ -331,12 +331,12 @@ MapReads( samples, reference )
331331
This will return us six bam files - a tumor and normal pair for each of the three samples:
332332

333333
```output title="Final channel output"
334-
[[id:sampleB, type:normal], merged.genotyped.bam]
335-
[[id:sampleB, type:tumor], merged.genotyped.bam]
336-
[[id:sampleA, type:normal], merged.genotyped.bam]
337-
[[id:sampleA, type:tumor], merged.genotyped.bam]
338-
[[id:sampleC, type:normal], merged.genotyped.bam]
339-
[[id:sampleC, type:tumor], merged.genotyped.bam]
334+
[[id:sampleB, type:normal], merged.genotyped.vcf]
335+
[[id:sampleB, type:tumor], merged.genotyped.vcf]
336+
[[id:sampleA, type:normal], merged.genotyped.vcf]
337+
[[id:sampleA, type:tumor], merged.genotyped.vcf]
338+
[[id:sampleC, type:normal], merged.genotyped.vcf]
339+
[[id:sampleC, type:tumor], merged.genotyped.vcf]
340340
```
341341

342342
If we would like to save the output of our `MergeGenotyped` process, we can "publish" the outputs of a process using the `publishDir` directive. We will cover this in more detail on day 2, but try modifying the `MergeGenotyped` process to include the directive:
@@ -346,52 +346,54 @@ process MergeGenotyped {
346346
publishDir 'results/genotyped'
347347
348348
input:
349-
tuple val(meta), path("input/in_*_.bam")
349+
tuple val(meta), path("input/in_*_.vcf")
350350
351351
output:
352-
tuple val(meta), path("merged.genotyped.bam")
352+
tuple val(meta), path("merged.genotyped.vcf")
353353
354-
"cat input/*.bam > merged.genotyped.bam"
354+
"cat input/*.vcf > merged.genotyped.vcf"
355355
}
356356
```
357357

358358
This will publish all of the files in the `output` block of this process to the `results/genotyped` directory.
359359

360360
!!! exercise
361-
Inspect the contents of the `results` directory. Does this match what you were expecting? What is missing here?
361+
362+
Inspect the contents of the `results` directory. Does this match what you were expecting? What is missing here?
362363

363364
Can you modify the `MergeGenotyped` process to ensure we are capturing all of the expected output files?
364365

365366
??? solution
367+
366368
One solution might be to modify the `script` block to ensure that each file has a unique name:
367369

368370
```groovy
369371
process MergeGenotyped {
370372
publishDir 'results/genotyped'
371373

372374
input:
373-
tuple val(meta), path("input/in_*_.bam")
375+
tuple val(meta), path("input/in_*_.vcf")
374376

375377
output:
376-
tuple val(meta), path("*.bam")
378+
tuple val(meta), path("*.vcf")
377379

378-
"cat input/*.bam > ${meta.id}.${meta.type}.genotyped.bam"
380+
"cat input/*.vcf > ${meta.id}.${meta.type}.genotyped.vcf"
379381
}
380382
```
381383

382384
Another option might be to use the `saveAs` argument to the `publishDir` directive:
383385

384386
```groovy
385387
process MergeGenotyped {
386-
publishDir 'results/genotyped', saveAs: { "${meta.id}.${meta.type}.genotyped.bam" }
388+
publishDir 'results/genotyped', saveAs: { "${meta.id}.${meta.type}.genotyped.vcf" }
387389

388390
input:
389-
tuple val(meta), path("input/in_*_.bam")
391+
tuple val(meta), path("input/in_*_.vcf")
390392

391393
output:
392-
tuple val(meta), path("merged.genotyped.bam")
394+
tuple val(meta), path("merged.genotyped.vcf")
393395

394-
"cat input/*.bam > merged.genotyped.bam"
396+
"cat input/*.vcf > merged.genotyped.vcf"
395397
}
396398
```
397399

docs/advanced/index.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ Let's get started!
1616

1717
By the end of this course you should:
1818

19-
- Describe commonly used and well understood operators
20-
- Apply good practices for the propagation of metadata
21-
- Group and split channels
22-
- Apply Groovy helper classes to Nextflow scripts
23-
- Sensibly structure workflows
24-
- Apply layers of configuration to a workflow
19+
- Describe commonly used and well understood operators
20+
- Apply good practices for the propagation of metadata
21+
- Group and split channels
22+
- Apply Groovy helper classes to Nextflow scripts
23+
- Sensibly structure workflows
24+
- Apply layers of configuration to a workflow
2525

2626
## Audience & prerequisites
2727

2828
Please note that this is **not** a beginner's workshop and familiarity with Nextflow, the command line, and common file formats is assumed.
2929

3030
**Prerequisites**
3131

32-
- A GitHub account
33-
- Experience with command line
34-
- Familiarity with Nextflow and Groovy
35-
- An understanding of common file formats
32+
- A GitHub account
33+
- Experience with command line
34+
- Familiarity with Nextflow and Groovy
35+
- An understanding of common file formats
3636

3737
## Follow the training video
3838

docs/advanced/introduction.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ Let's get started!
1414

1515
By the end of this course you should:
1616

17-
- Describe commonly used and well understood operators
18-
- Apply good practices for the propagation of metadata
19-
- Group and split channels
20-
- Apply Groovy helper classes to Nextflow scripts
21-
- Sensibly structure workflows
22-
- Apply layers of configuration to a workflow
17+
- Describe commonly used and well understood operators
18+
- Apply good practices for the propagation of metadata
19+
- Group and split channels
20+
- Apply Groovy helper classes to Nextflow scripts
21+
- Sensibly structure workflows
22+
- Apply layers of configuration to a workflow
2323

2424
## Audience & prerequisites
2525

2626
Please note that this is **not** a beginner's workshop and familiarity with Nextflow, the command line, and common file formats is assumed.
2727

2828
**Prerequisites**
2929

30-
- A GitHub account
31-
- Experience with command line
32-
- Familiarity with Nextflow and Groovy
33-
- An understanding of common file formats
30+
- A GitHub account
31+
- Experience with command line
32+
- Familiarity with Nextflow and Groovy
33+
- An understanding of common file formats
3434

3535
## Follow the training video
3636

docs/advanced/metadata.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
A central challenge in a lot of batch-style computation is how to ensure the metadata describing a file remains with the file. Two good rules for handling metadata in Nextflow are:
44

5-
- Metadata should be explicit - be extremely wary of metadata encoded in filenames
6-
- Metadata should travel through channels with the data in a tuple element.
5+
- Metadata should be explicit - be extremely wary of metadata encoded in filenames
6+
- Metadata should travel through channels with the data in a tuple element.
77

88
## Metadata Import
99

docs/advanced/support.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ title: Support
33
description: Advanced Nextflow Training Workshop
44
---
55

6-
- Nextflow official documentation is available at [www.nextflow.io/docs/latest](https://www.nextflow.io/docs/latest/)
7-
- If you have questions, ask on the Seqera Community Forum at [http://community.seqera.io/](http://community.seqera.io/)
8-
- If you want to chat about Nextflow or plugin development, check the Nextflow Slack at [https://www.nextflow.io/slack-invite.html](https://www.nextflow.io/slack-invite.html)
6+
- Nextflow official documentation is available at [www.nextflow.io/docs/latest](https://www.nextflow.io/docs/latest/)
7+
- If you have questions, ask on the Seqera Community Forum at [http://community.seqera.io/](http://community.seqera.io/)
8+
- If you want to chat about Nextflow or plugin development, check the Nextflow Slack at [https://www.nextflow.io/slack-invite.html](https://www.nextflow.io/slack-invite.html)

0 commit comments

Comments
 (0)