Skip to main content
`Ctrl`+`K`

# 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_value`

      returns the numpy array of indices for the ungapped sequence

    `bytes_value`

      returns the bytes value of the ungapped sequence

    `gapped_array_value`

      returns the numpy array of indices for the gapped sequence

    `gapped_bytes_value`

      returns the bytes value of the gapped sequence

    `gapped_str_value`

      returns the string value of the gapped sequence

    `is_reversed`

      whether the sliced view is reversed relative to the parent

    `map`

      indel map (gaps) for the sequence

    `offset`

      the slice offset of this view

    parent
    `parent_len`

      length of the parent sequence

    `parent_offset`

      returns the offset from the true parent

    `seqid`

      the name of the sequence

    `slice_record`

      the slice record for this view

    `str_value`

      returns 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_value` are not complemented, but can be reversed. The latter is done by the `Aligned` object which has a moltype. The `slice_record` attribute is shared with the containing `Alignment`.