genomic_corr_intersect: Intersections between two sets of genomic regions

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/genomic_region_correlation.R

Description

Intersections between two sets of genomic regions

Usage

1
genomic_corr_intersect(gr1, gr2, method = c("number", "percent", "length"), ...)

Arguments

gr1

genomic region 1, a GRanges object

gr2

genomic region 2, a GRanges object

method

how to calculate the intersection statistic, see "details"

...

pass to countOverlaps or percentOverlaps

Details

There are three metrics for the intersection statistic:

number

It calculates number of regions in gr1 that overlap with gr2. Please note this value is not equal to the number of intersections betweenn two sets of regions, because one region in gr1 may overlap with more than one regions in gr2.

percent

It calculates for each region in gr1, how much it is covered by regions in gr2.

length

sum of length of the intersection of the two sets of regions.

With methods of"number" and "percent", genomic_corr_intersect(gr1, gr2) is always not identical to genomic_corr_intersect(gr2, gr1).

Value

A single correlation value.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

See Also

genomic_regions_correlation

Examples

1
2
3
4
5
gr1 = GRanges(seqnames = "chr1", ranges = IRanges(c(1, 5), c(3, 8)))
gr2 = GRanges(seqnames = "chr1", ranges = IRanges(c(2, 6), c(4, 8)))
genomic_corr_intersect(gr1, gr2, method = "number")
genomic_corr_intersect(gr1, gr2, method = "percent")
genomic_corr_intersect(gr1, gr2, method = "length")

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