Repository navigation
Fix complement terminal gaps and preserve coordinates with slack - #14
Merged
Merged
Conversation
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.
Complement can emit an empty or reversed terminal gap:
[90,100)on a chromosome of length 100 returns[100,100), or[105,100)with slack 5. Positive slack also moves the boundaries of surviving gaps:[10,20)and[30,40)produce[25,30)and[45,100)instead of[20,30)and[40,100).Sweep the original coordinates for nonnegative slack and use slack only as a gap-length threshold. Both chromosome-finalization paths omit terminal gaps that are empty, reversed, or no larger than slack. Saturating comparisons also avoid the previous
end + slackoverflow near the coordinate maximum. Optional leading gaps and negative-slack end contraction retain their existing behavior.Bump the crate, lockfile, and changelog to version
0.1.15.This is a separate core follow-up to ruranges_py#44, whose implicit chromosome-ID correction can be merged independently. No public signatures or shared event-builder behavior change.
Validation:
cargo test --offline: 61 existing unit tests, 14 new integration tests, and 3 doctests pass (78 total).rustfmt --check src/complement_single.rs tests/complement_gaps.rsandgit diff --checkpass. The full formatting check reports an existing formatting difference insrc/ranks.rs.cargo clippy --offline --all-targetssucceeds with existing warnings. The strict-- -D warningscheck fails on pre-existing diagnostics in unrelated files; neither changed Rust file has diagnostics.