silhouette_computation

besca.tl.sig.silhouette_computation(adata: AnnData, cluster: str = 'dblabel', emb: str = 'X_umap', verbose: bool = False) silhouette_in[source]

Compute the average and per cell (ie samples) silhouette score for the cluster label (should be present in dataobs) (level 3 annotation), computed level 2 annotation and a random cell assignbation. Return a silhouette_in object

Parameters:
  • adata (anndata.AnnData) –

  • cluster ('str') – clustering to evaluate (should be a column in adata.obs)

  • emb (str) – embedding to use for computing the euclidian distance. should be a key of obsm

Returns:

  • silhouette_in dataclass object – Example

  • ——-

  • >>> import besca as bc

  • >>> adata = bc.datasets.simulated_pbmc3k_processed()

  • >>> sils = bc.tl.sig.silhouette_computation (adata)

  • >>> figure = sils.show_samples.get_figure()