Skip to main content
`Ctrl`+`K`

# cogent3.core.seqview.SeqDataView

class SeqDataView(*, parent: SeqsDataABC, alphabet: c3_alphabet.CharAlphabet[Any], parent_len: int, seqid: str | None = None, slice_record: SliceRecordABC | None = None, offset: int = 0)

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

  Attributes:
    alphabet
    `array_value`

      returns the sequence as a numpy array

    `bytes_value`

      returns the sequence as bytes

    `is_reversed`

      whether the sequence is reversed

    `offset`

      the annotation offset of this view

    parent
    `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

  `copy`([sliced]) | returns copy
  `parent_coords`(*[, apply_offset]) | returns coordinates on parent
  `to_rich_dict`() | returns a json serialisable dict.
  `with_offset`(offset) | returns new instance with annotation offset set

  Notes

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