Learn R Programming

rphast (version 1.0)

overlap.feat: Feature overlap...

Description

Feature overlap

Usage

overlap.feat(x, filter, numbase=1, min.percent=NULL, overlapping=TRUE,
    get.fragments=FALSE, pointer.only=FALSE)

Arguments

x
An object of type feat containing features to select
filter
An object of type feat which determines which elements of x to select
numbase
The number of bases of overlap between x and filter required to choose a record. Use NULL to ignore (but then min.percent must be defined)
min.percent
The minimum percent that a record must overlap with the combined records in filter in order to be chosen
overlapping
If FALSE, choose records with less than numbase overlapping bases, and less than min.percent fraction overlap if min.percent is not NULL
get.fragments
If FALSE, entire records are selected from x based on whether they meet selection criteria. If TRUE, return only the fragments of x that overlap with filter. In this case, the same fragments may be output multiple times, if t
pointer.only
If TRUE, the return object will only be a pointer to an object stored in C (useful for very large features; advanced use only).

Value

  • an object of type feat containing the selected entries from x.

Details

Creates a features object containing all the features from one set which overlap features from another.

Examples

Run this code
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))

overlap.feat(feat1, feat1)
overlap.feat(feat1, feat2, min.percent=0.25)
overlap.feat(feat1, feat2, min.percent=0.25, overlapping=FALSE)
overlap.feat(feat1, feat2, get.fragments=TRUE)
overlap.feat(feat1, feat2, get.fragments=TRUE)
rm(feat1, feat2)

Run the code above in your browser using DataLab