bed_subtract: Subtract two sets of intervals.

Description Usage Arguments Details See Also Examples

View source: R/bed_subtract.r

Description

Subtract y intervals from x intervals.

Usage

1

Arguments

x

tbl_interval()

y

tbl_interval()

any

remove any x intervals that overlap y

Details

input tbls are grouped by chrom by default, and additional groups can be added using dplyr::group_by(). For example, grouping by strand will constrain analyses to the same strand. To compare opposing strands across two tbls, strands on the y tbl can first be inverted using flip_strands().

See Also

http://bedtools.readthedocs.io/en/latest/content/tools/subtract.html

Other multiple set operations: bed_closest, bed_coverage, bed_intersect, bed_map, bed_window

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
x <- trbl_interval(
  ~chrom, ~start, ~end,
  'chr1', 1,      100
)

y <- trbl_interval(
  ~chrom, ~start, ~end,
  'chr1', 50,     75
)

bed_glyph(bed_subtract(x, y))

x <- trbl_interval(
 ~chrom, ~start, ~end,
 'chr1', 100,    200,
 'chr1', 250,    400,
 'chr1', 500,    600,
 'chr1', 1000,   1200,
 'chr1', 1300,   1500
)

y <- trbl_interval(
 ~chrom, ~start, ~end,
 'chr1', 150,    175,
 'chr1', 510,    525,
 'chr1', 550,    575,
 'chr1', 900,    1050,
 'chr1', 1150,   1250,
 'chr1', 1299,   1501
)

bed_subtract(x, y)

bed_subtract(x, y, any = TRUE)

rnabioco/valr documentation built on Jan. 6, 2019, 9:06 a.m.