subtractRegions: Subtract Regions

Description Usage Arguments Details Value Examples

View source: R/subtractRegions.R

Description

Function for subtracting a region set from another region set.

Usage

1

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...)

Details

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.

Value

A GenomicRanges object

Examples

1
2
3
4
5
6
7
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)

regioneR documentation built on Nov. 8, 2020, 5 p.m.