computeNormConst: Compute a normalisation constant for each sample

View source: R/srcImpulseDE2_computeNormConst.R

computeNormConstR Documentation

Compute a normalisation constant for each sample

Description

The normalisation constant is the median of the ratio of gene counts versus the geomtric gene count mean. There is one normalisation constant per replicate. An intuitive alternative would be the sequencing depth, the median ratio is however less sensitive to highly differentially expressed genes with high counts (ref. DESeq). The normalisation constants are used to scale the mean of the negative binomial model inferred during fitting to the sequencing depth of the given sample. The normalisation constants therefore replace normalisation at the count data level, which is not supposed to be done in the framework of ImpulseDE2. There is the option to supply size factors to this function to override its size factor choice.

Usage

computeNormConst(matCountDataProc, vecSizeFactorsExternal = NULL)

Arguments

matCountDataProc

(matrix genes x samples) Read count data.

vecSizeFactorsExternal

(vector length number of cells in matCountData) [Default NULL] Externally generated list of size factors which override size factor computation in ImpulseDE2.

Value

vecSizeFactors (numeric vector number of samples) Model scaling factors for each sample which take sequencing depth into account (size factors).

Author(s)

David Sebastian Fischer

See Also

Called by runImpulseDE2. Calls computeSizeFactors.

Examples

lsSimulatedData <- simulateDataSetImpulseDE2(
vecTimePointsA   = rep(seq(1,8),3),
vecTimePointsB   = NULL,
vecBatchesA      = NULL,
vecBatchesB      = NULL,
scaNConst        = 100,
scaNImp          = 200,
scaNLin          = 100,
scaNSig          = 200)
vecSizeFactors <- computeNormConst(
matCountData = lsSimulatedData$matObservedCounts)


YosefLab/ImpulseDE2 documentation built on Sept. 17, 2022, 2:45 a.m.