Port PREPROCESS_TRANSCRIPTS_FASTA_GENCODE to the nf-core module structure - #284
Conversation
Add environment.yml, meta.yml, a stub, task.ext.prefix support and nf-tests
to the local PREPROCESS_TRANSCRIPTS_FASTA_GENCODE module. It moves to the
seqera community container shared with GUNZIP and CAT_FASTQ (coreutils,
gzip, sed) and reports the coreutils version of cut, which does the work,
instead of sed, which only parsed the version string.
The module now emits [ meta, fasta ] instead of a bare path. PREPARE_GENOME
already treats ch_transcript_fasta as that tuple everywhere else, so
--gencode with --transcript_fasta aborted at the first
`.map { _meta, tr -> tr }` with `Invalid method invocation 'call' with
arguments: ... UnixPath`.
The tests need no test-datasets upload: the setup block writes a two record
GENCODE style fasta, plain and gzipped, as the strand_junctions tests and
the same module in nf-core/rnaseq do. Three cases: plain, gzipped and stub,
asserting the cut headers explicitly on top of the snapshot.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MKJushdvSrzFfFCrKk29Yr
|
erikrikarddaniel
left a comment
There was a problem hiding this comment.
Reviewed with some help from Claude Code.
Traced the bug fix end to end against subworkflows/local/prepare_genome/main.nf on dev.
Confirmed it's real: ch_transcript_fasta = PREPROCESS_TRANSCRIPTS_FASTA_GENCODE.out.fasta was a bare path, and the emit: block does ch_transcript_fasta.map { _meta, fa -> fa } on it unconditionally.
Emitting tuple val(meta), path(...) is the correct fix, and no other call site needs touching -- prepare_genome and modules.config already only reference .out.fasta.
Checked the container/environment.yml swap: community.wave.seqera.io/library/coreutils_grep_gzip_lbzip2_pruned:... and its environment.yml are byte-identical to the ones on the official gunzip and cat/fastq modules, so this is real container-reuse rather than an unrelated copy-paste -- makes sense as a caching win even though several of the listed conda packages (grep, lbzip2, tar) aren't used by this module's own script.
fasta.extension == 'gz' (vs. the old endsWith('.gz')) and the cut --version extraction regex both check out locally.
One non-blocking note: this also adds a new top-level AGENTS.md (confirmed byte-identical in content to the current https://raw.githubusercontent.com/nf-core/agents/main/resources/pipeline/AGENTS.md, just reformatted by prettier/prek). Reasonable to land, but it's a second, unrelated change riding along with the module refactor -- might be worth its own PR next time, if only so its own "a PR should contain a single feature" line doesn't apply to itself.
Nothing else stood out. Approving.
|
Thanks @erikrikarddaniel ! True, next time I'll split into two PRs. |
The review queue is a consideration though, so I fully understand. |
Summary
Refactor the local
PREPROCESS_TRANSCRIPTS_FASTA_GENCODEmodule to the nf-core module template:environment.yml,meta.yml, a stub andtask.ext.prefixsupportGUNZIPandCAT_FASTQ(coreutils, gzip, sed) instead ofnf-core/ubuntu:20.04cut, which does the work, instead ofsed, which only parsed the version stringBug fixed
The module emitted a bare path while
PREPARE_GENOMEtreatsch_transcript_fastaas[ meta, fasta ]everywhere else, so--gencodewith--transcript_fastaaborted at the first.map { _meta, tr -> tr }withInvalid method invocation 'call' with arguments: ... UnixPath. The module now emits the tuple.Testing
nf-test test modules/local/preprocess_transcripts_fasta_gencode --profile=+docker: 3/3 pass, snapshot stable on rerunnf-testsuite: 62/63. The one failure isALIGN_STAR›homo_sapiens - paired_end - igenomes, where STAR 2.6.1d segfaults inSTAR_GENOMEGENERATE_IGENOMESon my machine; it fails identically ondevwithout this changenf-core modules lint --local: only the generic warnings every local module here gets;nextflow lintcleanPR checklist
nf-core pipelines lint).nf-test test main.nf.test -profile test,docker).CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).🤖 Generated with Claude Code
https://claude.ai/code/session_01MKJushdvSrzFfFCrKk29Yr