Skip to content

Use eval to collect version #5834

@ewels

Description

@ewels

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 #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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions