ext properties/keys

Ext properties or keys are special process directives (See: ext directive ) that insert strings into the module scripts. For example, an nf-core module uses the string assigned to ext.args ( or ext.args2, ext.args3, … ) to insert tool specific options in a module script:


The configuration

process {
  withName: 'TOOL_SUBTOOL' {
    ext.args = '-T -K'

inserts the string -T -K as options to the module script:

process TOOL_SUBTOOL {
  tuple val(meta), path(bam)
  tuple val(meta), path("*.log"), emit: log
  path "versions.yml",            emit: versions
  def args   = task.ext.args ?: ''          // If ext.args is defined assign it to args
  def prefix = task.ext.prefix ?: meta.id   // If ext.prefix is defined assign it to prefix, otherwise assign meta.id value
  tool subtool $args $bam > ${prefix}.log

so the script becomes:

#! /usr/env/bin bash
tool subtool -T -K test.bam > test.log

The following table lists the available keys commonly used in nf-core modules.

ext.argsAdditional arguments appended to command in module.
ext.args2Second set of arguments appended to command in module.
ext.args3Third set of arguments appended to command in module.
ext.prefixFile name prefix for output files.

The order of the numeric ID of args must match the order of the tools as used in the module.

To see some more advanced examples of these keys in use see: