annotate_to_genomic_features: Annotate genomic regions to a list of genomic features

Description Usage Arguments Details Value Author(s) Examples

View source: R/genomic_region_annotation.R

Description

Annotate genomic regions to a list of genomic features

Usage

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

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 list. This is used for constructing the column name of the annotation columns.

type

For each type of genomic features, 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 the names in the annotation columns. The column names are constructed as "$prefix_$name"

ignore_strand

whether ignore strand information

...

pass to countOverlaps or percentOverlaps

Details

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

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 = "#")

jokergoo/epik documentation built on Sept. 28, 2019, 9:20 a.m.