findDMRs: Aggregates CpG sites to DMRs

Description Usage Arguments Value Author(s) See Also Examples

View source: R/findDMRs.R

Description

This function aggregates CpG sites to DMRs on the basis of their P values.

Usage

1
findDMRs(test.out, alpha, max.dist, diff.dir)

Arguments

test.out

An object returned by betaRegression.

alpha

OPTIONAL. A DMR contains CpG sites with P values smaller or equal than alpha.

max.dist

Numeric. The maximum distance between two P values smaller than alpha in a DMR. Should be the same as grid.dist in predictMeth.

diff.dir

Logical. Should DMRs be seperated if the direction of methylation differences changes? If TRUE (default), than resulting DMRs will consist of sites which are all hypomethylated, or hypermethylated respectively.

Value

A GRanges object storing the start and end positions of the DMRs with information in metadata columns:

median.p

median of P values

median.meth.group1

median of modeled methylation level of group1.

median.meth.group1

median of modeled methylation level of group2.

median.meth.diff

median of difference of modeled methylation levels of group1 and group2.

Author(s)

Katja Hebestreit

See Also

predictMeth, betaRegression

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Variogram under Null hypothesis (for resampled data):
data(vario)

plot(vario$variogram$v)
vario.sm <- smoothVariogram(vario, sill=0.9)

# auxiliary object to get the pValsList for the test
# results of interest:
data(betaResults)
vario.aux <- makeVariogram(betaResults, make.variogram=FALSE)

# Replace the pValsList slot:
vario.sm$pValsList <- vario.aux$pValsList

## vario.sm contains the smoothed variogram under the Null hypothesis as
## well as the p Values that the group has an effect on DNA methylation.

locCor <- estLocCor(vario.sm)

clusters.rej <- testClusters(locCor, FDR.cluster = 0.1)

clusters.trimmed <- trimClusters(clusters.rej, FDR.loc = 0.05)

DMRs <- findDMRs(clusters.trimmed, max.dist=100, diff.dir=TRUE)

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