Compocyte.core.base.hierarchy_baseΒΆ
Hierarchy graph management utilities.
This module provides helpers and a base class for constructing and managing the hierarchical graph of cell types used by the hierarchical classifier.
- class Compocyte.core.base.hierarchy_base.HierarchyBase[source]ΒΆ
Bases:
objectAdd explanation
- ensure_depth_match(dict_of_cell_relations, obs_names)[source]ΒΆ
Check if the annotations supplied in .obs under obs_names are sufficiently deep to work with the hierarchy provided.
- ensure_unique_nodes(dict_of_cell_relations)[source]ΒΆ
Check if keys within the hierarchy are unique across all levels as that is a requirement for uniquely identifying graph nodes with networkx.
- get_children_obs_key(parent_node)[source]ΒΆ
Get the obs key under which labels for the following level in the hierarchy are saved. E. g. if you get_children_obs_key for T cells, it will return the obs key for alpha beta T cell labels and so on.
- get_parent_obs_key(parent_node)[source]ΒΆ
Get the obs key under which labels for the current level in the hierarchy are saved. E. g. if you get_parent_obs_key for T cells, it will return the obs key in which true T cells are labelled as such.
- make_classifier_graph()[source]ΒΆ
Compute directed graph from a given dictionary of cell relationships.