Skip to content
Prev 275473 / 398506 Next

[BioC] comparing two tables

On 10/25/2011 03:42 AM, Assa Yeroslaviz wrote:
Hi Assa --

In Bioconductor, use the GenomicRanges package. Create two GRanges objects

   genes = with(genetable, GRanges(chr, IRanges(start, end), str,
                                   accession=accession, Length=length)
   locations = with(locationtable, GRanges(Chr, IRanges(Start, End)))

then

   olaps = findOverlaps(genes, locations)

queryHits(olaps) and subjectHits(olaps) index each gene with all 
locations it overlaps. The definition of 'overlap' is flexible, see 
?findOverlaps.

Martin