cogent3.core.slice_record.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".

copy([sliced])

returns self

relative_position(abs_index[, stop])

converts an index on the original "Python sequence" into an index on this "view"

to_rich_dict()

returns dict suitable for serialisation

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.