diff_dss_fit: Performs model fit for general experimental design

Description Usage Arguments Value Examples

View source: R/diff_dss_fit.R

Description

This function is a wrapper for DSS::DMLfit.multiFactor.

Usage

1

Arguments

bs

a BSseq object to calculate differential methylation statistics.

design

a data.frame or DataFrame for experimental design. Should contain as many rows as there are columns (samples) in bs, and the order of the rows should match the columns of bs. If omitted, will default to pData(bs).

formula

a formula for the linear model. It should refer to column names from design. NOTE: The intercept is included by default if omitted. One can omit the intercept with a formula such as '~ 0 + group'. For clarity, it helps to include the intercept explicitly as in '~ 1 + group'.

Value

A list object with:

gr:

a GRanges object with loci fit.

design:

the data.frame input as the experimental design.

formula:

the formula representing the model. Can be character or formula.

X:

the design matrix used in regression based on the design and formula. This should be consulted to determine the appropriate contrast to use in dss_fit_test().

fit:

a list with model fitting results. It has components beta, the estimated coefficients, and var.beta the estimated variance/covariance matrix for beta.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(BS.cancer.ex, package = 'bsseqData')

bs = filter_loci_by_group_coverage(
    bs = BS.cancer.ex,
    group_column = 'Type',
    c('cancer' = 2, 'normal' = 2))

small_test = bs[1:50]

diff_fit = diff_dss_fit(
    bs = small_test,
    design = bsseq::pData(bs),
    formula = '~ Type')

methylSig documentation built on Nov. 8, 2020, 8:25 p.m.