CalckBET: k-Nearest Neighbour Batch Effect Test

Description Usage Arguments Details Value Examples

View source: R/CalckBET.R

Description

Wrapper function of kBET for Seurat objects.

Usage

1
2
3
4
5
6
7
8
9
CalckBET(
  object,
  ident,
  k0 = NULL,
  knn = NULL,
  assay = "RNA",
  slot = "scale.data",
  ...
)

Arguments

object

A Seurat object.

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.

slot

By default slot = "data".

...

Arguments passed to kBET.

sketch.size

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

Details

General principles behind kBET: when batch effect exists in a particular dataset, that 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

1
res <- CalckBET(pbmc_small, "groups")

RuiyuRayWang/scWidgets documentation built on Dec. 18, 2021, 11:54 a.m.