annotate_to_genomic_features: Annotate to genomic features

Description Usage Arguments Details Value Author(s) Examples

Description

Annotate to genomic features

Usage

1
2
annotate_to_genomic_features(gr, genomic_features,
    name = NULL, type = c("percent", "number"), prefix = "overlap_to_", ...)

Arguments

gr

a GRanges object

genomic_features

a single GRanges object or a list of GRanges objects

name

names for the genomic features if there is no name in genomic_features

type

How to calculate the values for the annotation. number means numbers of genomic features that each region in gr overlap; percent means the percent of each region in gr that is overlapped by genomic features

prefix

prefix for names of the annotation columns

...

pass to countOverlaps or percentOverlaps

Details

It adds new columns in gr which tell you how gr is overlaped by genomic_features.

Note for the annotation, strand information is ignored.

Value

A GRanges with additional columns of annotations.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

1
2
3
4
5
6
7
8
9
require(circlize)
df1 = generateRandomBed(nr = 1000)
df2 = generateRandomBed(nr = 1000)
df3 = generateRandomBed(nr = 1000)
gr1 = GRanges(seqnames = df1[[1]], ranges = IRanges(df1[[2]], df1[[3]]))
gr2 = GRanges(seqnames = df2[[1]], ranges = IRanges(df2[[2]], df2[[3]]))
gr3 = GRanges(seqnames = df3[[1]], ranges = IRanges(df3[[2]], df3[[3]]))
annotate_to_genomic_features(gr1, list(gr2 = gr2, gr3 = gr3))
annotate_to_genomic_features(gr1, list(gr2 = gr2, gr3 = gr3), type = "number", prefix = "#")

eilslabs/epic documentation built on May 16, 2019, 1:24 a.m.