coverage {IRanges} | R Documentation |
Counts the number of times a position is represented in a set of ranges.
coverage(x, start=NA, end=NA, ...) ## S4 method for signature 'IRanges': coverage(x, start=NA, end=NA, weight=1L)
x |
An IRanges or MaskCollection object. |
start |
A single integer specifying the position in x where to start the
extraction of the coverage.
|
end |
A single integer specifying the position in x where to end the
extraction of the coverage.
|
weight |
An integer vector specifying how much each element in x counts.
|
... |
Further arguments to be passed to or from other methods. |
An Rle object representing the coverage of x
in the interval
specified by the start
and end
arguments. An integer value
called the "coverage" can be associated to each position in x
,
indicating how many times this position is covered by the ranges stored in
x
. Note that the positions in the returned XInteger object are
to be interpreted as relative to the interval specified by the start
and end
arguments.
Rle-class, IRanges-class, MaskCollection-class
x <- IRanges(start=c(-2L, 6L, 9L, -4L, 1L, 0L, -6L, 10L), width=c( 5L, 0L, 6L, 1L, 4L, 3L, 2L, 3L)) coverage(x, start=-6, end=20) # 'start' and 'end' must be specified for # an IRanges object. coverage(shift(x, 2), start=-6, end=20) coverage(restrict(x, 1, 10), start=-6, end=20) coverage(reduce(x), start=-6, end=20) coverage(gaps(x, start=-6, end=20), start=-6, end=20) mask1 <- Mask(mask.width=29, start=c(11, 25, 28), width=c(5, 2, 2)) mask2 <- Mask(mask.width=29, start=c(3, 10, 27), width=c(5, 8, 1)) mask3 <- Mask(mask.width=29, start=c(7, 12), width=c(2, 4)) mymasks <- append(append(mask1, mask2), mask3) coverage(mymasks)