subtractRegions {regioneR} | R Documentation |
Function for subtracting a region set from another region set.
subtractRegions(A, B)
A |
a region set in any of the accepted formats by |
B |
a region set in any of the accepted formats by |
This function returns the regions in A minus the parts of them overlapping the regions in B. Overlapping regions in the result will be fused.
The implementation relies completely in the setdiff
function from IRanges
package.
A GenomicRanges object
A <- data.frame(chr=1, start=c(1, 15, 24, 31), end=c(10, 20, 30, 35)) B <- data.frame(chr=1, start=c(2, 12, 24, 35), end=c(5, 25, 29, 40)) subtract <- subtractRegions(A, B) plotRegions(list(A, B, subtract), chromosome=1, regions.labels=c("A", "B", "subtract"), regions.colors=3:1)