Skip to content

Commit 7532b1f

Browse files
Update nf-customize
1 parent af47ae7 commit 7532b1f

File tree

5 files changed

+118
-91
lines changed

5 files changed

+118
-91
lines changed

docs/nf_customize/01_orientation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ In this folder you will find three pairs of zipped fastq files (`*.fastq.gz`) in
2525
└── samplesheet.csv
2626
```
2727

28-
Each file will be used in this training module.
28+
These files will be used in this training module.
2929

3030
!!! question "Exercise"
3131

32-
Open the [Gitpod training environment](https://gitpod.io/#https://github.com/nextflow-io/training) and use the following command to switch to the `nf-customize` folder. View the files in this folder using the `tree` command:
32+
Open the [Gitpod training environment](https://gitpod.io/#https://github.com/nextflow-io/training) and switch to the `nf-customize` folder. View the files in this folder using the `tree` command:
3333

3434
```bash
3535
cd /workspace/gitpod/nf-customize

docs/nf_customize/02_nf-core.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ nf-core is published in Nature Biotechnology: [Nat Biotechnol 38, 276–278 (202
2727

2828
## nf-core pipelines
2929

30-
There are currently >100 nf-core pipelines. These pipelines are at various stages of development with 60 released, 34 under development, and 11 archived (April 2024).
30+
There are currently 113 nf-core pipelines. These pipelines are at various stages of development, with 68 released, 32 under development, and 13 archived (October 2024).
3131

32-
The [nf-core website](https://nf-co.re/) contains a full list of pipelines, as well as their documentation, which can be explored.
32+
The [nf-core website](https://nf-co.re/) hosts a full list of pipelines, as well as their documentation, which can be explored.
3333

3434
![nf-core logo](img/pipelines.png)
3535

@@ -40,49 +40,57 @@ Each released pipeline has a dedicated page that includes 6 documentation sectio
4040
- **Parameters:** Grouped pipeline parameters with descriptions
4141
- **Output:** Descriptions and examples of the expected output files
4242
- **Results:** Example output files generated from the full test dataset
43-
- **Releases & Statistics:** pipeline version history and statistics
43+
- **Releases & Statistics:** Pipeline version history and statistics
4444

4545
Each section should be explored by a user to understand what the pipeline does and how it can be configured.
4646

47+
!!! question "Exercise"
48+
49+
Explore the nf-core website to see the range of resources available.
50+
4751
## Pulling an nf-core pipeline
4852

49-
Unless you intend to develop an nf-core pipeline independently, you do not need to clone a copy of a pipeline. Instead, you can use Nextflow’s `pull` command:
53+
Unless you intend to develop an nf-core pipeline independently, you do not need to clone a copy of a pipeline.
54+
55+
Instead, use Nextflow’s `pull` command:
5056

5157
```bash
5258
nextflow pull nf-core/demo
5359
```
5460

5561
!!! note "The `nextflow run` command"
5662

57-
The `nextflow run` command will also automatically `pull` the pipeline if it had not been pulled.
63+
The `nextflow run` command will also automatically `pull` the pipeline.
5864

59-
Nextflow will `pull` the pipelines default GitHub branch if a pipeline version is not specified. This will be the master branch for nf-core pipelines with a stable release.
65+
Nextflow will `pull` the pipelines default GitHub branch if a pipeline version is not specified. The master branch is the default branch for nf-core pipelines with a stable release and the dev branch for pipelines that are still being developed.
6066

61-
nf-core pipelines use GitHub releases to tag stable versions of the code and software. You will always be able to execute different versions of a pipeline using the `-revision` or `-r` option.
67+
Pipelines pulled from GitHub using Nextflow are automatically stored in a Nextflow assets folder (default: `$HOME/.nextflow/assets/`).
68+
69+
nf-core pipelines use GitHub releases to tag stable versions of the code and software. You can execute different versions of a pipeline using the `-revision` or `-r` option.
6270

6371
Similarly, you can use the `-r` option to specify a specific GitHub branch. For example, the `dev` branch of the `nf-core/demo` pipeline could be pulled with the command:
6472

65-
```
73+
```bash
6674
nextflow pull nf-core/demo -r dev
6775
```
6876

69-
If updates to a remote pipeline have been made, the pull command can be used to update or revery your local copy.
77+
If updates to a remote pipeline have been made, run the pull command to update or revert your local copy.
7078

7179
!!! question "Exercise"
7280

73-
Use nextflow to pull the `nf-core/demo` pipeline:
81+
Pull the `nf-core/demo` pipeline:
7482

7583
```bash
7684
nextflow pull nf-core/demo
7785
```
7886

79-
Use the list command to view your cached pipelines:
87+
Use the `list` command to view your cached pipelines:
8088

8189
```bash
8290
nextflow list
8391
```
8492

85-
Pulled pipelines are stored in a hidden assets folder:
93+
View your pulled pipelines in the nextflow assets folder:
8694

8795
```bash
8896
ls $HOME/.nextflow/assets/

docs/nf_customize/03_execution.md

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

33
[`nf-core/demo`](https://nf-co.re/demo/) is a simple nf-core style pipeline for workshops and demonstrations.
44

5-
It was created using the nf-core template and is designed to run and configure quickly.
5+
It was created using the full nf-core template and is designed to run and configure quickly.
66

77
<figure class="excalidraw">
88
--8<-- "docs/nf_customize/img/subway.excalidraw.svg"
99
</figure>
1010

1111
The [`nf-core/demo`](https://nf-co.re/demo/) pipeline consists of three processes:
1212

13-
- ([`FASTQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)): Read QC
13+
- ([`FASTQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)): Read quality control
1414
- ([`SEQTK_TRIM`](https://github.com/lh3/seqtk)): Trim low quality bases from FastQ files
15-
- ([`MULTIQC`](http://multiqc.info/)): Present QC for raw reads
15+
- ([`MULTIQC`](http://multiqc.info/)): Present quality control reports for raw reads
1616

17-
[`nf-core/demo`](https://nf-co.re/demo/) takes a samplesheet that contains paths to fastq files as an input and will produce four output folders with a variety of logs and reports:
17+
[`nf-core/demo`](https://nf-co.re/demo/) takes a samplesheet that contains paths to FASTQ files as an input and will produce four output folders with logs and reports:
1818

1919
- `fastqc/`
2020
- `*_fastqc.html`: FastQC report containing quality metrics.
@@ -38,27 +38,27 @@ The documentation for the `nf-core/demo` pipeline can be found [on the nf-core/d
3838

3939
## Required inputs
4040

41-
Before running any nf-core pipeline you will need to check if there are any parameters that are required.
41+
Before running any nf-core pipeline you will need to check if any parameters are required.
4242

43-
You can view these on the pipelines parameters page.
43+
You can find required parameters on the pipelines parameters page.
4444

4545
The [parameters page of the `nf-core/demo` pipeline](https://nf-co.re/demo/dev/parameters) shows that this pipeline requires two parameters (`--input` and `--outdir`) to run.
4646

4747
![nf-core/demo parameters](img/demo-parameters.png)
4848

49-
Without these, the pipeline will not launch and nextflow will throw an error.
49+
Without these, the pipeline will not launch and will throw an error.
5050

5151
### `--input`
5252

53-
The `--input` parameter requires a path to comma-separated file containing information about the samples in the experiment.
53+
The `--input` parameter requires a path to comma-separated file (CSV) containing information about the samples in the experiment:
5454

5555
```bash
5656
--input 'path/to/samplesheet.csv'
5757
```
5858

5959
The [nf-core/demo usage documentation](https://nf-co.re/demo/dev/docs/usage/) describes the required `--input` as a comma-separated file (`.csv`). The `.csv` file must contain 3 columns with the headers `sample`, `fastq_1`, and `fastq_2`.
6060

61-
The samplesheet file may consist of both single- and paired-end data and may look something like the one below.
61+
The samplesheet file may consist of both single- and paired-end data and may look something like the one below:
6262

6363
```csv title="samplesheet.csv" linenums="1"
6464
sample,fastq_1,fastq_2
@@ -69,7 +69,7 @@ SAMPLE3_SE,path/to/sample3_R1.fastq.gz,
6969

7070
### `--outdir`
7171

72-
The `--output` parameter is used to name the output directory where the results will be saved. It takes a string as its input.
72+
The `--output` parameter is used to name the output directory where the results will be saved. It takes a string as its input:
7373

7474
```bash
7575
--output results
@@ -81,13 +81,13 @@ The `--output` parameter is used to name the output directory where the results
8181

8282
## Testing `nf-core/demo` with profiles
8383

84-
A profile is a set of configuration attributes that can be added to your execution command by using the `-profile` option.
84+
A profile is a set of configuration attributes that can be added to your execution command by using the `-profile` option:
8585

8686
```bash
8787
-profile <profile name>
8888
```
8989

90-
Configuration profiles are defined using the special scope `profile` within configuration files. Profiles group the attributes that belong to the same profile using a common prefix.
90+
Configuration profiles are defined using the special scope `profile` within configuration files. Profiles group the attributes that belong to the same profile using a common prefix:
9191

9292
```console title="example.config" linenums="1"
9393
profiles {
@@ -105,7 +105,7 @@ profiles {
105105

106106
Every nf-core pipeline comes with a `test` profile. This is a minimal set of configuration settings for the pipeline to run using a small test dataset that is hosted on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
107107

108-
As the `test` profile is expected to run it can be used to help diagnose local issues before you scale up your analysis.
108+
The `test` profile is expected to run and can be used to help diagnose local issues before you scale up your analysis.
109109

110110
The `test` profile for `nf-core/demo` is shown below:
111111

@@ -122,22 +122,24 @@ The `test` profile for `nf-core/demo` is shown below:
122122
----------------------------------------------------------------------------------------
123123
*/
124124
125+
process {
126+
resourceLimits = [
127+
cpus: 4,
128+
memory: '15.GB',
129+
time: '1.h'
130+
]
131+
}
132+
125133
params {
126134
config_profile_name = 'Test profile'
127135
config_profile_description = 'Minimal test dataset to check pipeline function'
128136
129-
// Limit resources so that this can run on GitHub Actions
130-
max_cpus = 2
131-
max_memory = '6.GB'
132-
max_time = '6.h'
133-
134137
// Input data
135138
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv'
136-
137139
}
138140
```
139141

140-
The `nf-core/demo` `test` profile already contains the input parameter (this will be explained in more detail shortly). This means that the `--input` parameter does not need to be added to the execution command. However, as the `outdir` parameter is not included in the `test` profile it must be added to the execution command using the `--outdir` flag.
142+
The `nf-core/demo` `test` profile already contains the input parameter (explained in more detail below). This means that the `--input` parameter does not need to be added to the execution command. However, the `outdir` parameter is not included in the `test` profile and must be added to the execution command using the `--outdir` flag.
141143

142144
```bash
143145
nextflow run nf-core/demo -profile test --outdir results
@@ -151,25 +153,27 @@ nextflow run nf-core/demo -profile test --outdir results
151153
nextflow run nf-core/demo -profile test --outdir results
152154
```
153155

154-
**This execution is expected to fail!**
156+
!!! warning "This execution is expected to fail!"
155157

156-
As the software required to run each process (e.g., seqtk) is not available in the Gitpod environment the exercise above is expected to fail.
158+
As the software required to run each process (e.g., seqtk) is not available in the Gitpod environment the exercise above is expected to fail:
157159

158160
```console
159161
Caused by:
160162
Process `NFCORE_DEMO:DEMO:SEQTK_TRIM (SAMPLE2_PE)` terminated with an error exit status (127)
161163
<truncated>
162164
```
163165

164-
Fortunately, nf-core pipelines come packed with directives for containers and environments that can be flexibly enabled using profiles for different software (e.g., `docker`, `singularity`, and `conda`).
166+
Fortunately, nf-core pipelines come packed with directives for containers and environments that can be flexibly enabled using profiles for different software (e.g., `docker`, `singularity`, and `conda`):
165167

166-
`-profile singularity`
168+
```bash
169+
-profile singularity
170+
```
167171

168172
In Gitpod, you can add the `singularity` profile to your execution command and Nextflow will download and enable Singularity software images to run each process.
169173

170174
The singularity profile is defined in the nextflow.config file in the main pipeline repository.
171175

172-
```groovy title="nextflow.config" linenums="120"
176+
```groovy title="nextflow.config" linenums="100"
173177
singularity {
174178
singularity.enabled = true
175179
singularity.autoMounts = true
@@ -179,44 +183,46 @@ singularity {
179183
shifter.enabled = false
180184
charliecloud.enabled = false
181185
apptainer.enabled = false
182-
}
186+
}
183187
```
184188

185189
!!! note "Multiple config files"
186190

187-
Multiple profiles can be included at execution by separating them with a comma (`,`), e.g., `-profile test,singularity`.
191+
Multiple profiles can be included by separating them with a comma (e.g., `-profile test,singularity`).
188192

189193
!!! question "Exercise"
190194

191-
Execute the command again, but this time with the singularity profile:
195+
Amend your run command by adding the singularity profile:
192196

193197
```bash
194198
nextflow run nf-core/demo -profile test,singularity --outdir results
195199
```
196200

197-
The `nf-core/demo` pipeline should now run successfully!
201+
The `nf-core/demo` pipeline should now run successfully!
202+
203+
!!! note
198204

199-
If you were running this tutorial you will need to have Singularity installed for this command to run.
205+
Singularity must be installed for this command to run.
200206

201207
## Using your own data
202208

203-
Instead of using the `test` profile you can use the `--input` parameter to choose your own samplesheet as an input.
209+
Instead of using the `test` profile you can use the `--input` parameter to choose your own sample sheet as an input.
204210

205211
As described above, the input is a CSV file with 3 columns and the headers `sample`, `fastq_1`, and `fastq_2`.
206212

207-
The pipeline will auto-detect whether a sample is single- or paired-end and if a sample has been sequenced more than once using the information provided in the samplesheet.
213+
The nf-core/demo pipeline will auto-detect whether a sample is single- or paired-end and if a sample has been sequenced more than once using the information provided in the sample sheet by default.
208214

209215
!!! question "Exercise"
210216

211-
Within the `data` folder there are three sets of paired-end reads for gut, liver, and lung samples. Create a samplesheet for this data.
217+
Create a sample sheet for the paired-end reads for gut, liver, and lung samples in the data folder:
212218

213-
First, create a `.csv` file named `samplesheet.csv`:
219+
1. Create a CSV file named `samplesheet.csv`:
214220

215221
```bash
216222
code samplesheet.csv
217223
```
218224

219-
Next, add the header line, and, for each sample, an id and the complete paths to the paired-end reads:
225+
2. Add the header line, and, for each sample, an id and the complete paths to the paired-end reads:
220226

221227
```csv title="samplesheet.csv" linenums="1"
222228
sample,fastq_1,fastq_2
@@ -225,21 +231,21 @@ The pipeline will auto-detect whether a sample is single- or paired-end and if a
225231
lung,/workspace/gitpod/nf-customize/data/lung_1.fastq.gz,/workspace/gitpod/nf-customize/data/lung_2.fastq.gz
226232
```
227233

228-
**Make sure you save this file in your working directory (`/workspace/gitpod/nf-customize/`)**
234+
!!! warning "Make sure you save this file in your working directory (`/workspace/gitpod/nf-customize/`)"
229235

230236
You can use you new samplesheet with the `--input` parameter in your execution command.
231237

232-
In this case, the other parameters in the test profile (e.g., `config_profile_name` and `max_cpus`) can be ignored as they are not explicitly required by the pipeline or in this Gitpod environment.
238+
In this case, the other parameters in the test profile (e.g., `config_profile_name`) can be ignored as they are not explicitly required by the pipeline or in this Gitpod environment.
233239

234240
!!! question "Exercise"
235241

236-
Execute the `nf-core/demo` pipeline with the `singularity` profile and your newly created samplesheet as your input.
242+
Run the `nf-core/demo` pipeline with the `singularity` profile and your newly created samplesheet as your input.
237243

238-
```
244+
```bash
239245
nextflow run nf-core/demo -profile singularity --input samplesheet.csv --outdir results
240246
```
241247

242-
The pipeline should run successfully!
248+
The pipeline should run successfully!
243249

244250
---
245251

0 commit comments

Comments
 (0)