How about this:

Find ranges in 'b' completely contained within ranges in 'a':

ol <- overlap(a, b)
m <- as.matrix(ol)
contained <- m[width(ranges(ol)) == width(b[m[,1]]),]

So 'contained' is the overlap matrix, filtered by whether the intersection
of the overlap (ranges(ol)) has the same width as the query range.

On Fri, Feb 20, 2009 at 4:53 PM, Elizabeth Purdom <epurdom@stat.berkeley.edu
> wrote:

> Hi,
> I'm very happy with the efficiency of the overlap function and I was
> wondering if there is a fast way in IRanges to find which of the ranges in
> one set are completely contained by one or more ranges in another set (i.e.
> the same idea as overlap, but more restrictive criteria than any overlap)? I
> don't want to assume anything about my two set of ranges (e.g. that they are
> 'normal').
> Thanks very much,
> Elizabeth Purdom
> UC, Berkeley
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

