Correct Localize coordinates, coverage, validation, and charts - #700
Open
SuhasSrinivasan wants to merge 9 commits into
Open
Correct Localize coordinates, coverage, validation, and charts#700SuhasSrinivasan wants to merge 9 commits into
SuhasSrinivasan wants to merge 9 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 Localize's related eligibility, coordinate, regional-I/O, and chart corrections:
--min-coveragefilters individual bedMethyl rows before strand filtering and offset aggregation, with inclusivevalid_coverage >= min_coveragesemantics;These changes define one Localize input-to-profile contract. Existing table columns and CLI options are unchanged.
Severity
High — scientific eligibility, coordinates, counts, and output integrity.
The accepted coverage option previously had no effect; the coordinate defect changed which observations entered profiles and assigned retained observations to incorrect bins. Invalid region rows or query errors could also yield incomplete successful output.
Bugs and corrected behavior
--min-coverage 3with coverage-1 and coverage-23 records in one binw[anchor-w, anchor+w+1)and emitposition-anchorImplementation
min_covintoFocusRegion::into_localized_mod_countsand filter byvalid_coverage >= min_coveragebefore strand selection/folding.try_fold/try_reducepropagation for regional work while retaining missing-contig skipping.Testing
Tested exact revision:
a290d201e189c6c4ea375fddea2036bd7601b88cTree:
c13548ff4087cdd07e5e3548edca43ed4aa2ace3Platform/toolchain: macOS arm64; rustc/cargo 1.90.0;
rust-htslib0.46.0 andhts-sys2.2.0.--window 0geometry and offset 0: threshold 1 givesC, 0, 24, 3, 12.5; threshold 3 givesC, 0, 23, 2, 8.695652.git diff --check, targetedrustfmt --check, conflict-marker scan, clean-worktree, ancestry, source-oracle union, and Cargo.lock checks passed.Rust and Bioinformatics reviews independently verified inclusive pre-aggregation coverage filtering, anchor/window geometry, reference-axis offsets, failure propagation, chart units, and preservation of all source tests. No blocker remained.
Output compatibility
Reviewer guide
subcommand.rsandutil.rs.try_fold/try_reducepaths.cargo test -p mod_kit localise -- --test-threads=1,cargo test -p modkit --test test_localize -- --test-threads=1, andcargo test -p modkit --test test_stats -- --test-threads=1as focused canaries.Non-goals