Skip to content

Remove dead genebody coverage code#24

Merged
ewels merged 3 commits into
mainfrom
remove-dead-genebody-code
Mar 4, 2026
Merged

Remove dead genebody coverage code#24
ewels merged 3 commits into
mainfrom
remove-dead-genebody-code

Conversation

@ewels
Copy link
Copy Markdown
Member

@ewels ewels commented Mar 4, 2026

Summary

  • Removes the legacy GenebodyCoverageAccum / TranscriptPositionMap code that was computed in the counting hot loop but whose output (CountResult.genebody) was never read or written anywhere
  • This code was fully superseded by the qualimap module (PR Add Qualimap RNA-Seq QC module #19) — the field was marked #[allow(dead_code)] and docs already called it "legacy"
  • Eliminates wasted per-read computation (O(aligned_blocks × exons) per assigned read) and ~540 lines of dead code

Test plan

  • cargo build — compiles cleanly
  • cargo test — all 184 tests pass (172 unit + 12 integration)
  • cargo clippy — no new warnings (4 pre-existing doc indentation warnings in unrelated code)
  • Verify output files are identical before/after on a real dataset

🤖 Generated with Claude Code

The old GenebodyCoverageAccum/TranscriptPositionMap code ran in the
counting hot loop but its output (CountResult.genebody) was never read
or written anywhere — fully replaced by the qualimap module. Removes
~540 lines of dead computation including the genebody.rs module,
config, parameters, and all hot-loop accumulation calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 4, 2026

Deploy Preview for rustqc canceled.

Name Link
🔨 Latest commit 6bd8064
🔍 Latest deploy log https://app.netlify.com/projects/rustqc/deploys/69a8a11e28adc30008fae458

ewels and others added 2 commits March 4, 2026 22:13
… issues

Remove populated-but-never-consumed fields: mapq_distribution and
primary_paired from BamStat, fragment_count/transcript_coverage/
merged_gene_coverage from QualimapResult, and supporting accumulator
code. Remove unused ExonMeta.transcript_idx, MergedGeneModel.gene_idx/
exonic_length, QualimapIndex.num_genes/merged_gene_models, and
TranscriptCoverage::iter(). Fix incorrect dead_code annotations with
accurate comments. Fix clippy issues: .clone() on Copy types, unnecessary
cast, useless vec! in tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove orphaned doc comment for a previously deleted function that was
causing clippy doc_lazy_continuation errors. Run cargo fmt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ewels
Copy link
Copy Markdown
Member Author

ewels commented Mar 4, 2026

The follow-up commits (622319e, 6bd8064) go beyond the original genebody removal and clean up additional dead code and issues found across the codebase:

Removed unused fields

  • BamStatResult: removed mapq_distribution and primary_paired (populated by the accumulator but never read by any output writer)
  • QualimapResult: removed fragment_count, transcript_coverage, and merged_gene_coverage (computed but never used in reports)
  • QualimapIndex: removed num_genes (only used in a log message, replaced by gene_transcript_ranges.len())
  • MergedGeneModel: removed gene_idx and exonic_length (set during construction but never read; exonic_length is now computed on-the-fly where needed)
  • ExonMeta: removed transcript_idx (stored in COITree metadata but never accessed)
  • TranscriptCoverage::iter(): removed (only caller was the now-removed merged_gene_coverage code)
  • QualimapAccum::into_result(): removed unused index parameter (was only needed for removed transcript_coverage building)

Fixed incorrect #[allow(dead_code)] annotations

  • Several fields had #[allow(dead_code)] with comments like "kept for API completeness" when they were genuinely unused — removed the fields instead of keeping the suppression
  • ExonMeta and TranscriptSampling (tin.rs): kept #[allow(dead_code)] but updated comments to accurately explain why (COITree storage / values used during construction)

Fixed clippy issues

  • Removed orphaned doc comment in counting.rs (from a previously-deleted function) that caused doc_lazy_continuation errors
  • Fixed .clone() on Copy types in index.rs tests
  • Fixed unnecessary as u64 cast in idxstats.rs
  • Fixed &mut vec![...]&mut [...] in output.rs tests

Regression testing

Built and ran both main and this branch on benchmark/input/small/test.bam — all QC output data is identical (only differences are output paths and timestamps).

@ewels ewels merged commit fbb54e5 into main Mar 4, 2026
8 checks passed
@ewels ewels deleted the remove-dead-genebody-code branch March 4, 2026 21:28
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.

1 participant