limitCov {BiSeq} | R Documentation

## 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)

### 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.

### Value

A `BSraw` object.

### Author(s)

Katja Hebestreit

### See Also

`predictMeth`, `binomLikelihoodSmooth`

### Examples

    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)

[Package BiSeq version 1.26.0 Index]