filterSegments {AneuFinder} | R Documentation

## Filter segments by minimal size

### Description

`filterSegments` filters out segments below a specified minimal segment size. This can be useful to get rid of boundary effects from the Hidden Markov approach.

### Usage

    filterSegments(segments, min.seg.width)

### Arguments

`segments` | A `GRanges-class` object.
`min.seg.width` | The minimum segment width in base-pairs.

### Value

The input `model` with adjusted segments.

### Author(s)

Aaron Taudt

### Examples

    ## Load an HMM
    file <- list.files(system.file("extdata", "primary-lung", "hmms",
                      package="AneuFinderData"), full.names=TRUE)
    hmm <- loadFromFiles(file)[[1]]
    ## Check number of segments before and after filtering
    length(hmm$segments)
    hmm$segments <- filterSegments(hmm$segments, min.seg.width=2*width(hmm$bins)[1])
    length(hmm$segments)

[Package AneuFinder version 1.12.1 Index]