Learn R Programming

methylKit (version 0.99.2)

getFlanks: Get upstream and downstream adjacent regions to a genomic feature

Description

The function returns flanking regions on either side of a genomic feature. It is useful for getting flanking regions such as CpG island shores.

Usage

getFlanks(grange, flank = 2000, clean = TRUE)

# S4 method for GRanges getFlanks(grange, flank = 2000, clean = TRUE)

Arguments

grange

GRanges object for the feature

flank

number of basepairs for the flanking regions

clean

If set to TRUE, flanks overlapping with other main features will be trimmed, and overlapping flanks will be removed this will remove multiple counts when other features overlap with flanks

Value

GRanges object for flanking regions

Examples

Run this code
# NOT RUN {
# read the bed file as GRanges object
bed.file=system.file("extdata", "cpgi.hg18.bed.txt", package = "methylKit")
bed.gr=readBed(location=bed.file,remove.unsual=TRUE)

# get flanks on the either side
bed.flanks=getFlanks(bed.gr,flank=2000,clean=TRUE)

# }

Run the code above in your browser using DataLab