ComputeLISI_Ser: Compute LISI (Local Inverse Simpson's Index) for a Seurat...

View source: R/Seurat_based.R

ComputeLISI_SerR Documentation

Compute LISI (Local Inverse Simpson's Index) for a Seurat Object

Description

This function calculates the LISI (Local Inverse Simpson's Index) scores for batch mixing and biological signal preservation based on a specified dimensional reduction (e.g., PCA, UMAP) for a Seurat object.

Usage

ComputeLISI_Ser(
  SerObj,
  reduction = "pca",
  dims = 1:15,
  batch.label = "batch",
  biological.label = "cell_type"
)

Arguments

SerObj

A Seurat object containing the single-cell RNA-seq data.

reduction

Character. The dimensional reduction method to use for LISI computation (e.g., "pca", "umap"). Default is '"pca"'.

dims

Numeric vector. The dimensions of the reduced embedding to use. Default is '1:15'.

batch.label

Character. The metadata label representing batch information in 'SerObj@meta.data'. Default is '"batch"'.

biological.label

Character. The metadata label representing biological information (e.g., cell type) in 'SerObj@meta.data'. Default is '"cell_type"'.

Value

A list containing the average batch LISI score ('batch_LISI') and the average biological LISI score ('biological_LISI'). A higher batch LISI score indicates better mixing, and a higher biological LISI score indicates better preservation of biological signal.

Examples

# Compute LISI scores for PCA reduction with batch and cell type labels
lisi_scores <- ComputeLISI_Ser(SerObj, reduction = "pca", dims = 1:15, batch.label = "batch", biological.label = "cell_type")

# Compute LISI scores for UMAP reduction
lisi_scores <- ComputeLISI_Ser(SerObj, reduction = "umap", dims = 1:10, batch.label = "batch", biological.label = "cell_type")


eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.