Skip to content

Port PREPROCESS_TRANSCRIPTS_FASTA_GENCODE to the nf-core module structure - #284

Merged
piplus2 merged 3 commits into
nf-core:devfrom
piplus2:preprocess-transcripts-fasta-gencode-nfcore
Sep 16, 2026
Merged

piplus2 merged 3 commits into
nf-core:devfrom
piplus2:preprocess-transcripts-fasta-gencode-nfcore

Conversation

@piplus2

@piplus2 piplus2 commented Sep 15, 2026

Copy link
Copy Markdown

Summary

Refactor the local PREPROCESS_TRANSCRIPTS_FASTA_GENCODE module to the nf-core module template:

  • environment.yml, meta.yml, a stub and task.ext.prefix support
  • the seqera community container shared with GUNZIP and CAT_FASTQ (coreutils, gzip, sed) instead of nf-core/ubuntu:20.04
  • reports the coreutils version of cut, which does the work, instead of sed, which only parsed the version string
  • nf-tests: plain fasta, gzipped fasta and stub. The setup block writes a two record GENCODE style fasta, so nothing had to be added to test-datasets (same approach as nf-core/rnaseq for this module)

Bug fixed

The module emitted a bare path while PREPARE_GENOME treats ch_transcript_fasta as [ meta, fasta ] everywhere else, so --gencode with --transcript_fasta aborted at the first .map { _meta, tr -> tr } with Invalid 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 rerun
  • full nf-test suite: 62/63. The one failure is ALIGN_STAR › homo_sapiens - paired_end - igenomes, where STAR 2.6.1d segfaults in STAR_GENOMEGENERATE_IGENOMES on my machine; it fails identically on dev without this change
  • nf-core modules lint --local: only the generic warnings every local module here gets; nextflow lint clean

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!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nf-test test main.nf.test -profile test,docker).
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

🤖 Generated with Claude Code

https://claude.ai/code/session_01MKJushdvSrzFfFCrKk29Yr

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
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit a8fc088

+| ✅ 311 tests passed       |+
#| ❔   5 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗  12 tests had warnings |!
Details

❗ Test warnings:

  • readme - README contains the placeholder zenodo.XXXXXXX. This should be replaced with the zenodo doi (after the first release).
  • pipeline_todos - TODO string in CHANGELOG.md: ## v1.1.0dev - [unreleased replace with date on release ]
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • pipeline_todos - TODO string in CONTRIBUTING.md: Add any pipeline specific contribution guidelines here, such as coding styles, procedures, checklists etc.
  • pipeline_todos - TODO string in main.nf.test: define inputs of the process here. Example:
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in awsfulltest.yml: You can customise AWS full pipeline tests as required
  • schema_params - Schema param fasta not found from nextflow config
  • schema_params - Schema param gtf not found from nextflow config
  • schema_params - Schema param gff not found from nextflow config
  • schema_params - Schema param star_index not found from nextflow config
  • schema_params - Schema param salmon_index not found from nextflow config

❔ Tests ignored:

  • files_unchanged - File ignored due to lint config: .github/PULL_REQUEST_TEMPLATE.md
  • files_unchanged - File ignored due to lint config: .github/workflows/branch.yml
  • files_unchanged - File ignored due to lint config: .github/workflows/linting.yml
  • files_unchanged - File ignored due to lint config: assets/nf-core-rnasplice_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-rnasplice_logo_dark.png

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 4.1.0
  • Run at 2026-09-15 09:08:46

@erikrikarddaniel erikrikarddaniel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

@piplus2

piplus2 commented Sep 16, 2026

Copy link
Copy Markdown
Author

Thanks @erikrikarddaniel ! True, next time I'll split into two PRs.

@piplus2
piplus2 merged commit 4fed199 into nf-core:dev Sep 16, 2026
23 checks passed
@erikrikarddaniel

Copy link
Copy Markdown
Member

Thanks @erikrikarddaniel ! True, next time I'll split into two PRs.

The review queue is a consideration though, so I fully understand.

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