New module: custom/collectfeaturecounts - #12846
Open
erikrikarddaniel wants to merge 1 commit into
Open
Conversation
Collects one or more subread/featureCounts raw output files (typically one per sample, for the same feature type/ORF caller) into a single long-format table with per-sample TPM computed, dropping zero-count rows. Ported from two now-identical, independently-hardened local modules (nf-core/magmap's and nf-core/metatdenovo's own COLLECT_FEATURECOUNTS) as part of the cross-repo summary-table consolidation tracked in nf-core/magmap#237. Includes the tpm-rounding fix from nf-core/metatdenovo#483/nf-core#484 (rounds tpm to 6 decimal places, since independently-computed tpm values for the same counts can otherwise round the last significant digit differently depending on which R backend does the division). Test data (raw subread/featurecounts fixtures, real per-sample featureCounts.tsv output, not yet present on the modules branch) in nf-core/test-datasets#2247. Generated by Claude Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UvGYU6kuXJeVv9ffdSzdzH
erikrikarddaniel
marked this pull request as ready for review
August 29, 2026 07:35
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
nf-core modules lintpasses clean.Description
Collects one or more
subread/featurecountsraw output files (typically one per sample, for the same feature type/ORF caller) into a single long-format table (orf,chr,start,end,strand,length,sample,count,tpm), computing per-sample TPM and dropping zero-count rows.Ported from two independently-hardened, now-functionally-identical local modules — nf-core/magmap's and nf-core/metatdenovo's own
COLLECT_FEATURECOUNTS— as part of a cross-repo effort to share their summary-table-generation code (tracked in nf-core/magmap#237). Both pipelines' local copies were first made caller/pipeline-agnostic by moving their one pipeline-specific ID-reconciliation special-case (magmap's genome-accession join, metatdenovo's Transdecodercds.-prefix stripping) into small local post-processing steps — see nf-core/magmap#238 and nf-core/metatdenovo#483.tpmis rounded to 6 decimal places. This carries over a fix from nf-core/metatdenovo#483/#484: when the same underlying counts get independently re-computed elsewhere (e.g. after a caller-consolidation step using a different R backend —dtplyr/data.tablehere vs plaindplyrthere), the unrounded double can round its last significant digit differently for the same mathematical value, which made an exact-equality test downstream intermittently fail. Rounding here keeps output stable regardless of which backend a consumer uses to recompute the same value.Testing
Verified with real Docker runs against two new fixtures (two samples, mixed zero/non-zero counts, one shared multi-exon gene) — nf-core/test-datasets#2247.
tpmcorrectly sums to exactly1e6per sample after rounding, zero-count rows are dropped, sample names are correctly stripped of their.sorted.bamsuffix.Generated by Claude