netmap.downstream.clustering.unify_group_labelling¶
- netmap.downstream.clustering.unify_group_labelling(adata, grn_adata, col_adata, col_grn_adata, return_mapping=True)[source]¶
Match overclustered GRN labels to a reference clustering using argmax assignment.
Each GRN cluster is mapped to the reference cluster that contains the majority of its cells (argmax of the contingency matrix column). Unlike the Hungarian algorithm, this allows many-to-one mappings, making it suitable when
grn_adatahas more clusters thanadata.- Parameters:
adata (anndata.AnnData) – Reference AnnData with ground-truth cluster labels.
grn_adata (anndata.AnnData) – GRN AnnData whose clusters will be remapped.
col_adata (str) – Column in
adata.obswith reference cluster labels.col_grn_adata (str) – Column in
grn_adata.obswith GRN cluster labels.return_mapping (bool) – If
Truealso return the mapping dict. Defaults toTrue.
- Returns:
- Fraction of correctly matched cells. If
return_mapping=True, returns(score, reverse_mapping).
- Return type: