Learn R Programming

rphast (version 1.0)

coverage.feat: Features coverage...

Description

Features coverage

Usage

coverage.feat(..., or=FALSE, get.feats=FALSE, not=NULL,
    region.bounds=NULL)

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.
get.feats
if TRUE, return an object of type feat representing the intersection (or union of or==TRUE) of the features.
not
If not NULL, a vector of logicals the same length as the number of features provided. For each value which is TRUE, the inverse of the feature will be used. If any element of not is TRUE, then the regi
region.bounds
An object of type feat which defines the start and end coordinates of all relevant chromosomes/regions in the provided feat objects. Used for taking inverses of the feat objects as required by the argument not. If not==NU

Value

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

Examples

Run this code
require("rphast")
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