betaRegression: A function to estimate and test a group factor within a beta...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/betaRegression.R

Description

This function models the methylation level within a beta regression. The first independent variable in formula is tested to be unequal to zero.

Usage

1
betaRegression(formula, link, object, mc.cores, ...)

Arguments

formula

Symbolic description of the model. For the first independent variable the P value (Wald test) and the effect on methylation is returned. For details see below.

link

A character specifying the link function in the mean model (mu). Currently, "logit", "probit", "cloglog", "log", "loglog" are supported.

object

A BSrel object.

mc.cores

Passed to mclapply.

...

Other parameters passed to the betareg function.

Details

See betareg function for details.

mclapply

Value

A data.frame containing the position, chromosome, P value, estimated methylation level in group 1 and group 2 and methylation difference of group 1 and group 2.

Author(s)

Katja Hebestreit

References

Hebestreit, K., Dugas, M., and Klein HU. Detection of significantly differentially methylated regions in targeted bisulfite sequencing Data. In preparation. Bioinformatics. 2013 Jul 1;29(13):1647-53.

See also reference list in the documentation of betareg.

See Also

betareg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# load RRBS data, subset to save time, find CpG clusters and smooth methylation data:
data(rrbs)
rrbs.small <- rrbs[1:1000,]
rrbs.clust.unlim <- clusterSites(object = rrbs.small,
                                 groups = colData(rrbs)$group,
                                 perc.samples = 4/5,
                                 min.sites = 20,
                                 max.dist = 100)

ind.cov <- totalReads(rrbs.clust.unlim) > 0
quant <- quantile(totalReads(rrbs.clust.unlim)[ind.cov], 0.9)
rrbs.clust.lim <- limitCov(rrbs.clust.unlim, maxCov = quant)

# with a small subset to save calculation time:
rrbs.part <- rrbs.clust.lim[1:100,]

predictedMeth <- predictMeth(object=rrbs.part)

betaResults <- betaRegression(formula = ~group, link = "probit",
                              object = predictedMeth, type="BR")

BiSeq documentation built on Nov. 1, 2018, 2:25 a.m.