Compocyte.core.base.hierarchy_base

Classes

HierarchyBase()

Add explanation

class Compocyte.core.base.hierarchy_base.HierarchyBase[source]

Bases: object

Add explanation

set_cell_relations(root_node, dict_of_cell_relations, obs_names, temp_paths)[source]

Once set, cell relations can only be changed one node at a time, using supplied methods, not by simply calling defining new cell relations

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.

make_classifier_graph()[source]

Compute directed graph from a given dictionary of cell relationships.

plot_hierarchy()[source]

Plot hierarchical cell labels.

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.

get_child_nodes(node)[source]
get_leaf_nodes()[source]
get_parent_node(node, graph=None)[source]
update_hierarchy(dict_of_cell_relations, temp_path=None, root_node=None, overwrite=False)[source]