Calculate agreement between clusters and reference labels
Source:R/analysis_metrics.R
sn_calculate_clustering_agreement.RdThe returned table includes both adjusted Rand index (ARI) and normalized mutual information (NMI), which are commonly used to quantify how well clustering preserves known cell identities.
Examples
meta <- data.frame(
cluster = c("T", "T", "B", "B"),
label = c("T", "T", "B", "B")
)
sn_calculate_clustering_agreement(meta, cluster = "cluster", label = "label")
#> cluster_column label_column n_cells ari nmi
#> 1 cluster label 4 1 1