Skip to content

New RFC: Allow ext.suffix as an official ext. value allowed for use in nf-core/modules #69

@SPPearce

Description

@SPPearce

Have you read the RFC docs?

  • Yes, I have read and understood the RFC docs

Summary

I suggest that we officially allow the use of ext.suffix inside nf-core/modules, updating the documentation accordingly.

Champion

No response

Background & Motivation

Following the discussion in #65 about using a ext. value for memory management, I took a look at what other ext. values we have in modules.

Currently we have as 'official':

ext.args
ext.args{2..5}
ext.prefix
ext.singularity_pull_docker_container
ext.when

We currently have ~25 modules that use ext.suffix as well as ext.prefix.
For example with a tool that takes as input both bam and cram files, and can generate either bam and cram files depending on the given file name, it is reasonable to assume you want the output file to be the same type most of the time, but allow for changing it:

    input:
    tuple val(meta), path(bam)

    script:
    def prefix = task.ext.prefix    ?: "${meta.id}"
    def suffix = task.ext.suffix    ?: "${bam.getExtension()}"
    """
    gatk AddOrReplaceReadGroups \\
        --INPUT ${bam} \\
        --OUTPUT ${prefix}.${suffix}
   """

Using a value channel for this is pretty clunky, particularly when there is a default, and this is just a counterpart to ext.prefix.

Note there are 15 modules using other wildcard ext. options, that should really be tidied up at some point.

Goals

  • Formalise what is being done in a number of modules
  • Update the guidelines to make it clear this is an acceptable use

Non-Goals

  • Don't allow proliferation of lots of additional other ext. fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    proposed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions