Class to propagate annotations given an particular ontology structure.

Attributes:
  • ontology (str) –

    The name of an ontology supported by MetaHQ.

  • anno (Annotations) –

    A MetaHQ Annotations object with columns of ontology terms rows as samples, and each value is a 1 or 0 indicating if a sample is annotated to a particular term.

  • to (list[str]) –

    A list of ontology term IDs to propagate annotations up or down to.

  • family (dict[str, DataFrame | list[str]]) –

    A pointer to the ancestry and descendants adjacency matrices and ids denoting their column ids.

propagate_down()

Propagates annotations down to all terms in the annotations curation. If an index is annotated to an ancestor of a term in to, then it is given an annotation of 1 to that term.

propagate_up()

Propagates annotations up to all terms in the annotations curation. If an index is annotated to a descendant of a term in to, then it is given an annotation of 1 to that term.