nf-core / nf-core/modules

Use `eval` to collect version

Open
#5,834 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Nextflow
Stars
429
Forks
1.1k
Avg merge
1d 6h
Merged PRs (30d)
153

Description

Nextflow 24.02.0-edge brings with it two new features which should give much cleaner syntax for collecting tool versions: channel topics using topic (see https://github.com/nf-core/modules/issues/4517) and eval. They are designed to work together nicely, but are technically separate features.

The blog post contains a basic example of how this can be used to collect versions:

process FASTQC {
  input:
  tuple val(meta), path(reads)

  output:
  tuple val(meta), path('*.html'), emit: html
  tuple val("${task.process}"), val('fastqc'), eval('fastqc --version'), topic: versions 

  """
  fastqc $reads
  """
}

workflow {
  Channel.topic('versions') 
    | unique()
    | collectFile(name: 'collated_versions.yml')
    | CUSTOM_DUMPSOFTWAREVERSIONS
}

Needs some thought about how we approach these changes - may be best to do a bulk change everywhere in one go, as it affects multiple code locations (modules and pipelines).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Nextflow eval documentation, blog example, and the existing version-collection patterns across the modules and pipelines. Identify all affected locations, then verify that the migrated outputs collect into the expected collated_versions.yml flow and that the relevant module and pipeline checks still pass.

Written by the indexing model from the issue text.

Assessment

Domain
data-engineering, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.