testEmpirical: test for significant activity (quantitative analysis) using...

Description Usage Arguments Value Examples

View source: R/hypothesisTesting.R

Description

test for significant activity (quantitative analysis) using various empirical tests (see details)

Usage

1
2
3
4
5
6
7
testEmpirical(
  obj,
  statistic = NULL,
  useControls = TRUE,
  twoSided = FALSE,
  subset = NULL
)

Arguments

obj

the MpraObject, after running an analysis function

statistic

if null [default], the intercept term is used as the score. An alternate score can be provided by setting 'statistic'. Must be a numeric vector.

useControls

is TRUE and controls are available, use the controls to establish the background model and compare against. This allows for more accurate zscores as well as empircal p-values.

twoSided

should the p-value be from a two-sided test (default: FALSE, right-side test)

subset

only test a subset of the enhancers in the object (logical, indices or names). Default is NULL, then all the enhancers are included.

Value

a data.frame of empirical summary statistics based on the model's estimate of slope, or the given statistic. These are:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data <- simulateMPRA(tr = rep(2,10), da=NULL, nbatch=2, nbc=15)
obj <- MpraObject(dnaCounts = data$obs.dna, 
                  rnaCounts = data$obs.rna, 
                  colAnnot = data$annot)
obj <- estimateDepthFactors(obj, lib.factor = "batch", which.lib = "both")
obj <- analyzeQuantification(obj, dnaDesign = ~ batch + barcode, 
                              rnaDesign = ~1)
results <- testEmpirical(obj)

## or test with a different statistic:
aggregated.ratio <- rowSums(data$obs.rna) / rowSums(data$obs.dna)
results <- testEmpirical(obj, aggregated.ratio)

YosefLab/MPRAnalyze documentation built on Nov. 14, 2020, 2:35 a.m.