mantispy.metrics.lisi

Contents

mantispy.metrics.lisi#

mantispy.metrics.lisi(adata, key, use_rep='X_pca', perplexity=30, kind='auto')[source]#

Median LISI over rows.

Parameters:
  • adata (AnnData) – Object with the embedding to measure in.

  • key (str) – obs column whose labels the neighborhoods are scored over.

  • use_rep (str (default: 'X_pca')) – obsm key of the embedding.

  • perplexity (float (default: 30)) – Perplexity the kernel width is calibrated to. Each neighborhood holds 3 * perplexity rows, at most n_obs - 1.

  • kind (str (default: 'auto')) – "batch" names the result ilisi (higher is better mixed) and "label" names it clisi (lower means the biological groups stay separated). "auto" guesses from the column name: a key containing batch, plate, source, week or run is a batch and anything else a label, so "Metadata_Site" counts as a label. Pass kind explicitly when one table holds both, or the two rows get the same metric name.

Return type:

DataFrame