testCoefficient {MPRAnalyze} | R Documentation |
Calculate the significance of a factor in the regression model
testCoefficient(obj, factor, contrast)
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. |
a data.frame of the results this include the test statistic, logFC, p-value and BH-corrected FDR.
data <- simulateMPRA(tr = rep(2,5), da=c(rep(0,2), rep(1,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")