normalizationFactors: Accessor functions for the normalization factors in an...

normalizationFactorsR Documentation

Accessor functions for the normalization factors in an OutriderDataSet object.

Description

To normalize raw count data normalization factors can be provided as a matrix. When running controlForConfounders the normalization factors are stored within the OutriderDataset object. This normalization factors are then used to compute the normalized counts.

Usage

## S4 method for signature 'OutriderDataSet'
normalizationFactors(object, ...)

## S4 replacement method for signature 'OutriderDataSet,matrix'
normalizationFactors(object, minE = 0.5, ...) <- value

## S4 replacement method for signature 'OutriderDataSet,DataFrame'
normalizationFactors(object, minE = 0.5, ...) <- value

## S4 replacement method for signature 'OutriderDataSet,data.frame'
normalizationFactors(object, minE = 0.5, ...) <- value

## S4 replacement method for signature 'OutriderDataSet,'NULL''
normalizationFactors(object) <- value

Arguments

object

An OutriderDataSet object

...

Further arguments are passed on to the underlying assay function

minE

The minimal expected count, defaults to 0.5, to be used in computing the expected log geom mean.

value

The matrix of normalization factors

Value

A numeric matrix containing the normalization factors or the OutriderDataSet object with an updated normalizationFactors assay.

See Also

sizeFactors normalizationFactors

Examples


ods <- makeExampleOutriderDataSet()

normFactors <- matrix(runif(nrow(ods)*ncol(ods),0.5,1.5),
    ncol=ncol(ods),nrow=nrow(ods))

# the normalization factors matrix should not have 0's in it
# it should have geometric mean near 1 for each row
normFactorsRM <- normFactors / exp(rowMeans(log(normFactors)))
normalizationFactors(ods) <- normFactorsRM
normalizationFactors(ods)[1:10,1:10]

normalizationFactors(ods) <- NULL
ods <- estimateSizeFactors(ods)
normalizationFactors(ods) <- normFactors
all(normalizationFactors(ods) == t(sizeFactors(ods) * t(normFactors)))


gagneurlab/OUTRIDER documentation built on April 19, 2024, 12:20 a.m.