core.seqview.SeqDataView

core.seqview.SeqDataView(
    parent,
    alphabet,
    parent_len,
    seqid=None,
    slice_record=None,
    offset=0,
)

A view class for SeqsData, providing methods for different representations of a single sequence.

Notes

str_value / array_value are not complemented, but can be reversed. The latter is done by the Sequence object which has a moltype.

Attributes

Name Description
array_value returns the sequence as a numpy array
bytes_value returns the sequence as bytes
offset the annotation offset of this view
parent_len length of the parent sequence
parent_offset returns the offset from the true parent
seqid name of the sequence
slice_record the slice state of this view
str_value returns the sequence as a string

Methods

Name Description
copy returns copy
parent_coords returns coordinates on parent
to_rich_dict returns a json serialisable dict.
with_offset returns new instance with annotation offset set

copy

core.seqview.SeqDataView.copy(sliced=False)

returns copy

parent_coords

core.seqview.SeqDataView.parent_coords(apply_offset=False, **kwargs)

returns coordinates on parent

Parameters

Name Type Description Default
apply_offset bool if True adds annotation offset from parent False

Returns

Name Type Description
parent seqid, start, stop, strand

to_rich_dict

core.seqview.SeqDataView.to_rich_dict()

returns a json serialisable dict.

Notes

This method will slice the underlying sequence to the start and stop values

Warnings

This method is not intended to provide serialisation of this object, instead, it is intended for usage by an enclosing class.

with_offset

core.seqview.SeqDataView.with_offset(offset)

returns new instance with annotation offset set