Learn R Programming

methylKit (version 0.99.2)

annotateWithFeature: Annotate object with a set of genomic features

Description

The function annotates given genomic feature or methylKit object with a set of annotation. It is primarily useful when annotating objects with simple genomic features, such as enhancer locations.

Usage

annotateWithFeature(target, feature, strand = FALSE, extend = 0,
  feature.name = "feat1")

# S4 method for GRanges,GRanges annotateWithFeature(target, feature, strand = FALSE, extend = 0, feature.name = "feat1")

# S4 method for methylDiff,GRanges annotateWithFeature(target, feature, strand = FALSE, extend = 0, feature.name = "feat1")

# S4 method for methylDiffDB,GRanges annotateWithFeature(target, feature, strand = FALSE, extend = 0, feature.name = "feat1")

Arguments

target

a methylDiff or a GRanges object storing chromosome locations to be annotated

feature

a GRanges object storing chromosome locations of a feature (can be CpG islands, ChIP-seq peaks, etc)

strand

If set to TRUE, annotation features and target features will be overlapped based on strand (def:FALSE)

extend

specifiying a positive value will extend the feature on both sides as much as extend

feature.name

name of the annotation feature. For example: H3K4me1, CpGisland etc.

Value

returns an annotationByFeature object

See Also

getMembers, getTargetAnnotationStats, getFeatsWithTargetsStats, plotTargetAnnotation

Examples

Run this code
# NOT RUN {
data(methylKit)
cpg.gr=readBed(system.file("extdata", "cpgi.hg18.bed.txt", 
package = "methylKit"),remove.unsual=TRUE)

annotateWithFeature(methylDiff.obj,cpg.gr,strand=FALSE,extend=0,
feature.name="CpGi")

# }

Run the code above in your browser using DataLab