Skip to content

Keep truncated disjoint intervals within reference bounds - #56

Open
sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/clamp-disjoint-truncated-intervals
Open

sylvesterkaczmarek wants to merge 1 commit into
google-deepmind:mainfrom
sylvesterkaczmarek:fix/clamp-disjoint-truncated-intervals

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

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.

  • New tests on unchanged main: 14 reported regression failures, including subcases; unaffected controls passed.
  • Data/IO baseline: 418 passed, 50 subtests passed.
  • src/alphagenome/data and src/alphagenome/io: 457 passed, 53 subtests passed on Python 3.11.16 and 3.12.11.
  • Pylint errors-only, Pyink on changed source lines/new tests, optimized-mode unittest execution, compilation and git diff --check passed.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Truncating disjoint intervals can produce negative widths

1 participant