Repository navigation
Keep truncated disjoint intervals within reference bounds - #56
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary
Fixes #55.
Clamp both endpoints to the reference range. Intervals completely before or after the reference previously became reversed intervals with negative width. They now become empty intervals at the nearest boundary.
Preserve partially overlapping and contained intervals, strand/name, deep-copied metadata and the existing error for nonpositive reference lengths. This does not change TrackData slicing or the FASTA extractor's separate out-of-bounds checks.
Validation
Thirty-nine parameterized cases, plus three subtests, cover all strands, disjoint/overlapping/contained intervals, empty endpoints, invalid reference lengths and large Python integers. Tests check nonnegative widths, containment, idempotence, string/protobuf roundtrips and independent metadata.
src/alphagenome/dataandsrc/alphagenome/io: 457 passed, 53 subtests passed on Python 3.11.16 and 3.12.11.git diff --checkpassed.Validation was local on macOS. Generated protobuf bindings came from the repository's build hook and are not included in the patch. The selected suites include existing FASTA behavior tests; model inference, service calls and the full SDK suite were not run. This defines disjoint truncation using already-supported empty intervals rather than adding a new interval type.
Based on main at
038d253a5ca2fec46f4874f592d9ec67984cb497. No dependencies or workflows change.