ranges-setops: Vector-wise Range set-operations

Description Usage Arguments Details Value Examples

Description

Vector-wise Range set-operations

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15

Arguments

x, y

Two Ranges objects to compare.

Details

These are usual set-operations that act on the sets of the ranges represented in x and y. By default these operations will ignore any strand information. The directed versions of these functions will take into account strand for GRanges objects.

Value

A Ranges object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
gr1 <- data.frame(seqnames = "chr1",
                  start = c(2,9),
                  end = c(7,9),
                  strand = c("+", "-")) %>%
               as_granges()
gr2 <- data.frame(seqnames = "chr1", start = 5, width = 5, strand = "-") %>%
         as_granges()

union_ranges(gr1, gr2)
union_ranges_directed(gr1, gr2)

intersect_ranges(gr1, gr2)
intersect_ranges_directed(gr1, gr2)

setdiff_ranges(gr1, gr2)
setdiff_ranges_directed(gr1, gr2)
# taking the complement of a ranges requires annotation information
gr1 <- set_genome_info(gr1, seqlengths = 100)
complement_ranges(gr1)

plyranges documentation built on Nov. 8, 2020, 7:36 p.m.