Fix custom/resolvetaxonomy: malformed output filename for extensionless input - #12824
Merged
erikrikarddaniel merged 1 commit intoAug 26, 2026
Conversation
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
marked this pull request as ready for review
August 26, 2026 17:09
erikrikarddaniel
added a commit
to nf-core/phyloplace
that referenced
this pull request
Aug 27, 2026
…ss-input filename)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR checklist
topic: versions- See version_topicsnf-core modules test custom/resolvetaxonomy --profile dockernf-core modules test custom/resolvetaxonomy --profile singularitynf-core modules test custom/resolvetaxonomy --profile condaDescription
Found while wiring
custom/resolvetaxonomy(merged in #12817) into nf-core/phyloplace: itssequencesoutput is named"*.resolved.${sequences.extension}", butPath.extensionis''(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 usablesequencesoutput.Fix: fall back to
'fasta'viasequences.extension ?: 'fasta'.One thing worth flagging for other module authors: I first tried factoring this into a single
def ext = sequences.extension ?: 'fasta'in thescript:block and reusing${ext}in theoutput:declaration (the same patterndef 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, notscript:-scopeddeflocals. Confirmed this empirically rather than assuming from theprefixprecedent, sinceprefixitself is only ever used inscript:/stub:, never in anoutput:pattern, in this module or apparently elsewhere. So the fallback is duplicated inline inscript:,stub:and theoutput: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.fastafixture) 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, andnf-core modules lint custom/resolvetaxonomy(clean). Docker only -- I have not run the singularity or conda profiles.Generated by Claude