scib.metrics.clisi_graph
- scib.metrics.clisi_graph(adata, label_key, type_, use_rep='X_emb', batch_key=None, k0=90, subsample=None, scale=True, n_cores=1, verbose=False)
Cell-type LISI (cLISI) score
Local Inverse Simpson’s Index metrics adapted from Korsunsky et al. 2019 to run on all full feature, embedding and kNN integration outputs via shortest path-based distance computation on single-cell kNN graphs. By default, this function returns a value scaled between 0 and 1 instead of the original LISI range of 0 to the number of labels.
- Parameters:
adata – adata object to calculate on
label_key – label column name in
adata.obs
type_ – type of data integration, one of ‘knn’, ‘embed’ or ‘full’
use_rep – embedding slot in
.obsm
, only used for embedding inputbatch_key – deprecated, not used
k0 – number of nearest neighbors to compute lisi score Please note that the initial neighborhood size that is used to compute shortest paths is 15.
subsample – Percentage of observations (integer between 0 and 100) to which lisi scoring should be subsampled
scale – scale output values between 0 and 1 (True/False)
n_cores – number of cores (i.e. CPUs or CPU cores to use for multiprocessing)
- Returns:
Median of cLISI scores per cell type labels
This function can be applied to all integration output types and recomputes the kNN graph for feature and embedding output with specific parameters. Thus, no preprocessing is required, but the correct output type must be specified in
type_
.Examples
# feature output or unintegrated object scib.me.clisi_graph(adata, label_key="celltype", type="full") # embeding output scib.me.clisi_graph(adata, label_key="celltype", type="embed", use_rep="X_emb") # knn output scib.me.clisi_graph(adata, label_key="celltype", type="knn")