testCoefficient: Calculate the significance of a factor in the regression...

Description Usage Arguments Value Examples

View source: R/hypothesisTesting.R

Description

Calculate the significance of a factor in the regression model

Usage

1
testCoefficient(obj, factor, contrast)

Arguments

obj

the MpraObject

factor

the name of the factor to make the comparison on

contrast

the character value of the factor to use as a contrast. See details.

Value

a data.frame of the results this include the test statistic, logFC, p-value and BH-corrected FDR.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data <- simulateMPRA(tr = rep(2,5), da=c(rep(2,2), rep(2.5,3)), 
                     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")

## fit.se must be TRUE for coefficient based testing to work
obj <- analyzeComparative(obj, dnaDesign = ~ batch + barcode + condition, 
                              rnaDesign = ~ condition, fit.se = TRUE)
results <- testCoefficient(obj, "condition", "contrast")

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