isi: isi

Description Usage Arguments Details Value References Examples

View source: R/otherMetrics.R

Description

isi

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
isi(
  sce,
  group,
  k,
  dim_red = "PCA",
  assay_name = "logcounts",
  n_dim = 10,
  weight = TRUE,
  res_name = NULL
)

Arguments

sce

SingleCellExperiment object, with the integrated data.

group

Character. Name of group/batch variable. Needs to be one of names(colData(sce)).

k

Numeric. Number of k-nearest neighbours (knn) to use.

dim_red

Character. Name of embeddings to use as subspace for distance distributions. Default is "PCA".

assay_name

Character. Name of the assay to use for PCA. Only relevant if no existing 'dim_red' is provided.

n_dim

Numeric. Number of dimensions to include to define the subspace.

weight

Boolean. If TRUE, batch probabilities to calculate the isi score are weighted by the mean distance of their cells towards the cell of interest. Relevant for metrics: 'isi'.

res_name

Character. Appendix of the result score's name (e.g. method used to combine batches).

Details

The isi function calculates the inverse Simpson index of the group variable within each cell's k-nearest neighbourhood. The Simpson index describes the probability that two entities are taken at random from the dataset and its inverse represent the effective number of batches in a neighbourhood. The inverse Simpson index has been proposed as a diversity score for batch mixing in single cell RNAseq by Korunsky et al. They provide a distance-based neighbourhood weightening in their Lisi package. Here, we provide a simplified way of weightening probabilitities, if the weight argument is enabled.

Value

A SingleCellExperiment with the entropy score within colData.

References

Korsunsky I Fan J Slowikowski K Zhang F Wei K et. al. (2018). Fast, sensitive, and accurate integration of single cell data with Harmony. bioRxiv (preprint)

Examples

1
2
3
4
5
library(SingleCellExperiment)
sim_list <- readRDS(system.file("extdata/sim50.rds", package = "CellMixS"))
sce <- sim_list[[1]][, c(1:15, 400:420, 16:30)]

sce <- isi(sce, "batch", k = 20)

almutlue/CellMixS documentation built on Dec. 22, 2020, 11:07 a.m.