compareTwoSamples {BiSeq} | R Documentation

## Detects DMRs by comparing two samples

### Description

Determines the differences of (smoothed) methylation levels between two samples and aggregates the sites surpassing a minimum difference to DMRs.

### Usage

    compareTwoSamples(object, sample1, sample2, minDiff, max.dist)

### Arguments

`object` | A `BSrel`.
`sample1` | A numeric or character specifying the first sample to be used.
`sample2` | A numeric or character specifying the second sample to be used.
`minDiff` | A numeric greater than 0 and smaller or equal to 1.
`max.dist` | Numeric. The maximum distance between two CpG sites (or grid points) with absolute methylation differences greater or equal than `minDiff` in a DMR. If grid points are used: should be the same as grid.dist in `predictMeth`.

### Details

This function determines the differences between the methylation levels of sample1 and sample2 for each site. Successive sites with methylation differences smaller or equal to `minDiff` are summarized.

### Value

A GRanges object.

### Author(s)

Katja Hebestreit

### See Also

`predictMeth`

### Examples

    data(rrbs)
    rrbs <- rrbs[, c(1,6)]
    CpG.clusters <- clusterSites(object = rrbs, perc.samples = 1,
                                 min.sites = 20, max.dist = 100)
    predictedMeth <- predictMeth(object = CpG.clusters)
    DMRs <- compareTwoSamples(predictedMeth, sample1 = 1, sample2 = 2,
                              minDiff = 0.3, max.dist = 100)

[Package BiSeq version 1.34.0 Index]