chore: add lower, lift, intersect, dna, expand_coord DIS methods#229
chore: add lower, lift, intersect, dna, expand_coord DIS methods#229SophiaPerzan-DG wants to merge 10 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends DisjointIntervalSequence (DIS) with additional coordinate/interval manipulation and mapping utilities (including genomic ↔ DIS coordinate conversion and DNA extraction), updates documentation accordingly, and adds tests for the new behaviors. It also removes the prior DIS “index direction” toggle and introduces a Genome.dna(...) convenience path intended to accept a DIS directly.
Changes:
- Added DIS methods:
expand_coord,_lower_coord,lower,genomic_span,_lift_position,lift_interval,intersect, anddna; removed the global index-direction toggle. - Updated
Genome.dnabehavior to dispatch when passed aDisjointIntervalSequence. - Added/expanded unit tests and documentation for the new DIS coordinate mapping and DNA behaviors.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_genome.py | Adds coverage for Genome.dna() when called with an Interval vs a DIS. |
| tests/test_diseq.py | Adds extensive tests for DIS coordinate expansion, lowering/lifting, intersection, span, and DNA. |
| genome_kit/genome.py | Changes Genome.dna implementation to dispatch for DIS inputs. |
| genome_kit/diseq.py | Implements new DIS methods (expand/lower/lift/intersect/dna) and removes index-direction configuration. |
| genome_kit/init.py | Exposes DisjointIntervalSequence in __all__. |
| docs-src/diseq.rst | Documents expand_coord, coordinate mapping (lower/lift_interval), and DIS DNA behavior (including Genome.dna(dis) convenience). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This reverts commit 572bc63.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
docs-src/diseq.rst:819
- The docs claim
Genome.dnaaccepts a DIS directly (genome.dna(dis)), butGenomeDNA.__call__only acceptsInterval-typed arguments viaPyAsInterval(seesrc/py_interval.h). Unless there’s an unshown overload, this example will raiseTypeError. Either remove this claim/example or implement DIS dispatch in the DNA API.
For convenience, :py:meth:`Genome.dna <genome_kit.Genome.dna>` accepts a
DIS directly and dispatches to ``DisjointIntervalSequence.dna``, so
either of the following is equivalent::
>>> dis.dna()
>>> genome.dna(dis)
also: