compute_coverage: Compute coverage over a Ranges object

Description Usage Arguments Value See Also Examples

View source: R/endo-coverage.R

Description

Compute coverage over a Ranges object

Usage

1
compute_coverage(x, shift, width, weight, ...)

Arguments

x

a Ranges object

shift

shift how much should each range in x be shifted by? (default = 0L)

width

width how long should the returned coverage score be? This must be either a positive integer or NULL (default = NULL)

weight

weight how much weight should be assigned to each range? Either an integer or numeric vector or a column in x. (default = 1L)

...

other optional parameters to pass to coverage

Value

An expanded Ranges object with a score column corresponding to the coverage value over that interval. Note that compute_coverage drops metadata associated with the orginal ranges.

See Also

IRanges::coverage(), GenomicRanges::coverage()

Examples

1
2
3
4
rng <- as_iranges(data.frame(start = 1:10, width = 5))
compute_coverage(rng)
compute_coverage(rng, shift = 14L)
compute_coverage(rng, width = 10L)

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