computeLogCPM: Compute log normalized counts

View source: R/computeLogCPM.R

computeLogCPMR Documentation

Compute log normalized counts

Description

Compute normalized counts as log2 counts per million

Usage

computeLogCPM(
  sce,
  lib.size = colSums2(counts(sce)),
  prior.count = 2,
  scaledByLib = FALSE
)

Arguments

sce

SingleCellExperiment with counts stored as counts(sce)

lib.size

library size for each cell

prior.count

average count to be added to each observation to avoid taking log of zero

scaledByLib

if TRUE, scale pseudocount by lib.size. Else do standard constant pseudocount addition

Details

This function gives same result as edgeR::cpm(counts(sce), log=TRUE)

Value

matrix of log CPM values

See Also

also edgeR::cpm()

Examples

library(muscat)
library(SingleCellExperiment)

data(example_sce)

logcounts(example_sce) <- computeLogCPM(example_sce)

GabrielHoffman/dreamlet documentation built on Nov. 23, 2024, 12:28 a.m.