[Bioc-devel] distanceToNearest Self Query

Dario Strbenac D.Strbenac at garvan.org.au
Wed Sep 5 08:00:16 CEST 2012


Hello,

In findOverlaps, there is an argument ignoreSelf, that means overlaps aren't found for the same range when only the query object is provided. I was hoping I could use something similar for the distanceToNearest function in GenomicRanges, with only the query provided. Would this be a worthwhile addition ?

Example :

> g1
GRanges with 3 ranges and 0 metadata columns:
      seqnames       ranges strand
         <Rle>    <IRanges>  <Rle>
  [1]        1 [   1,    2]      +
  [2]        1 [  10,   11]      +
  [3]        1 [1000, 1010]      +
  ---
  seqlengths:
    1
   NA
> distanceToNearest(g1, ignoreSelf = TRUE) # Not implemented
DataFrame with 3 rows and 3 columns
  queryHits subjectHits  distance
  <integer>   <integer> <integer>
1         1           1         0
2         2           2         0
3         3           3         0
> findOverlaps(g1, ignoreSelf = TRUE) # Implemented
Hits of length 0
queryLength: 3
subjectLength: 3

--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia



More information about the Bioc-devel mailing list