commonRegions {regioneR} | R Documentation

## Common Regions

### Description

Returns the regions that are common in two region sets, its intersection.

### Usage

    commonRegions(A, B)

### Arguments

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

### Value

It returns a `GenomicRanges` object with the regions present in both region sets.

### Note

All metadata (additional columns in the region set in addition to chromosome, start and end) will be ignored and not present in the returned region set.

### See Also

`plotRegions`, `toDataframe`, `toGRanges`, `subtractRegions`, `splitRegions`, `extendRegions`, `joinRegions`, `mergeRegions`, `overlapRegions`

### Examples

    A <- data.frame("chr1", c(1, 10, 20, 30), c(12, 13, 28, 40))

    B <- data.frame("chr1", 25, 35)

    commons <- commonRegions(A, B)

    plotRegions(list(A, B, commons), chromosome="chr1", regions.labels=c("A", "B", "common"), regions.colors=3:1)

[Package regioneR version 1.26.1 Index]