addRegionSubsegments {RnBeads} | R Documentation

## addRegionSubsegments

### Description

For the region annotation of a given `RnBSet` object. Subdivide each region into subsegments by hierarchical clustering on the site distances in a particular region and then splitting the region into subregions consisting of these site clusters. The number of clusters is determined in such way that the mean number of sites per cluster is given by the `ns` parameter.

### Usage

    addRegionSubsegments(rnb.set, annotation.dir, region.types = NULL,
      add.region.types.to.options = FALSE, ns = 10)

### Arguments

`rnb.set` | an `RnBSet object`
`annotation.dir` | a directory to save the annotation to for later reloading. (binary `RData` format.)
`region.types` | the region types to which subsegmentation should be applied. Must be a non-empty subset of `summarized.regions(rnb.set)`. Defaults (`NULL`) to all region types in `rnb.set`
`add.region.types.to.options` | Flag indicating whether to add the newly created subregions to the package's `region.types` option
`ns` | the mean number of sites per cluster.

### Value

the modified `RnBSet` object

### Author(s)

Fabian Mueller

### Examples

    library(RnBeads.hg19)
    data(small.example.object)
    logger.start(fname=NA)
    rnb.set.mod <- addRegionSubsegments(rnb.set.example,tempdir(),region.types=c("tiling","genes"))
    summary(meth(rnb.set.mod,type="tiling.subsegments"))

[Package RnBeads version 2.4.0 Index]