From fb834036b0a1f30f32ba73cf31601db3c706c186 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Thu, 3 Feb 2022 10:58:46 +0100 Subject: [PATCH 1/2] Allow conditional process execution from configuration --- nf_core/module-template/modules/main.nf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nf_core/module-template/modules/main.nf b/nf_core/module-template/modules/main.nf index d152e970b3..8a61ea32d1 100644 --- a/nf_core/module-template/modules/main.nf +++ b/nf_core/module-template/modules/main.nf @@ -5,7 +5,7 @@ // TODO nf-core: A module file SHOULD only define input and output files as command-line parameters. // All other parameters MUST be provided using the "task.ext" directive, see here: // https://www.nextflow.io/docs/latest/process.html#ext -// where "task.ext" is a string. +// where "task.ext" is a string. // Any parameters that need to be evaluated in the context of a particular sample // e.g. single-end/paired-end data MUST also be defined and evaluated appropriately. // TODO nf-core: Software that can be piped together SHOULD be added to separate module files @@ -18,7 +18,7 @@ process {{ tool_name_underscore|upper }} { tag {{ '"$meta.id"' if has_meta else "'$bam'" }} label '{{ process_label }}' - + // TODO nf-core: List required Conda package(s). // Software MUST be pinned to channel (i.e. "bioconda"), version (i.e. "1.10"). // For Conda, the build (i.e. "h9402c20_2") must be EXCLUDED to support installation on different operating systems. @@ -43,6 +43,9 @@ process {{ tool_name_underscore|upper }} { // TODO nf-core: List additional required output channels/values here path "versions.yml" , emit: versions + when: + task.ext.when == null || task.ext.when + script: def args = task.ext.args ?: '' {% if has_meta -%} From 632f7a614a0c30efabd5026729c8b9c997865ba7 Mon Sep 17 00:00:00 2001 From: Mahesh Binzer-Panchal Date: Thu, 3 Feb 2022 12:02:02 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b3e816059..a721316a3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ * `input:` / `output:` not being specified in module * Allow for containers from other biocontainers resource as defined [here](https://github.com/nf-core/modules/blob/cde237e7cec07798e5754b72aeca44efe89fc6db/modules/cat/fastq/main.nf#L7-L8) * Fixed traceback when using `stageAs` syntax as defined [here](https://github.com/nf-core/modules/blob/cde237e7cec07798e5754b72aeca44efe89fc6db/modules/cat/fastq/main.nf#L11) +* Allow conditional process execution from the configuration file ([#1393](https://github.com/nf-core/tools/pull/1393)) ## [v2.2 - Lead Liger](https://github.com/nf-core/tools/releases/tag/2.2) - [2021-12-14]