Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new IntervalData abstraction to bind an interval-like coordinate object (Interval or DisjointIntervalSequence) to an in-memory array and allow coordinated slicing/indexing, while also extending and tightening the DIS API around strand semantics and lifting behavior.
Changes:
- Introduce
IntervalData(implementation, tests, and documentation) and export it fromgenome_kit. - Extend
DisjointIntervalSequencewithcut(), add.contains(), rename strand helpers, and changelift_interval()to optionally require containment unlessintersect_on_lift=True. - Update documentation and DIS tests to match the revised DIS semantics.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_interval_data.py | Adds unit tests covering IntervalData indexing/slicing on Interval and DIS backends. |
| tests/test_diseq.py | Updates strand-method tests, adds cut() tests, and expands lift_interval() tests for intersect_on_lift. |
| genome_kit/interval_data.py | Implements the new IntervalData class and its slicing/lifting behavior. |
| genome_kit/diseq.py | Adds cut()/contains(), renames strand APIs, and revises lift_interval()/gap lifting semantics. |
| genome_kit/data_manager.py | Changes S3 client creation for unsigned requests (currently disables TLS verification). |
| genome_kit/init.py | Exports IntervalData as part of the public package API. |
| docs-src/quickstart.rst | Adds an anchor for track-related cross-references. |
| docs-src/interval_data.rst | Adds new documentation page for IntervalData. |
| docs-src/index.rst | Adds interval_data to docs table-of-contents. |
| docs-src/diseq.rst | Updates DIS docs to on-/off-coordinate strand terminology and new lift/cut semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| a genomic interval. Conceptually, it is similar to a | ||
| :py:class:`~genome_kit.GenomeTrack`, but in-memory and scoped to a single |
There was a problem hiding this comment.
I think we need to expand a little bit more to help users select the right api for their use case.
And potentially add extensive documentation on gtrack into this doc. Currently we only have api docs so it's hard to understand gtrack holistically, and especially in comparison to IntervalData.
There was a problem hiding this comment.
Will tackle this in the next PR. This one is getting a bit large as-is
| return None | ||
| # It should only be permissible to have a single None when intersect_on_lift=True, | ||
| # since it's possible to lift an interval that is partially in a gap between coord intervals | ||
| assert lift_start is not None and lift_end is not None if not intersect_on_lift else True |
There was a problem hiding this comment.
asserts aren't guaranteed to raise
There was a problem hiding this comment.
I know. This is just a sanity check
feat: add .contains() to DIS, feat: support 0-length lift for DIS
Co-authored-by: ovesh <avishai@deepgenomics.com>
4f0313e to
8c31761
Compare
DIS api compatibility with Interval, required for IntervalData:
also: