From e8716969cf64c439fbe66d1a7a7a5bf419871e2e Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Mon, 28 Oct 2024 17:17:15 +0100 Subject: [PATCH 1/5] Minor fixes to Hello Modules --- docs/hello_nextflow/07_hello_modules.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/hello_nextflow/07_hello_modules.md b/docs/hello_nextflow/07_hello_modules.md index 84dafcadd4..68365a74a2 100644 --- a/docs/hello_nextflow/07_hello_modules.md +++ b/docs/hello_nextflow/07_hello_modules.md @@ -28,12 +28,17 @@ 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 ``` +!!! note + 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" @@ -94,7 +99,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 @@ -187,7 +192,6 @@ include { } from './modules/local/>//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" @@ -208,7 +212,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. From b8a57ed2cd69daaa43804d02a8e706a2b57e4abb Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Tue, 29 Oct 2024 00:50:22 +0100 Subject: [PATCH 2/5] Last touches to hello Modules/nf-test Signed-off-by: Marcel Ribeiro-Dantas --- docs/hello_nextflow/07_hello_modules.md | 2 +- docs/hello_nextflow/08_hello_nf-test.md | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/hello_nextflow/07_hello_modules.md b/docs/hello_nextflow/07_hello_modules.md index 68365a74a2..1fbf2e1c1d 100644 --- a/docs/hello_nextflow/07_hello_modules.md +++ b/docs/hello_nextflow/07_hello_modules.md @@ -33,7 +33,7 @@ Let's move into the project directory. cd hello-modules ``` -!!! note +!!! warning If you're continuing on directly from Part 5, you'll need to move up one directory first. ``` cd ../hello-modules diff --git a/docs/hello_nextflow/08_hello_nf-test.md b/docs/hello_nextflow/08_hello_nf-test.md index a5924a6e39..ff2a3a2bd0 100644 --- a/docs/hello_nextflow/08_hello_nf-test.md +++ b/docs/hello_nextflow/08_hello_nf-test.md @@ -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 - - This part of the training was developed in collaboration with Sateesh Peri, who implemented all the tests. - --- ## 0. Warmup @@ -979,6 +975,7 @@ test("family_trio [vcf] [idx]") { """ } } +} ``` ### 3.4. Use content assertions From be722c887727b6c9a3fabcac24ac3aa02c37ba4e Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Tue, 29 Oct 2024 00:51:20 +0100 Subject: [PATCH 3/5] Fix linting --- docs/hello_nextflow/07_hello_modules.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/hello_nextflow/07_hello_modules.md b/docs/hello_nextflow/07_hello_modules.md index 1fbf2e1c1d..4a52568ff5 100644 --- a/docs/hello_nextflow/07_hello_modules.md +++ b/docs/hello_nextflow/07_hello_modules.md @@ -34,10 +34,9 @@ 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 - ``` +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. @@ -196,7 +195,7 @@ _Before:_ ```groovy title="hello-modules/main.nf" linenums="73" workflow { -```` +``` _After:_ From cac2362dda490f81af7637fff998bdf8a49a1e4f Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Tue, 29 Oct 2024 01:07:53 +0100 Subject: [PATCH 4/5] Fix warning callout --- docs/hello_nextflow/07_hello_modules.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/hello_nextflow/07_hello_modules.md b/docs/hello_nextflow/07_hello_modules.md index 4a52568ff5..3ec20e5268 100644 --- a/docs/hello_nextflow/07_hello_modules.md +++ b/docs/hello_nextflow/07_hello_modules.md @@ -34,9 +34,11 @@ 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 - ` + + 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. From f80312af21be4476358fb66df9b1ad108ceaa19c Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Tue, 29 Oct 2024 01:25:41 +0100 Subject: [PATCH 5/5] Fix nf-core part of Hello Nextflow --- docs/hello_nextflow/09_hello_nf-core.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/hello_nextflow/09_hello_nf-core.md b/docs/hello_nextflow/09_hello_nf-core.md index 17590df704..5cc7a7950e 100644 --- a/docs/hello_nextflow/09_hello_nf-core.md +++ b/docs/hello_nextflow/09_hello_nf-core.md @@ -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. @@ -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 @@ -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' @@ -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= 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: