scib.metrics.isolated_labels

scib.metrics.isolated_labels(adata, label_key, batch_key, embed, cluster=True, iso_threshold=None, return_all=False, verbose=True)

Isolated label score

Score how well labels of isolated labels are distiguished in the dataset by either

  1. clustering-based approach F1 score, or

  2. average-width silhouette score (ASW) on isolated label vs all other labels

Parameters
  • adata – anndata object

  • label_key – column in adata.obs

  • batch_key – column in adata.obs

  • cluster – if True, use clustering approach, otherwise use silhouette score approach

  • embed – key in adata.obsm used for silhouette score if cluster=False, or as representation for clustering (if neighbors missing in adata)

  • iso_threshold – max number of batches per label for label to be considered as isolated, if iso_threshold is integer. If iso_threshold=None, consider minimum number of batches that labels are present in

  • return_all – return scores for all isolated labels instead of aggregated mean

  • verbose

Returns

Mean of scores for each isolated label or dictionary of scores for each label if return_all=True