Skip to contents

Add size factors to normalize count data by library size or by biomass

Usage

add_size_factors(se, spikein = FALSE, spikein_pattern = "ERCC")

Arguments

se

A SummarizedExperiment object with a count matrix and sample metadata.

spikein

Logical indicating whether or not to normalize data using spike-ins. If FALSE, data will be normalized by library size. Default: FALSE.

spikein_pattern

Character with the pattern (regex) to use to identify spike-in features in the count matrix. Only valid if spikein_norm = TRUE.

Value

A SummarizedExperiment object as in se, but with an extra column in the colData slot named "sizeFactor". This column contains size factors that will be used by DESeq2 when performing differential expression analyses.

Examples

data(se_chlamy)
se_norm <- add_size_factors(se_chlamy)