estimateDepthFactors: estimate library size correction factors

Description Usage Arguments Value Note Examples

View source: R/libraryDepth.R

Description

estimate library size correction factors

Usage

1
2
estimateDepthFactors(obj, lib.factor = NULL, which.lib = "both",
  depth.estimator = "uq")

Arguments

obj

the MpraObject

lib.factor

the factor associating each sample to a library. Can be a factor or the name of a column in the object's colAnnot. If not provided, the data is assumed to have been generated from a single library, and constant library depth is set.

which.lib

which library to compute the depth factors for. Options are "both" (default), "dna" or "rna". If the DNA and RNA counts have different library factors, this function should be called twice: once with "dna" and once with "rna"

depth.estimator

a character indicating which depth estimation to use. Currently supported values are "uq" for upper quantile (default) and "rle" for RLE (uses geometric mean, and is therefore not recommended if libraries have 0 counts)

Value

the MpraObject with estimated values for sequencing depth factors

Note

since in most MPRA experiments multiple barcodes exist within a single library, each column in the matrix is usually not a separate library. For this reason, it is recommended to supply this function with the appropriate partitioning of the data matrix columns into libraries, see lib.factor

Examples

1
2
3
4
5
data <- simulateMPRA(tr = rep(2,10), da=NULL, nbatch=2, nbc=20)
obj <- MpraObject(dnaCounts = data$obs.dna, 
                  rnaCounts = data$obs.rna, 
                  colAnnot = data$annot)
obj <- estimateDepthFactors(obj, lib.factor = "batch", which.lib = "both")

MPRAnalyze documentation built on Nov. 8, 2020, 8:22 p.m.