find_neighbours: Find neighbour regions

Description Usage Arguments Details Value Author(s) Examples

View source: R/common_utils.R

Description

Find neighbour regions

Usage

1
find_neighbours(query, reference, upstream = 1000, downstream = 1000)

Arguments

query

a GRanges object

reference

a GRanges object

upstream

upstream that query is extended

downstream

downstream that query is extended

Details

With a certain extension of query, this funciton looks for reference which intersects the extended regions.

Value

A GRanges object which contains regions in query for which the extended regisons are overlapped with reference. There are three meta columns added:

distance:

distance from the query to corresponding reference

query_index:

index of regions in query

reference_index:

index of regions in reference

Note one reference can correspond to multiple query regions.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

Examples

1
2
3
4
gr1 = GRanges(seqname = "chr1", ranges = IRanges(start = c(4, 10), end = c(6, 16)))
gr2 = GRanges(seqname = "chr1", ranges = IRanges(start = c(7, 13), end = c(8, 20)))
find_neighbours(gr1, gr2, upstream = 3, downstream = 3)
find_neighbours(gr1, gr2, upstream = 10, downstream = 10)

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