ucsc.pos.subset: ucsc.pos.subset

Description Usage Arguments Details Value Author(s) Examples

Description

For a set of UCSC style intervals, produce a new set of intervals that are subsets of those intervals. Strand must be provided, because intervals are strand-less, but the logic to subset an interval depends very much on the strand.

Usage

1
  ucsc.pos.subset(intervals, start, stop, strand)

Arguments

intervals

vector of UCSC style intevals, eg "chr1:100-300"

start

vector of numerics defining the starting base within each interval (1-based)

stop

vector of numerics defining the ending base within each interval (1-based). NB stop can be longer than the original interval.

strand

either a charcter vector of "+"/"-", or 0,1, or -1,1

Details

eg: subset chr1:1000-1100 (+) to the interval that starts at 2-7 -> chr1:1001-1006 eg: subset chr1:1000-1100 (-) to the interval that starts at 2-7 -> chr1:1094-1099

Value

a vector of UCSC style intervals, adjusted as detailed above

Author(s)

Mark Cowley, 2009-01-08

Examples

1
2
3
4
5
ucsc.pos.subset("chr1:1000-1100", 1,11, "+")
# [1] "chr1:1000-1010"
ucsc.pos.subset("chr1:1000-1100", 1,11, "-")
# [1] "chr1:1090-1100"
# (you can use > 1 entry too.)

drmjc/genomics documentation built on May 15, 2019, 2:22 p.m.