[BioC] GenomicRanges::findOverlap unexpected behaviour with 0 width ranges

Daniel Cameron [guest] guest at bioconductor.org
Fri Sep 20 07:54:11 CEST 2013


The hits returned when using findOverlap seem strange when a zero width range is involved. By default, findOverlap does not return any hits with a zero width range, even if other range contains the zero width range. Presumably this is due the requirement of a positive, non-zero minoverlap. If a maxgap is set, a hit is returned only if the zero width range is the query.

According to the documentation, "all matches must additionally satisfy the minoverlap constraint". This constraint is violated when a zero-width range is passed as the query parameter with a non-zero maxgap. I presume this is a bug, is it not?

rangeZero <- IRanges(5, 4)
rangeContains <- IRanges(3, 6)
rangeStartMatch <- IRanges(5, 5)
findOverlaps(rangeZero, rangeContains) # no match
findOverlaps(rangeZero, rangeStartMatch) # no match
findOverlaps(rangeContains, rangeZero) # no match
findOverlaps(rangeStartMatch, rangeZero) # no match
findOverlaps(rangeZero, rangeContains, maxgap=1) # match
findOverlaps(rangeZero, rangeStartMatch, maxgap=1) # match
findOverlaps(rangeContains, rangeZero, maxgap=1) # no match
findOverlaps(rangeStartMatch, rangeZero, maxgap=1) # no match


 -- output of sessionInfo(): 



R version 3.0.1 (2013-05-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

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

other attached packages:
[1] GenomicFeatures_1.12.3 AnnotationDbi_1.22.6   Biobase_2.20.1         GenomicRanges_1.12.5   IRanges_1.18.3         BiocGenerics_0.6.0    
[7] BiocInstaller_1.10.3  

loaded via a namespace (and not attached):
 [1] biomaRt_2.16.0     Biostrings_2.28.0  bitops_1.0-6       BSgenome_1.28.0    DBI_0.2-7          RCurl_1.95-4.1     Rsamtools_1.12.4   RSQLite_0.11.4    
 [9] rtracklayer_1.20.4 stats4_3.0.1       tools_3.0.1        XML_3.98-1.1       zlibbioc_1.6.0    

--
Sent via the guest posting facility at bioconductor.org.



More information about the Bioconductor mailing list