SeqView#

class SeqView(*, parent: str | bytes | ndarray, alphabet: AlphabetABC, parent_len: int, seqid: str | None = None, slice_record: SliceRecordABC = None, offset: int = 0)#

Provides a view of a sequence with support for slicing operations.

This class represents a view of a sequence. It uses SliceRecord to enable efficient slicing without altering the original sequence data.

Parameters:
parent

the original sequence data

alphabet

the alphabet object defining valid characters for the sequence

seqid

the name or identifier of the sequence

parent_len

the length of the sequence. Defaults to the length of the input sequence

Attributes:
alphabet
array_value
bytes_value
is_reversed
offset
parent
parent_len
seqid
slice_record
str_value

Methods

copy([sliced])

returns copy

with_offset

Notes

It utilises the alphabet object to allow providing different types such as strings or numpy arrays, corresponding to its underlying data.

alphabet#
property array_value#
property bytes_value#
copy(sliced: bool = False)#

returns copy

Parameters:
sliced

if True, the underlying sequence is truncated and the start/stop adjusted

property is_reversed: bool#
property offset: int#
parent#
property parent_len: int#
property seqid: str#
property slice_record: SliceRecordABC#
property str_value#
with_offset(offset: int)#