Skip to content

Implement __getitem__ in ReferenceSequence #1988

@jeromekelleher

Description

@jeromekelleher

It would be nice to implement the things like

# What is the reference base at position 12345?
ts.reference_sequence[12345]
# What are the bases between position a and b?
ts.reference_sequence[a:b]

etc. Assuming the slices are reasonably small, this can be done efficiently by implementing the __getitem__ method, and either accessing the data via numpy arrays, or just implementing in the Python C layer.

In the future, we can implement the data fetching methodology from URLs in the background to implement these queries.

Metadata

Metadata

Assignees

Labels

Python APIIssue is about the Python APIenhancementNew feature or requestfutureIssues that are closed as they are not planned in the medium-term, but which are still desirable.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions