Skip to main content
`Ctrl`+`K`

# cogent3.core.annotation.Feature

class Feature(*, parent: TSeqOrAlign, seqid: str, map: FeatureMap, biotype: str, name: str, strand: int | str, xattr: dict[str, Any] | None = None)

  new style annotation, created on demand

  Attributes:
    `biotype`

      type of biological feature

    `map`

      coordinate map and properties of this feature

    `name`

      name of the feature

    `parent`

      sequence or aligned or alignment

    `reversed`

      whether Feature is on the reverse strand relative to bound object

    `seqid`

      the sequence id of the parent sequence

    `xattr`

      extra attributes for this feature

  Methods

  `as_one_span`([name]) | returns a feature that preserves any gaps in the underlying sequence
  `get_children`([biotype]) | generator returns sub-features of self optionally matching biotype
  `get_coordinates`() | returns sequence coordinates of this Feature as [(start1, end1), ...]
  `get_drawable`() | returns plotly trace
  `get_parent`(**kwargs) | generator returns parent features of self optionally matching biotype
  `get_slice`([complete, allow_gaps, apply_name]) | The corresponding sequence fragment.
  `shadow`([name]) | returns new instance corresponding to disjoint of self coordinates
  `to_dict`() | returns
  `union`(features) | return as a single Feature
  `without_lost_spans`() | Keeps only the parts which are actually present in the underlying sequence

  remapped_to |