Skip to contents

Wrapper for application of single cell integration assessment metrics with default parameters. Takes in Seurat object, calculates integration assessment metric per cell for given grouping variables, and plots visualization of metrics. A single integration score per dataset can be reported as the median of the metric across all cells.

Usage

assess_integration(
  sobj,
  group.var,
  method = c("LISI", "MixingMetric", "CellMixS"),
  reduction = c("umap", "pca", "tsne"),
  k = 300,
  MM_flip = TRUE,
  title = NULL,
  savename = NULL,
  width = NULL,
  height = NULL
)

run_LISI(
  sobj,
  group.var,
  reduction = c("umap", "pca", "tsne"),
  title = NULL,
  savename = NULL,
  width = NULL,
  height = NULL
)

run_MixingMetric(
  sobj,
  group.var,
  MM_flip = TRUE,
  reduction = c("umap", "pca", "tsne"),
  k = 300,
  title = NULL,
  savename = NULL,
  width = NULL,
  height = NULL
)

run_CellMixS(
  sobj,
  group.var,
  reduction = c("umap", "pca", "tsne"),
  k = 300,
  title = NULL,
  savename = NULL,
  width = NULL,
  height = NULL
)

Arguments

sobj

Seurat object

group.var

character (vector for mm or lisi); metadata colname to check level of integration

method

c("LISI", "MixingMetric", "CellMixS"); integration assessment metric to apply

reduction

c("umap", "pca", "tsne"); dimensional reduction method

k

integer; max.k for Seurat::MixingMetric, k for CellMixS::cms

MM_flip

logical; use max.k - MixingMetric instead of MixingMetric only

title

string; plot title

savename

string; filepath to save results and figure under (no ext.)

width

numeric; plot width

height

numeric; plot height

Value

Dataframe of integration assessment values

Details

Local inverse Simpson's index lisi: neighborhood batch diversity

Wrapper for immunogenomics/LISI from Harmony paper. Quantifies diversity of batches within local neighborhoods, defined by kNN graphs, using the inverse Simpson's index.

  • LISI = 1: neighborhood comprised of single group, not mixed

  • LISI = # of groups: neighborhood has equal number of cells from all datasets, perfect mixing

Seurat MixingMetric mm: local / group kNN ranking

Wrapper for Seurat::MixingMetric from Seurat v3 paper (Stuart et al. 2019). Assesses local neighborhood composition for a cell and how well mixed that neighborhood is. If the neighborhood is well mixed, should contain at least some cells from each dataset. Can be more intuitive to have high MixingMetric mean good mixing, so range can be flipped with max.k - MixingMetric. Uses flipped scale (MM_flip = TRUE) by default.

  • MixingMetric = max.k, low max.k - MixingMetric: not mixed

  • Low MixingMetric, high max.k - MixingMetric: well mixed

  • Set-wide metric: median (or mean) of MixingMetric distribution

Implemented with max.k = 300 by default.

CellMixS cms: batch-specific distance distribution kNN test

Wrapper for CellMixS::cms (Lütge et al. 2021). Tests for each cell the hypothesis that batch-specific distance distributions towards it's k-nearest neighboring (knn) cells are derived from the same unspecified underlying distribution using the Anderson-Darling test.

  • Low cms: poorly mixed per cell neighborhood

  • High cms: well mixed per cell neighborhood

  • Set-wide metric: cms histogram, flat for random batch mixing and skewed towards 0 for batch related bias

Implementation uses k = 300 and dim_red = reduction. As per the CellMixS vignette, k should not exceed the size of the smallest cell population. Takes a while to run, so asks for BiocParallel to use BiocParallel::MulticoreParam(). Computer may churn while it runs...

Functions

  • run_LISI(): Compute and plot local inverse Simpson's index lisi

  • run_MixingMetric(): Compute and plot Seurat MixingMetric mm

  • run_CellMixS(): Compute and plot CellMixS cms

See also

lisi::compute_lisi(), Seurat::MixingMetric(), CellMixS::cms()