overlapRegions(A, B, colA=NULL, colB=NULL, type="any", min.bases=1, min.pctA=NULL, min.pctB=NULL, get.pctA=FALSE, get.pctB=FALSE, get.bases=FALSE, only.boolean=FALSE, only.count=FALSE, ...)
toGRanges
(GenomicRanges
, data.frame
, etc...)toGRanges
(GenomicRanges
, data.frame
, etc...)AinB
: the region in A is contained in a region in B
BinA
: the region in B is contained in A
within
: the region in A or B is contained in a region in the other region set
equal
: the region in A has the same chromosome, start and end as a region in B
AleftB
: the end of the region from A overlaps the beginning of a region in B
ArightB
: the start of a region from A overlaps the end of a region in B
any
: any kind of overlap is returned
data.frame
with at least 5 columns "chr" indicating the chromosome of the appartenence of each overlap, "startA", "endA", "startB", "endB", indicating the coordinates of the region A and B for each overlap
"type" that describe the nature of the overlap (see arguments "type") eventually other columns can be added (see see arguments "colA", "colB", "get.pctA", "get.pctB", "get.bases")
plotRegions
, toDataframe
, toGRanges
, subtractRegions
, splitRegions
, extendRegions
, commonRegions
, mergeRegions
, joinRegions
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)
overlapRegions(A, B)
Run the code above in your browser using DataLab