SliceRecord#
- class SliceRecord(*, parent_len: int, start: int | None = None, stop: int | None = None, step: int | None = None, offset: int = 0)#
records cumulative slice operations on an object without modifying it
- Attributes:
- is_reversed
- offset
- parent_len
parent_start
returns the start on the parent plus strand
parent_stop
returns the stop on the parent plus strand
plus_start
start on plus strand
plus_step
step on plus strand
plus_stop
stop on plus strand
- start
- step
- stop
Methods
absolute_position
(rel_index[, include_boundary])Converts an index relative to the current view to be with respect to the coordinates of the original "Python sequence".
relative_position
(abs_index[, stop])converts an index on the original "Python sequence" into an index on this "view"
copy
to_rich_dict
Notes
Basis for lazy evaluation of slicing operations on sequences and alignments. A reference to an instance of this class is used by different view objects.
- absolute_position(rel_index: int, include_boundary: bool = False)#
Converts an index relative to the current view to be with respect to the coordinates of the original “Python sequence”.
- Parameters:
- rel_index
relative position with respect to the current view
- Returns:
- the absolute index with respect to the coordinates of the original
- sequence (including offset if present).
- copy(sliced: bool = False)#
- property is_reversed#
- property offset: int#
- property parent_len: int#
- property parent_start: int#
returns the start on the parent plus strand
- Returns:
- offset + start, taking into account whether reversed. Result
- is positive.
Notes
This should NOT be used for slicing on the parent object.
- property parent_stop: int#
returns the stop on the parent plus strand
- Returns:
- offset + stop, taking into account whether reversed. Result
- is positive.
Notes
This should NOT be used for slicing on the parent object.
- property plus_start: int#
start on plus strand
- property plus_step: int#
step on plus strand
- property plus_stop: int#
stop on plus strand
- relative_position(abs_index: int, stop: bool = False)#
converts an index on the original “Python sequence” into an index on this “view”
Notes
The returned value DOES NOT reflect python indexing. Importantly, negative values represent positions that precede the current view.
- start#
- step#
- stop#
- to_rich_dict() dict #