summarizeRegions {BiSeq} | R Documentation

## Aggregates methylation information of single CpG sites

### Description

This method summarizes the methylation states of single CpG sites to a single methylation state for a given genomic region.

### Usage

    summarizeRegions(object, regions, outputAll)

### Arguments

`object` | An `BSraw` or `BSrel` object.
`regions` | A `GRanges` object storing the genomic regions.
`outputAll` | A logical. If `outputAll = TRUE`, all regions will be returned. If `FALSE` (default), regions are dropped if their coverage is zero.

### Details

When the given object is of class `BSraw-class`, all (methylated) reads of all CpG site lying within a region are summed up and assign as total number of (methylated) reads to that region. It is recommended to use `limitCov` before applying `summarizeRegions` to an `BSraw-class` object in order to avoid an excessive influence of a single CpG site on the methylation value of a region. When the given object is of class `BSrel-class`, the mean relative methylation of all CpGs within a region is assign to that region.

The `rowRanges` slot of the returned object is the given object `regions` with all columns preserved.

### Value

An `BSraw` or an `BSrel` object storing methylation information about the given regions.

### Author(s)

Hans-Ulrich Klein

### See Also

`BSraw-class`, `BSrel-class`, `limitCov`

### Examples

    data(rrbs)
    rrbs.clustered <- clusterSites(rrbs)
    regions <- clusterSitesToGR(rrbs.clustered)

    rrbs <- limitCov(rrbs, maxCov=50)
    rrbsRegion <- summarizeRegions(rrbs, regions)
    totalReads(rrbsRegion)

[Package BiSeq version 1.22.0 Index]