numOverlaps {regioneR} | R Documentation

## Number Of Overlaps

### Description

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

### Usage

    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

    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)

[Package regioneR version 1.20.1 Index]