[BioC] Bug (?) in IRanges::findOverlaps(self, ignoreSelf=TRUE, ignoreRedundat=TRUE)

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed May 12 21:54:29 CEST 2010


Hi,

On Wed, May 12, 2010 at 3:35 PM, Steve Lianoglou
<mailinglist.honeypot at gmail.com> wrote:
> Hi,
>
> I think I've found a corner case in the findOverlaps function when you are:
>
> (i) omitting the subject arg
> (ii) both ignoreSelf and ignoreRedundant areTRUE
> (iii) and only 1 overlap should be returned(?) <-- not sure about this one

I think adding a judicious ",drop=FALSE]" in line112
IntervalTree-utils.R (rev 46808) would solve the problem, ie:

mat <- mat[!duplicated(norm_mat),,drop=FALSE]

-steve

>
> Example:
>
> R> x <- IRanges(c(1, 10, 20), width=c(5, 11, 5))
> R> findOverlaps(x, ignoreSelf=TRUE, ignoreRedundant=TRUE)
> Error in checkSlotAssignment(object, name, value) :
>  assignment of an object of class "integer" is not valid for slot
> "matchMatrix" in an object of class "RangesMatching"; is(value,
> "matrix") is not TRUE
>
> It works, however, when ignoreSelf && ignoreReduncant == FALSE
>
> R> findOverlaps(x, ignoreRedundant=TRUE)  ## this is fine
> R> findOverlaps(x, ignoreSelf=TRUE)  ## also fine
>
> sessionInfo()
> R version 2.11.0 Patched (2010-05-05 r51909)
> x86_64-apple-darwin9.8.0
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] grid      stats     graphics  grDevices utils     datasets
> methods   base
>
> other attached packages:
>  [1] GenomeGraphs_1.8.0                 biomaRt_2.4.0
>    bitops_1.0-4.1                     Rsamtools_1.0.1
>  [5] BSgenome.Hsapiens.UCSC.hg18_1.3.16 BSgenome_1.16.1
>    GenomicRanges_1.0.1                RSQLite_0.8-4
>  [9] DBI_0.2-5                          Biostrings_2.16.0
>    IRanges_1.6.1
>
> loaded via a namespace (and not attached):
> [1] Biobase_2.8.0           GenomeAnnotations_0.1.1 RCurl_1.3-1
>     tools_2.11.0            XML_2.8-1
>
> --
> Steve Lianoglou
> Graduate Student: Computational Systems Biology
>  | Memorial Sloan-Kettering Cancer Center
>  | Weill Medical College of Cornell University
> Contact Info: http://cbio.mskcc.org/~lianos/contact
>



-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the Bioconductor mailing list