Skip to content

annotate_hierarchy

hnoca.snapseed.annotate.annotate_hierarchy(adata, marker_hierarchy, group_name, layer=None, min_expr=0.1, **kwargs)

Annotate clusters based on a manually defined cell type and marker hierarchy.

Parameters:

Name Type Description Default
adata AnnData

AnnData object

required
marker_hierarchy dict

Cell type name -> node. Each node has marker_genes (a list of genes) and optionally subtypes (a dict of the same form, one level down). Other keys in a node, such as references for the markers' sources, are ignored.

required
group_name str

Name of the column in adata.obs that contains the cluster labels

required
layer str | None

Layer in adata to use for expression

None
min_expr float

Minimum detection rate of the called type's best marker in a cluster for the call to stand. A call at a level stands only if the cluster's call at the level above stands too.

0.1
**kwargs

Additional arguments to pass to the annotation function.

{}

Returns

Dict with assignments and metrics