Skip to content

Commit

Permalink
Merge pull request #1393 from mahesh-panchal/add_when
Browse files Browse the repository at this point in the history
Allow conditional process execution from configuration
  • Loading branch information
mahesh-panchal authored Feb 4, 2022
2 parents 6452afc + 632f7a6 commit ff5286e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,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]

Expand Down
7 changes: 5 additions & 2 deletions nf_core/module-template/modules/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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 -%}
Expand Down

0 comments on commit ff5286e

Please sign in to comment.