Learn R Programming

DSS (version 2.12.0)

DMLfit.multiFactor: Fit a linear model for BS-seq data from general experimental design

Description

This function takes a BSseq object, a data frame for experimental design and a model formula and then fit a linear model.

Usage

DMLfit.multiFactor(BSobj, design, formula)

Arguments

BSobj
An object of BSseq class for the BS-seq data.
design
A data frame for experimental design. Number of rows must match the number of columns of the counts in BSobj.
formula
A formula for the linear model.

Value

A list with following components
gr
An object of 'GRanges' for locations of the CpG sites.
design
The input data frame for experimental design.
formula
The input formula for the model.
fit
The model fitting results. This is a list itself, with two components: 'beta' - the estimated coefficients; 'se.beta' - estimated standard error for beta.

Details

The line model fitting is done through ordinary least square on the arscine transformed methylation percentages. The estimated standard errors are computed with consideration of the data (count) distribution and transformation. This function is extremely efficient. The computation takes around 20 minutes for 4 million CpG sites.

See Also

DMLtest.multiFactor, DMLtest

Examples

Run this code
data(RRBS)
## model fitting
DMLfit = DMLfit.multiFactor(RRBS, design, ~case+cell+case:cell)

## hypothesis testing
DMLtest.cell = DMLtest.multiFactor(DMLfit, coef=3)

## look at distributions of test statistics and p-values
par(mfrow=c(1,2))
hist(DMLtest.cell$stat, 100, main="test statistics")
hist(DMLtest.cell$pvals, 100, main="P values")

Run the code above in your browser using DataLab