CountNormalize: Normalize a SingleCellExperiment object using total counts

Description Usage Arguments Details Value Examples

View source: R/normalize.R

Description

Compute normalized expression values from count data in a SingleCellExperiment object, using the median normalized total count stored in the object.

Usage

1
CountNormalize(object, return_log = FALSE)

Arguments

object

A SingleCellExperiment object.

return_log

Logical scalar, should normalized values be returned on the log2 scale? If TRUE, output is stored as "logcounts" in the returned object; if FALSE output is stored as "normcounts".#'

Details

Normalized expression values are computed by dividing the counts for each cell by median normalized total count of that cell. If log=TRUE, log-normalized values are calculated by adding a pseudocount of 1 to the normalized count and performing a log2 transformation.

Value

A SingleCellExperiment object containing normalized expression values in "normcounts" if log=FALSE, and log-normalized expression values in "logcounts" if log=TRUE.

Examples

1
2
3
4
5
6
7
8
library(SingleCellExperiment)
ncells <- 100
ngenes <- 2000
x <- matrix(rpois(ncells*ngenes, lambda = 10), ncol=ncells, nrow=ngenes, byrow=TRUE)
rownames(x) <- paste0("Gene", seq_len(ngenes))
colnames(x) <- paste0("Cell", seq_len(ncells))
sce <- SingleCellExperiment(list(counts=x))
sce <- CountNormalize(sce)

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