testCoefficient {MPRAnalyze}R Documentation

Calculate the significance of a factor in the regression model

Description

Calculate the significance of a factor in the regression model

Usage

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

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")

[Package MPRAnalyze version 1.4.0 Index]