Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docs/hello_nextflow/07_hello_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ We're going to be working with a clean set of project files inside the project d
### 0.1. Explore the `hello-modules` directory

Let's move into the project directory.
If you're continuing on directly from Part 5, you'll need to move up one directory first.

```bash
cd hello-modules
```

!!! warning

If you're continuing on directly from Part 5, you'll need to move up one directory first.
```
cd ../hello-modules
```

The `hello-modules` directory has the same content and structure that you're expected to end up with in `hello-config` on completion of Part 5.

```console title="Directory contents"
Expand Down Expand Up @@ -94,7 +100,7 @@ Learn how to create your first module following conventions inspired by the nf-c
From a technical standpoint, you can create a module simply by copying the process definition into its own file, and you can name that file anything you want.
However, the Nextflow community has adopted certain conventions for code organization, influenced in large part by the [nf-core](https://nf-co.re) project (which we'll cover later in this training series).

The convention for process modules is that the process definition should be written to a standalone file named `main.nf`, stored in a directory structure with three to four levels:
The convention for Nextflow modules is that the process definition should be written to a standalone file named `main.nf`, stored in a directory structure with three to four levels:

```console title="Directory structure"
modules
Expand Down Expand Up @@ -187,12 +193,11 @@ include { <MODULE_NAME> } from './modules/local/<toolkit>>/<tool>/main.nf'

Let's insert that above the workflow block and fill it out appropriately.

````groovy title="hello-modules/main.nf" linenums="73"
_Before:_

```groovy title="hello-modules/main.nf" linenums="73"
workflow {
````
```

_After:_

Expand All @@ -208,7 +213,7 @@ workflow {
We're running the workflow with essentially the same code and inputs as before, so let's add the `-resume` flag and see what happens.

```bash
nextflow run main.nf -profile my_laptop,demo
nextflow run main.nf -profile my_laptop,demo -resume
```

Sure enough, Nextflow recognizes that it's still all the same work to be done, even if the code is split up into multiple files.
Expand Down
5 changes: 1 addition & 4 deletions docs/hello_nextflow/08_hello_nf-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ And it also means that when you assemble a new workflow from existing modules th
In this part of the training, we're going to show you how to use [**nf-test**](https://www.nf-test.com/), a testing framework that integrates well with Nextflow and makes it straightforward to add both module-level and workflow-level tests to your pipeline.
For more background information about nf-test, we recommend you read [this blog post](https://nextflow.io/blog/2024/nf-test-in-nf-core.html).

!!!note
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the blog post on Sanity to display both authors, as we had in the Nextflow Blog before.


This part of the training was developed in collaboration with Sateesh Peri, who implemented all the tests.

---

## 0. Warmup
Expand Down Expand Up @@ -979,6 +975,7 @@ test("family_trio [vcf] [idx]") {
"""
}
}
}
```

### 3.4. Use content assertions
Expand Down
25 changes: 14 additions & 11 deletions docs/hello_nextflow/09_hello_nf-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Whenever you're ready, run the command:
nextflow pull nf-core/demo
```

Nextflow will `pull` the pipeline's default GitHub branch
Nextflow will `pull` the pipeline's default GitHub branch.
For nf-core pipelines with a stable release, that will be the master branch.
You select a specific branch with `-r`; we'll cover that later.

Expand All @@ -59,7 +59,7 @@ Checking nf-core/demo ...
```

To be clear, you can do this with any Nextflow pipeline that is appropriately set up in GitHub, not just nf-core pipelines.
However nf-core is the largest open collection of Nextflow pipelines.
However nf-core is the largest open curated collection of Nextflow pipelines.

!!!tip

Expand Down Expand Up @@ -108,15 +108,18 @@ The `test` profile for `nf-core/demo` is shown below:
----------------------------------------------------------------------------------------
*/

process {
resourceLimits = [
cpus: 4,
memory: '15.GB',
time: '1.h'
]
}

params {
config_profile_name = 'Test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = '6.GB'
max_time = '6.h'

// Input data
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/viralrecon/samplesheet/samplesheet_test_illumina_amplicon.csv'

Expand All @@ -137,11 +140,11 @@ nextflow run nf-core/demo -profile docker,test --outdir results
!!! hint "Changing Nextflow version"

Depending on the nextflow version you have installed, this command might fail due to a version mismatch.
If that happens, you can temporarily run the pipeline with a different version than you have installed by adding NXF_VER=<version> to the start of your command as shown below:
If that happens, you can temporarily run the pipeline with a different version than you have installed by adding `NXF_VER=version` to the start of your command as shown below:

```bash
NXF_VER=24.09.2-edge nextflow run nf-core/demo -profile docker,test --outdir results
```
```bash
NXF_VER=24.09.2-edge nextflow run nf-core/demo -profile docker,test --outdir results
```

Here's the console output from the pipeline:

Expand Down
Loading