Skip to content

seqtk/subseq: output filename concatenates input name and ext.prefix with no separator #12779

Description

@erikrikarddaniel

Have you checked the docs?

Description of the bug

seqtk/subseq builds its output filename by concatenating the input filename and ext.prefix with no separator between them:

https://github.com/nf-core/modules/blob/master/modules/nf-core/seqtk/subseq/main.nf#L32

gzip --no-name > ${sequences}${prefix}.${ext}.gz

$sequences is the input file's full name, extension included, and prefix defaults to ${meta.id}, so with the default prefix the module produces names like:

domain_16s.fnaarc.fa.gz
domain_16s.fnabac16s.fa.gz

for meta.id values arc and bac16s searched against domain_16s.fna. The input extension is kept in the middle of the name and the id is glued straight onto it.

The module's own test hides this by setting a prefix that carries its own leading dot (tests/standard.config):

ext.prefix = { ".filtered" }

which yields genome.fasta.filtered.fa.gz. So the implicit contract is "ext.prefix is a suffix appended to the input filename and must supply its own separator". That is the opposite of the usual nf-core meaning of ext.prefix (the output basename), it is not documented in meta.yml, and it makes the default value of prefix unusable: ${meta.id} can never produce a well-formed name.

Found while working on nf-core/phyloplace, where seqtk/subseq is called from fasta_hmmsearch_rank_fastas with the default prefix.

Suggested fix

Follow the normal convention and let the prefix determine the basename:

gzip --no-name > ${prefix}.${ext}.gz

with the same change in the stub block, and drop the leading dot from tests/standard.config.

This changes output filenames for existing callers, so it needs a snapshot update here and in any pipeline that consumes the module, hence an issue rather than a straight PR. If keeping the input filename in the output is considered worth preserving, ${sequences.baseName}.${prefix}.${ext}.gz would be the compatible-in-spirit alternative, still a rename but at least a well-formed one.

Happy to open the PR once there is agreement on which of the two the module should produce.

System information

  • Nextflow 26.04.6
  • Desktop, local executor
  • Docker
  • Ubuntu, Linux 6.8
  • quay.io/biocontainers/seqtk:1.4--he4a0461_1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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