
Calculate LISI scores on any label
rs_lisi.Rd
Computes the Local Inverse Simpson's Index on the kNN graph: the effective
number of labels in each cell's neighbourhood. On batch labels this is
iLISI (higher is better mixing), on cell type labels cLISI (lower is better
separation). Both come back rescaled to
[0, 1], higher is better, as in
scIB.
Arguments
- knn_mat
Integer matrix. The rows represent the cells and the columns the neighbour indices (0-indexed!).
- knn_dist
Numeric matrix or NULL. The kNN distances, same shape as
knn_mat. If provided, neighbours are weighted with a perplexity-calibrated Gaussian kernel as in Korsunsky et al.; if NULL, neighbours are weighted uniformly.- labels
Integer vector. The label (batch or cell type) per cell. The codes need not be 0-based or contiguous.
- perplexity
Numeric or NULL. Perplexity for the weighted version. NULL defaults to 30; values above k are clamped to k. Ignored if
knn_distis NULL.- verbose
Boolean. Controls verbosity of the function.