Learn R Programming

scPOP (version 0.1.0)

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

Description

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

Usage

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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab