Learn R Programming

BiSeq (version 1.12.0)

limitCov: Limits the coverage of a BSraw object

Description

Number of methylated and unmethylated reads of a CpG site with coverage above maxCov are reduced such that the methylation level remains unchanged.

Usage

limitCov(object, maxCov)

Arguments

object
A BSraw.
maxCov
The maximum number of reads a CpG should have. All coverages above this threshold are limited. (Default is 50)

Value

BSraw object.

Details

This function might be useful prior to the use of predictMeth to limit the weights of CpGs with extremly high coverages. See binomLikelihoodSmooth for details.

See Also

predictMeth, binomLikelihoodSmooth

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)
covBoxplots(rrbs.clust.unlim)

# 90% quantile of coverage is 39x
quantile(totalReads(rrbs.clust.unlim)[totalReads(rrbs.clust.unlim)>0],
0.9)

rrbs.clust.lim <- limitCov(rrbs.clust.unlim, maxCov = 39)
covBoxplots(rrbs.clust.lim)

Run the code above in your browser using DataLab