lisi: Compute Local Inverse Simpson's Index (LISI)

Description Usage Arguments Value Examples

View source: R/metrics.R

Description

Use this function to compute LISI scores of one or more labels.

Usage

1
lisi(X, meta_data, label_colnames, perplexity = 30, nn_eps = 0)

Arguments

X

A matrix with cells (rows) and features (columns).

meta_data

A data frame with one row per cell.

label_colnames

Which variables to compute LISI for.

perplexity

The effective number of each cell's neighbors.

nn_eps

Error bound for nearest neighbor search with RANN:nn2(). Default of 0.0 implies exact nearest neighbor search.

Value

A data frame of LISI values. Each row is a cell and each column is a different label variable.

Examples

1
2
3
4
5
6
data(sceiad_subset_data)
features <- sceiad_subset_data[, paste0('scviDim_', 1:8)]
metadata <- sceiad_subset_data[,c('Barcode', 'cluster',  'subcluster',
                                     'CellType', 'CellType_predict')]
lisi_scores <- lisi(features, metadata, c('CellType_predict'))
head(lisi_scores)

scPOP documentation built on Aug. 4, 2021, 5:06 p.m.