TRESS_DMRtest: Hypothesis testing on candidate DMRs.

View source: R/TRESS_DMRtest.R

TRESS_DMRtestR Documentation

Hypothesis testing on candidate DMRs.

Description

This function conducts statistical test for each candidate DMR based on user specified contrast of coefficients in design.

Usage

TRESS_DMRtest(DMR, contrast, nullModel = "standN")

Arguments

DMR

A list at least containing IP/input ratio, the coefficients estimate, variance-covariance estimate. This can be obtained from the ouput of TRESS_DMRfit.

contrast

A contrast for all coefficients in the design. It can be either a (p+1) vector or a m-by-(p+1) matrix, where p is the number of columns in the design. m depends on the number of relationships that users want to test.

nullModel

A character to specify a method to calculate p-value based on the statistics. It can be "standN", "2mix" and "trunN" for standard normal, two-component mixed gaussian and truncated normal respectively. Defult is "standN".

Details

The hypothesis for each of candidate DMR i is of the form:

H_0: C^TR_i = 0 vs. H_1: C^TR_i \neq 0

where C is a contrast of all coefficients in model design; R_i is coefficient vector for DMR i. If the C is a vector, then TRESS performs Wald test; if the C is a matrix, then TRESS conducts F-test.

Value

This function returns a dataframe containing the testing results for specified contrast. The columns are

baseMean

Averaged methylation level cross all samples.

logOR

Estimated value of contrast: C^TR_i. Only available if constrast is a vector.

lorSE

Standard error of C^TR_i. Only available if constrast is a vector.

stat

Test statistics.

pvalue

P-values from statistical tests.

padj

Benjamini-Hochberg procedure adjusted p-values.

Author(s)

Zhenxing Guo <zhenxing.guo@emory.edu>

References

Zhenxing Guo, Andrew M. Shafik, Peng Jin, Hao Wu. (2022) Differential RNA Methylation Analysis for MeRIP-seq Data under General Experimental Design. Bioinformatics, 38 (20), 4705-4712. https://academic.oup.com/bioinformatics/article/38/20/4705/6692302?login=true

Examples

# A toy example
data(DMR_M3vsWT) # data from TRESS
variable = data.frame(predictor = rep(c("WT", "M3"), c(2, 2)))
model = ~1+predictor
DMR.fit = CallDMRs.paramEsti(
    counts = DMR_M3vsWT$Counts,
    sf = DMR_M3vsWT$sf,
    variable = variable,
    model = model
    )
DMR.test = TRESS_DMRtest(DMR = DMR.fit, contrast = c(0, 1))
head(DMR.test, 3)
head(DMR_M3vsWT$Regions[which(DMR.test$padj < 0.05), ], 3)

ZhenxingGuo0015/TRESS documentation built on April 14, 2023, 4:21 p.m.