getNormData {LineagePulse}R Documentation

Return depth and batch corrected data

Description

The data normalisation is based on the model normalisation used by and inferred by LineagePulse, e.g. for data visualisation.

Usage

getNormData(matCounts, lsMuModel, vecGeneIDs, boolDepth = TRUE,
  boolBatch = TRUE)

Arguments

matCounts

(numeric matrix genes x cells) Count data.

lsMuModel

(list) Mean parameter model parameters.

vecGeneIDs

(vector of strings) Gene IDs for which mean model fits are to be extracted.

boolDepth

(bool) [Default TRUE] Whether to normalize for sequencing depth.

boolBatch

(bool) [Default TRUE] Whether to normalize for batch.

Value

(numeric matrix genes x cells) Input data normalized by library size factors (optional) and by inferred batch factors (optional).

Author(s)

David Sebastian Fischer

See Also

Called by fitZINB. Can be called by user.

Examples

lsSimulatedData <- simulateContinuousDataSet(
    scaNCells = 20,
    scaNConst = 2,
    scaNLin = 2,
    scaNImp = 2,
    scaMumax = 100,
    scaSDMuAmplitude = 3,
    vecNormConstExternal=NULL,
    vecDispExternal=rep(20, 6),
    vecGeneWiseDropoutRates = rep(0.1, 6))
objLP <- runLineagePulse(
    counts = lsSimulatedData$counts,
    dfAnnotation = lsSimulatedData$annot,
    strMuModel = "impulse")
# Get batch correction on alternative model:
# Use H1 model fits.
matNormData <- getNormData(
     matCounts = lsSimulatedData$counts,
     lsMuModel = lsMuModelH1(objLP),
     vecGeneIDs = rownames(lsSimulatedData$counts)[1],
     boolDepth = TRUE, boolBatch = TRUE)


[Package LineagePulse version 1.2.1 Index]