ladder.scripts.metrics.calc_asw

Contents

ladder.scripts.metrics.calc_asw#

ladder.scripts.metrics.calc_asw(anndata, test_for, embed)#

Calculates the normalized Average Silhouette Width (ASW).

Courtesy of scib (2021, 10.1038/s41592-021-01336-8) Source: theislab/scib

Parameters:
  • anndata (AnnData) – The anndata object provided.

  • test_for (str) – Factor column in obs for the original labels.

  • embed (str) – Key in obsm pointing to the embeddings to run K-Means with.

Returns:

float Average Silhouette Width normalized to the range [0,1].