refactor: extract assay-agnostic analyses into src/common/ - #152
Open
BenjaminDEMAILLE wants to merge 5 commits into
Open
refactor: extract assay-agnostic analyses into src/common/#152BenjaminDEMAILLE wants to merge 5 commits into
BenjaminDEMAILLE wants to merge 5 commits into
Conversation
These three modules carry no RNA-specific logic and are needed by the forthcoming dna subcommand. src/rna re-exports them so every existing crate::rna::... path and the published 0.2.x library surface keep working. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bam_stat is read-level and needs no annotation, and the samtools stats, flagstat and idxstats writers consume its result type, so all four move together into src/common/. src/rna/rseqc re-exports them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
BamStatAccum gathers the read-level counters behind bam_stat and the samtools writers. Its process_read takes only a record and a MAPQ cutoff, so it is assay-agnostic and the dna pipeline will drive the same struct. The merge_vec_arrays helper moves with it, being its only consumer. rna::rseqc::accumulators re-exports the type. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Also corrects the AGENTS.md claim that the crate has no lib.rs, which has been untrue since seqeralabs#101. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 28, 2026
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.
Part of #157.
Groundwork for a forthcoming
rustqc dnasubcommand. Pure refactor: no behaviour change, no new dependency, no public API break.What moves
src/rna/bam_flags.rssrc/common/bam_flags.rssrc/rna/cpp_rng.rssrc/common/cpp_rng.rssrc/rna/preseq.rssrc/common/preseq.rssrc/rna/rseqc/bam_stat.rssrc/common/bam_stat.rssrc/rna/rseqc/{stats,flagstat,idxstats}.rssrc/common/samtools/BamStatAccum(fromsrc/rna/rseqc/accumulators.rs)src/common/bam_stat_accum.rsNone of these need a gene annotation or a library strand protocol.
bam_statis read-level, the samtools writers consume its result type, andBamStatAccum::process_readtakes only a record and a MAPQ cutoff, so a DNA pipeline can drive the same accumulator unchanged.merge_vec_arraysmoves withBamStatAccum, being its only consumer.src/rnare-exports every moved item, sorustqc::rna::preseq,rustqc::rna::rseqc::statsand friends keep resolving for library users on 0.2.x. A newcompat_testsmodule pins those paths so the shims cannot break silently.src/rna/rseqc/accumulators.rsdrops from 2784 to 1481 lines.How it is verified
Beyond the existing suite (233 tests green, up from 232 by the one added compat test):
rustqc rnawas run overtests/data/before and after the refactor and all 61 output files compared byte for byte, plus the JSON summary compared field by field.Every file is identical once two build-and-run artefacts are normalised away: the output directory path, which several outputs embed by design (the featureCounts header command line, the RSeQC
.rplotting scripts), and the analysis timestamp plus git commit hash in the Qualimap report and the JSON summary. No metric, count or histogram changed.Follow-up
This is the first of a stack. The
src/dna/tree and thednasubcommand itself land in later PRs; nothing here adds DNA code.🤖 Generated with Claude Code