normalizationFactors {OUTRIDER} | R 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) <- value

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

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

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

### Arguments

`object` | An `OutriderDataSet` object.
`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

DESeq2::normalizationFactors

`sizeFactors`

### 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)))

[Package OUTRIDER version 1.6.0 Index]