Skip to content

Refactor empty meta map pattern in main.nf #1723

@pinin4fjords

Description

@pinin4fjords

Description

There are approximately 17 occurrences of the empty meta map pattern `[ [:], ... ]` in `main.nf` where channels are constructed with an empty map as the meta element. For example:

```groovy
ch_fasta = Channel.value([ [:], file(params.fasta, checkIfExists: true) ])
```

This pattern is used because many nf-core modules expect a `[meta, file]` tuple, but at the pipeline level there's no meaningful per-sample metadata for reference files.

Proposal

Consider refactoring to reduce repetition, for example:

  • A helper function like `refChannel(path)` that wraps the pattern
  • Or using Nextflow's native value channels with map operators

This would improve readability and reduce the chance of inconsistencies.

Context

Raised during review of PR #1717 (3.23.0 release).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions