mergeRegions | R Documentation |
Merges the overlapping regions from two region sets. The two region sets are first merged into one and then overlapping regions are fused.
mergeRegions(A, B)
A |
a region set in any of the accepted formats by |
B |
a region set in any of the accepted formats by |
It returns a GenomicRanges
object with the regions resulting from the merging process. Any two overlapping regions from any of the two sets will be fused into one.
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.
The implementation relies completely in the reduce
function from IRanges
package.
plotRegions
, toDataframe
, toGRanges
, subtractRegions
, splitRegions
, extendRegions
, joinRegions
, commonRegions
, overlapRegions
A <- data.frame("chr1", c(1, 5, 20, 30), c(8, 13, 28, 40), x=c(1,2,3,4), y=c("a", "b", "c", "d"))
B <- data.frame("chr1", 25, 35)
merges <- mergeRegions(A, B)
plotRegions(list(A, B, merges), chromosome="chr1", regions.labels=c("A", "B", "merges"), regions.colors=3:1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.