CallDMRs.paramEsti: Model fitting and parameter estimation by TRESS for each...

View source: R/CallDMRs.paramEsti.R

CallDMRs.paramEstiR Documentation

Model fitting and parameter estimation by TRESS for each candidate DMR.

Description

TRESS models the read counts in candidate DMR using hierarchical negative binomial distribution, with methylation level of each DMR linked to multi-factors in the design by a linear framework. This function conducts model fitting, parameter estimation, and the variance-covariance matrix computation.

Usage

CallDMRs.paramEsti(counts, sf,
                   model, variable,
                   shrkPhi = TRUE,
                   addsuedo = FALSE)

Arguments

counts

A dataframe containing read counts in each candidate DMR across all samples.

sf

A numerical vector of size factors for all samples.

variable

A dataframe containing condition information of all samples.

model

A formula to specify which factor in "variable" to be included in model fitting.

shrkPhi

A logical value indicating whether conducting shringkage estimate for dispersion parameter. Default is TRUE.

addsuedo

A logical value indicating whether or not adding a psuedo count of 5 on raw read counts. Default is FALSE.

Value

This function returns a list containing:

Ratio

A dataframe containing the IP/input ratio from all samples.

loglik

A numerical vector containing the log-likelihood of all DMRs.

Coef

A matrix containing estimates of coefficients in the design.

Cov

A list of variance-covariance matrix estimates for all DMRs.

Examples

# A toy example
data(DMR_M3vsWT) # data from TRESS
variable = data.frame(predictor = rep(c("WT", "M3"), c(2, 2)))
model = ~1+predictor
DMRfit = CallDMRs.paramEsti(
    counts = DMR_M3vsWT$Counts,
    sf = DMR_M3vsWT$sf,
    variable = variable,
    model = model
    )

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