Hi Peter,

The new validity method for Hits revealed some issues with
the behavior of "distanceToNearest" method for GRanges objects.
The major issue being that it sometimes returns a Hits
object with NAs in it. Val will address this in the next few
days.

Cheers,
H.


On 11/05/2014 06:21 PM, Peter Hickey wrote:
This message may be a bit premature or redundant since after writing it I now 
see that Herve is in the midst of work on the Hits class in S4Vectors.

My package GenomicTuples is currently failing R CMD check in the devel branch 
(http://bioconductor.org/checkResults/devel/bioc-LATEST/GenomicTuples/zin2-checksrc.html).
 I tracked down the error to a problem with my 
distanceToNearest,GTuples,GTuples-method. However, this is simply defined via 
inheritance to the distanceToNearest,GenomicRanges,GenomicRanges-method and so 
I believe the problem lies with the 
distanceToNearest,GenomicRanges,GenomicRanges-method.

The following example adapted from nearest-methods {GenomicRanges} docs 
demonstrates the change in behaviour between the release and devel branch. It 
appears to be due to a new validity check of the Hits object returned by 
distanceToNearest. As I said, I now see that Herve recently started some work 
on the Hits class in S4Vectors, which includes this validity check, so this is 
really just a heads up that these changes affect the distanceToNearest method, 
in case this hasn't already been noted.

Thanks,
Pete

#---------------------------------------------------------------------------------------------------
# BioC release
   library(GenomicRanges)
   query <- GRanges(c("A", "B"), IRanges(c(1, 5), width=1))
   subject <- GRanges("A", IRanges(c(6, 5, 13), c(10, 10, 15)))
   distanceToNearest(query, subject)
Hits of length 2
queryLength: 2
subjectLength: 3
   queryHits subjectHits  distance
    <integer>   <integer> <integer>
  1         1           2         3
  2         2          NA        NA
sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8
  [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8
  [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] GenomicRanges_1.18.1 GenomeInfoDb_1.2.2   IRanges_2.0.0
[4] S4Vectors_0.4.0      BiocGenerics_0.12.0

loaded via a namespace (and not attached):
[1] XVector_0.6.0
#---------------------------------------------------------------------------------------------------

#---------------------------------------------------------------------------------------------------
# BioC devel
   library(GenomicRanges)
query <- GRanges(c("A", "B"), IRanges(c(1, 5), width=1))
subject <- GRanges("A", IRanges(c(6, 5, 13), c(10, 10, 15)))
distanceToNearest(query, subject)
Error in validObject(.Object) :
   invalid class “Hits” object: 'subjectHits(x)' must contain non-NA values >= 1 
and <= 'subjectLength(x)'
sessionInfo()
R Under development (unstable) (2014-10-29 r66891)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
  [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8
  [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8
  [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] GenomicRanges_1.19.4 GenomeInfoDb_1.3.6   IRanges_2.1.5
[4] S4Vectors_0.5.3      BiocGenerics_0.13.0

loaded via a namespace (and not attached):
[1] XVector_0.7.1
#---------------------------------------------------------------------------------------------------

--------------------------------
Peter Hickey,
PhD Student/Research Assistant,
Bioinformatics Division,
Walter and Eliza Hall Institute of Medical Research,
1G Royal Parade, Parkville, Vic 3052, Australia.
Ph: +613 9345 2324

[email protected]
http://www.wehi.edu.au

______________________________________________________________________
The information in this email is confidential and inte...{{dropped:19}}

_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel

Reply via email to