Correction: Correct for batch effects

Description Usage Arguments Details Value Examples

View source: R/integration.R

Description

Correct the merged count data based on rank values to obtain a set of reduced and corrected dimensions.

Usage

1
2
Correction(object, method = "default", close_th = 0.1,
  cells_th = 0.1, components = 2, ...)

Arguments

object

A list of SingleCellExperiment objects, each representing a SingleCellExperiment object from a single batch.

method

character, one of c("default","fastmnn"). default mode performs the dropClust based correction followed by UMAP embedding. The fastmnn option performs the mutual neighbourhood based correction which is implemented in the batchelor package. when FALSE the batches are merged on the set of common genes across batches.

close_th

for the method = default, specifies the value at which the expression values of two genes will be considered as close pairs.

cells_th

for the method default, specifies the value to determine what proportion of total number of cells have close pairs.

components

number of reduced dimensions to return.

...

umap arguments may be passed.

Details

Concatenate the expression counts of all cells from different batches into one expression count object. The merging is done on the set of union of DE genes obtained from the clustering of each batch.

Value

A SingleCellExperiment object with two new entry under the reducedDim() container to store the reduced dimension components with the name "CComponents" and the rank expression matrix named "RankMat".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
library(SingleCellExperiment)
ncells <- 100
ngenes <- 1200
lambda <-abs(rnorm(ngenes))
counts.1 <- matrix(rpois(ncells*ngenes, lambda =  lambda), ncol=ncells, nrow=ngenes, byrow=TRUE)
rownames(counts.1) <- paste0("Gene", seq_len(ngenes))
colnames(counts.1) <- paste0("Cell", seq_len(ncells))
sce.1 <- SingleCellExperiment(assays = list(counts = counts.1))
rowData(sce.1)$Symbol <- paste0("Gene", seq_len(ngenes))

lambda <-abs(rnorm(ngenes))
counts.2 <- matrix(rpois(ncells*ngenes, lambda =  lambda), ncol=ncells, nrow=ngenes, byrow=TRUE)
rownames(counts.2) <- paste0("Gene", seq_len(ngenes))
colnames(counts.2) <- paste0("Cell", seq_len(ncells))
sce.2 <- SingleCellExperiment(assays = list(counts = counts.2))
rowData(sce.2)$Symbol <- paste0("Gene", seq_len(ngenes))

mixed_sce <- Merge(list(sce.1, sce.2), use.de.genes =TRUE)
mixed_sce <- Correction(mixed_sce, close_th=0.1, cells_th=0.2)

## End(Not run)

debsin/dropClust documentation built on Nov. 4, 2019, 10:22 a.m.