Learn R Programming

BiSeq (version 1.12.0)

predictMeth: Predicts methylation levels along CpG sites or for a grid of sites in CpG clusters.

Description

Uses local regression to predict methylation levels per sample.

Usage

predictMeth(object, h, grid.dist, mc.cores)

Arguments

object
A BSraw with a cluster.id metadata column on the rowRanges, usually the output of clusterSites.
h
Bandwidth in base pairs. Large values produce a smoother curve. Default is 80.
grid.dist
OPTIONAL. If numeric, than methylation values are predicted at intervals of grid.dist base pairs. By default, methylation is smoothed at each CpG site.
mc.cores
Passed to mclapply. Default is 1.

Value

BSrel object containing the predicted methylation levels in the methLevel slot.

Details

Uses binomLikelihoodSmooth with pos = CpG position, m = number methylated reads and n = number of reads. pred.pos corresponds to all CpG positions, or to the grid sites respectively, within the CpG clusters.

See Also

clusterSites, binomLikelihoodSmooth, mclapply

Examples

Run this code
data(rrbs)

rrbs.clust.unlim <- clusterSites(object = rrbs,
                                 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)

Run the code above in your browser using DataLab