CalckBET: k-Nearest Neighbour Batch Effect Test

View source: R/Seurat_based.R

CalckBETR Documentation

k-Nearest Neighbour Batch Effect Test

Description

Wrapper function of kBET for Seurat SerObjs.

Usage

CalckBET(
  SerObj,
  ident,
  k0 = NULL,
  knn = NULL,
  assay = "RNA",
  layer = "scale.data",
  ...
)

Arguments

SerObj

A Seurat SerObj.

k0

Neighborhood size. By default k0 = mean batch size. To prevent kBET rejection rate from saturating to 1, lower this value.

assay

Assay used for sketching. "RNA" by default.

...

Arguments passed to kBET.

sketch.size

Number of cells to sketch. By default sketch 1000 cells.

slot

By default slot = "data".

Details

General principles behind kBET:

When batch effect exists in a dataset, the dataset contains disproportional amounts of samples from each batch within neiborhoods surrounding each point. Using Chi-squared statistics, test whether the proportion of each batch within a neighborhood is disproportional. If it's not proportional (i.e. p < critical value), reject null hypothesis (proportional distribution). kBET aggregates the test results computed from multiple neighborhoods, and reports a "rejection rate" as a metric for batch effect. High rejection rate indicates strong batch effect, whereas low "rejection rate" indicates mild batch effect. For "acceptance rate", it is simply a rescaled value of "rejection rate", computed as 'acceptance rate = 1 - rejection rate'.

Publication: Büttner, M., Miao, Z., Wolf, F.A., Teichmann, S.A., and Theis, F.J. (2019). A test metric for assessing single-cell RNA-seq batch correction. Nat Methods.

Github repo: https://github.com/theislab/kBET

Value

A list containing detailed results calculated by kBET.

Examples

res <- CalckBET(pbmc_small, "groups")


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