Skip to content

Fix custom/resolvetaxonomy: malformed output filename for extensionless input - #12824

Merged
erikrikarddaniel merged 1 commit into
nf-core:masterfrom
erikrikarddaniel:resolvetaxonomy-extensionless-input
Aug 26, 2026
Merged

Fix custom/resolvetaxonomy: malformed output filename for extensionless input#12824
erikrikarddaniel merged 1 commit into
nf-core:masterfrom
erikrikarddaniel:resolvetaxonomy-extensionless-input

Conversation

@erikrikarddaniel

Copy link
Copy Markdown
Member

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • Broadcast software version numbers to topic: versions - See version_topics
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test custom/resolvetaxonomy --profile docker
      • nf-core modules test custom/resolvetaxonomy --profile singularity
      • nf-core modules test custom/resolvetaxonomy --profile conda

Description

Found while wiring custom/resolvetaxonomy (merged in #12817) into nf-core/phyloplace: its sequences output is named "*.resolved.${sequences.extension}", but Path.extension is '' (not null) when the input file has no extension at all -- e.g. a bare download URL whose path is just a numeric file id (.../files/47244067, no filename suffix). That produced a malformed "${prefix}.resolved." output name, matching nothing, so the process silently failed to produce a usable sequences output.

Fix: fall back to 'fasta' via sequences.extension ?: 'fasta'.

One thing worth flagging for other module authors: I first tried factoring this into a single def ext = sequences.extension ?: 'fasta' in the script: block and reusing ${ext} in the output: declaration (the same pattern def prefix = task.ext.prefix ?: ... uses everywhere) -- that's a compile-time error, `ext` is not defined. output: glob patterns can only reference input-bound variables (sequences, meta, etc.) directly, not script:-scoped def locals. Confirmed this empirically rather than assuming from the prefix precedent, since prefix itself is only ever used in script:/stub:, never in an output: pattern, in this module or apparently elsewhere. So the fallback is duplicated inline in script:, stub: and the output: glob itself.

Added a test case with a synthesized extension-less input file (no new fixture needed -- built inline in the test from the existing resolvetaxonomy_embedded.fasta fixture) covering the regression.

Ran nf-test test modules/nf-core/custom/resolvetaxonomy --profile docker (8/8 passing, including the new case) twice to confirm stability, and nf-core modules lint custom/resolvetaxonomy (clean). Docker only -- I have not run the singularity or conda profiles.

Generated by Claude

sequences.extension is '' (not the more Groovy-idiomatic null) when the
input file has no extension at all -- e.g. a download URL whose path is
just a numeric file id, with no filename suffix. That produced a
malformed "${prefix}.resolved." output name (matching nothing downstream)
instead of a real file.

Found while wiring this module into nf-core/phyloplace: its phylosearch
test samplesheet has exactly such a refseqfile (a Figshare download URL).

Fix falls back to 'fasta' via sequences.extension ?: 'fasta', inline in
the output declaration -- output: patterns can only reference input-bound
variables directly, not script:-scoped def locals (confirmed empirically:
using a def from script: in the output: block is a compile-time error,
"`ext` is not defined"), so the fallback is duplicated inline in script:,
stub: and the output: glob itself rather than shared via one variable.

Generated by Claude
@erikrikarddaniel
erikrikarddaniel marked this pull request as ready for review August 26, 2026 17:09

@piplus2 piplus2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erikrikarddaniel
erikrikarddaniel added this pull request to the merge queue Aug 26, 2026
Merged via the queue into nf-core:master with commit 74be114 Aug 26, 2026
41 checks passed
@erikrikarddaniel
erikrikarddaniel deleted the resolvetaxonomy-extensionless-input branch August 26, 2026 18:35
erikrikarddaniel added a commit to nf-core/phyloplace that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants