AlignedDataView#
- class AlignedDataView(*, parent: AlignedSeqsDataABC, seqid: str, alphabet: AlphabetABC, slice_record: SliceRecord | None = None)#
A view class for
AlignedSeqsData, providing methods for different representations of a single sequence.- Attributes:
- alphabet
array_valuereturns the numpy array of indices for the ungapped sequence
bytes_valuereturns the bytes value of the ungapped sequence
gapped_array_valuereturns the numpy array of indices for the gapped sequence
gapped_bytes_valuereturns the bytes value of the gapped sequence
gapped_str_valuereturns the string value of the gapped sequence
is_reversedwhether the sliced view is reversed relative to the parent
mapindel map (gaps) for the sequence
offsetthe slice offset of this view
- parent
parent_lenlength of the parent sequence
parent_offsetreturns the offset from the true parent
seqidthe name of the sequence
slice_recordthe slice record for this view
str_valuereturns the string value of the ungapped sequence
Methods
copy([sliced])just returns self
returns view of ungapped sequence data for seqid
parent_coords(*[, seq_coords, apply_offset])returns seqid, start, stop, strand on the parent
with_offset(offset)returns new instance with annotation offset set
Notes
str_value/array_valueare not complemented, but can be reversed. The latter is done by theAlignedobject which has a moltype. Theslice_recordattribute is shared with the containingAlignment.- alphabet#
- property array_value: ndarray#
returns the numpy array of indices for the ungapped sequence
- property bytes_value: bytes#
returns the bytes value of the ungapped sequence
- copy(sliced: bool = False) Self#
just returns self
- property gapped_array_value: ndarray#
returns the numpy array of indices for the gapped sequence
- property gapped_bytes_value: bytes#
returns the bytes value of the gapped sequence
- property gapped_str_value: str#
returns the string value of the gapped sequence
- get_seq_view() SeqViewABC#
returns view of ungapped sequence data for seqid
- property is_reversed: bool#
whether the sliced view is reversed relative to the parent
- property map: IndelMap#
indel map (gaps) for the sequence
- property offset: int#
the slice offset of this view
- parent#
- parent_coords(*, seq_coords: bool = False, apply_offset: bool = False) tuple[str, int, int, int]#
returns seqid, start, stop, strand on the parent
- Parameters:
- seq_coords
if True, parent is the ungapped sequence
- apply_offset
if True and seq_coords, adds annotation offset from parent
- property parent_len: int#
length of the parent sequence
- property parent_offset: int#
returns the offset from the true parent
Notes
If from storage with an offset attribute, returns that value or 0
- property seqid: str#
the name of the sequence
- property slice_record: SliceRecordABC#
the slice record for this view
- property str_value: str#
returns the string value of the ungapped sequence
- with_offset(offset: int) Self#
returns new instance with annotation offset set