runMNNCorrect: Apply the mutual nearest neighbors (MNN) batch effect...

Description Usage Arguments Value References Examples

View source: R/runBatchCorrection.R

Description

MNN is designed for batch correction of single-cell RNA-seq data where the batches are partially confounded with biological conditions of interest. It does so by identifying pairs of MNN in the high-dimensional log-expression space. For each MNN pair, a pairwise correction vector is computed by applying a Gaussian smoothing kernel with bandwidth 'sigma'.

Usage

1
2
3
4
5
6
7
8
runMNNCorrect(
  inSCE,
  useAssay = "logcounts",
  batch = "batch",
  assayName = "MNN",
  k = 20L,
  sigma = 0.1
)

Arguments

inSCE

SingleCellExperiment inherited object. Required.

useAssay

A single character indicating the name of the assay requiring batch correction. Default "logcounts".

batch

A single character indicating a field in colData that annotates the batches. Default "batch".

assayName

A single characeter. The name for the corrected assay. Will be saved to assay. Default "MNN".

k

An integer. Specifies the number of nearest neighbours to consider when defining MNN pairs. This should be interpreted as the minimum frequency of each cell type or state in each batch. Larger values will improve the precision of the correction by increasing the number of MNN pairs, at the cost of reducing accuracy by allowing MNN pairs to form between cells of different type. Default 20L.

sigma

A Numeric scalar. Specifies how much information is shared between MNN pairs when computing the batch effect. Larger values will share more information, approaching a global correction for all cells in the same batch. Smaller values allow the correction to vary across cell types, which may be more accurate but comes at the cost of precision. Default 0.1.

Value

The input SingleCellExperiment object with assay(inSCE, assayName) updated.

References

Lun ATL, et al., 2016 & 2018

Examples

1
2
3
4
5
data('sceBatches', package = 'singleCellTK')
## Not run: 
sceCorr <- runMNNCorrect(sceBatches)

## End(Not run)

singleCellTK documentation built on Nov. 8, 2020, 5:21 p.m.