Correct DMR site statistics and segmentation completeness - #704
Open
SuhasSrinivasan wants to merge 10 commits into
Open
Correct DMR site statistics and segmentation completeness#704SuhasSrinivasan wants to merge 10 commits into
SuhasSrinivasan wants to merge 10 commits into
Conversation
This was referenced Aug 11, 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.
Review status: Author-reviewed and ready for ONT review.
Summary
This PR consolidates the related DMR correctness fixes across site scoring and the downstream stateful segmenter:
0/nremains valid;These changes form one scientific pipeline: accepted per-site populations feed the same ordered HMM segmentation. The ten commits remain five tests/fix pairs for direct review.
Severity
High — scientific statistics, segmentation completeness, and reproducibility.
Affected accepted inputs can emit NaN, abort, cross-pair replicates, impute no-observation samples as canonical, omit one scored site per HMM chunk, or split a contig at an internal batch boundary. These defects change effects, probabilities, representation percentages, segment boundaries, counts, and state continuity.
Bugs and corrected behavior
-Implementation
Testing
Tested exact revision:
97bb3f5c374ddbd5c684514bdeaa2f53adea7a11Tree:
d9f773bbee8ba310bc2452a01a2cee2ef883a721Platform/toolchain: macOS arm64; rustc/cargo 1.90.0; samtools/bgzip/tabix 1.23.1;
hts-sys2.2.0.0.0000006230948043897833and effect1.0/10remains eligible.aa, 15bb, and 6ccsites in segmentsaa [0,6),bb [0,15),cc [0,6); interval/thread artifacts are byte-identical.git diff --check, changed-file formatting checks, conflict-marker scan, range-diff, clean-worktree, ancestry, file-scope, and Cargo.lock checks passed.Bioinformatics review independently verified denominators, sample identity, positive-coverage population semantics, one-state-per-site conservation, half-open segment geometry, chromosome-20 reconciliation, contig non-reentry, and interval/thread invariance. No blocker remained.
Output compatibility
Reviewer guide
beta_diff.rs.tabix.rsandsingle_site.rs.hmm.rs.cargo test -p mod_kit dmr:: -- --test-threads=1,cargo test -p mod_kit hmm -- --test-threads=1, andcargo test -p modkit --test test_dmr -- --test-threads=1as focused canaries.Non-goals