## toy example:
regionsH3ac <- data.frame(chr=c("chr1","chr7","chr8","chr1","chrX","chr8"), start=c(100,100,100,510,100,60), end=c(200, 200, 200,520,200,80))
regionsH4ac <- data.frame(chr=c("chr1","chr2","chr7","chr8","chr9"),
start=c(500,100,50,80,100), end=c(700, 200, 250, 120,200))
## compare the regions first by eye
## which ones do overlap and by what amount?
regionsH3ac
regionsH4ac
## compare it to the result:
as.matrix(regionOverlap(regionsH3ac, regionsH4ac))
nonzero(regionOverlap(regionsH3ac, regionsH4ac))
Run the code above in your browser using DataLab