cogent3.core.seqview.AlignedDataView#
- class AlignedDataView(*, parent: AlignedSeqsDataABC, seqid: str, alphabet: c3_alphabet.CharAlphabet[Any], slice_record: SliceRecordABC | 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
get_seq_view()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.