numOverlaps: Number Of Overlaps

Description Usage Arguments Value See Also Examples

View source: R/numOverlaps.R

Description

Returns the number of regions in A overlapping any region in B

Usage

1
numOverlaps(A, B, count.once=FALSE, ...)

Arguments

A

a region set in any of the formats accepted by toGRanges (GenomicRanges, data.frame, etc...)

B

a region set in any of the formats accepted by toGRanges (GenomicRanges, data.frame, etc...)

count.once

boolean indicating whether the overlap of multiple B regions with a single A region should be counted once or multiple times

...

any additional parameters needed

Value

It returns a numeric value that is the number of regions in A overlapping at least one region in B.

See Also

overlapPermTest, permTest

Examples

1
2
3
4
5
6
7
genome <- filterChromosomes(getGenome("hg19"), keep.chr="chr1")
A <- createRandomRegions(nregions=20, length.mean=10000000, length.sd=20000, genome=genome, non.overlapping=FALSE) 
B <- c(A, createRandomRegions(nregions=10, length.mean=10000, length.sd=20000, genome=genome, non.overlapping=FALSE))

numOverlaps(A, B)
numOverlaps(A, B, count.once=TRUE)
 

regioneR documentation built on Nov. 8, 2020, 5 p.m.