[Bioc-sig-seq] findOverlaps with GenomicRanges?

Janet Young jayoung at fhcrc.org
Wed Feb 23 05:22:22 CET 2011

Hi there,

Is findOverlaps supposed to work on GRanges objects?  For me it works on RangedData but not on GRanges - see below for the error, sessionInfo, etc.   It would be useful for me if it could also work on GRanges, so if this doesn't count as a bug report can we count it as a feature request? 

thanks very much,



Dr. Janet Young (Trask lab)

Fred Hutchinson Cancer Research Center
1100 Fairview Avenue N., C3-168, 
P.O. Box 19024, Seattle, WA 98109-1024, USA.

tel: (206) 667 1471 fax: (206) 667 6524
email: jayoung  ...at...  fhcrc.org



> library(GenomicRanges)
Loading required package: IRanges

Attaching package: 'IRanges'

The following object(s) are masked from 'package:base':

    cbind, eval, Map, mapply, order, paste, pmax, pmax.int, pmin,
    pmin.int, rbind, rep.int, table

> myregions_GR <- GRanges(seqnames=c("chr1","chr1","chr2"),ranges=IRanges(start=c(101L,201L,101L),end=c(250L,301L,201L))   )
> findOverlaps(myregions_GR)
Error in match.arg(type) : 'arg' must be of length 1
> myregions_RD <- RangedData(IRanges(start=c(101L,201L,101L),end=c(250L,301L,201L)),space=c("chr1","chr1","chr2"),strand=c("+","+","+")   )
> findOverlaps(myregions_RD)
RangesMatchingList of length 2
names(2): chr1 chr2
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-unknown-linux-gnu (64-bit)

 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] GenomicRanges_1.2.3 IRanges_1.8.9      

More information about the Bioc-sig-sequencing mailing list