bed_coverage: Compute coverage of intervals.

Description Usage Arguments Details Value Note See Also Examples

View source: R/bed_coverage.R

Description

Compute coverage of intervals.

Usage

1

Arguments

x

tbl_interval()

y

tbl_interval()

...

extra arguments (not used)

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

Value

tbl_interval() with the following additional columns:

Note

Book-ended intervals are included in coverage calculations.

See Also

http://bedtools.readthedocs.org/en/latest/content/tools/coverage.html

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
x <- trbl_interval(
  ~chrom, ~start, ~end, ~strand,
  "chr1", 100,    500,  '+',
  "chr2", 200,    400,  '+',
  "chr2", 300,    500,  '-',
  "chr2", 800,    900,  '-'
)

y <- trbl_interval(
  ~chrom, ~start, ~end, ~value, ~strand,
  "chr1", 150,    400,  100,    '+',
  "chr1", 500,    550,  100,    '+',
  "chr2", 230,    430,  200,    '-',
  "chr2", 350,    430,  300,    '-'
)

bed_coverage(x, y)

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