bed_window: Identify intervals within a specified distance.

Description Usage Arguments Details See Also Examples

View source: R/bed_window.r

Description

Identify intervals within a specified distance.

Usage

1
bed_window(x, y, genome, ...)

Arguments

x

tbl_interval()

y

tbl_interval()

genome

tbl_genome()

...

params for bed_slop and bed_intersect

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.org/en/latest/content/tools/window.html

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

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
35
36
37
38
39
40
x <- trbl_interval(
 ~chrom, ~start, ~end,
 'chr1', 25,     50,
 'chr1', 100,    125
)

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

genome <- trbl_genome(
  ~chrom, ~size,
  'chr1', 125
)

bed_glyph(bed_window(x, y, genome, both = 15))

x <- trbl_interval(
  ~chrom, ~start, ~end,
  "chr1", 10,    100,
  "chr2", 200,    400,
  "chr2", 300,    500,
  "chr2", 800,    900
)

y <- trbl_interval(
  ~chrom, ~start, ~end,
  "chr1", 150,    400,
  "chr2", 230,    430,
  "chr2", 350,    430
)

genome <- trbl_genome(
  ~chrom, ~size,
  "chr1", 500,
  "chr2", 1000
)

bed_window(x, y, genome, both = 100)

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