Learn R Programming

rphast (version 1.6.9)

coverage.feat: Features coverage

Description

Features coverage

Usage

coverage.feat(..., or = FALSE, not = FALSE, get.feats = FALSE,
  pointer.only = FALSE)

Arguments

...

objects of type feat

or

if TRUE, get the coverage of union of feat arguments. or is FALSE by default, which takes the intersection.

not

If not NULL, a vector of logicals the same length as the number of features provided (or will be recycled to this length). For each value which is TRUE, then any base *not* included in this feature will be counted. (The negation is done before any other operation). If NULL, do not negate any features. There must be at least one feature which is not negated (so that boundaries can be established).

get.feats

if TRUE, return an object of type feat representing the intersection (or union of or==TRUE) of the features

pointer.only

(Only used if get.feats==TRUE). If TRUE, the features object returned will be stored as a pointer to an object in C.

Value

The number of bases covered by the feat arguments, or the combined feat object if get.feats==TRUE.

Examples

Run this code
# NOT RUN {
feat1 <- feat(seqname=c(rep("chr1", 3), rep("chr2", 2)),
              start=c(1, 5, 100, 10, 20),
              end=c(7, 10, 105, 15, 30))
feat2 <- feat(seqname=c("chr1","chr2"),
              start=c(1,1), end=c(5,10))
coverage.feat(feat1, feat2, or=FALSE)
coverage.feat(feat1, feat2, or=TRUE)
coverage.feat(feat1, feat2, get.feats=TRUE, or=TRUE)
coverage.feat(feat1, feat2, or=TRUE)
rm(feat1, feat2)
# }

Run the code above in your browser using DataLab