rafalab / bumphunter

bumphunter
15 stars 14 forks source link

NA case in matchGenes() for CS and CE objects #4

Closed lcolladotor closed 9 years ago

lcolladotor commented 9 years ago

Hi,

Running the following code generates invalid if statements:

library('GenomicRanges')
library('bumphunter')
library('TxDb.Hsapiens.UCSC.hg19.knownGene')
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene

query <- GRanges('chr21', IRanges(22115534, 22115894), strand = "*")
genes <- annotateTranscripts(txdb = txdb)

res <- matchGenes(x = query, subject = genes)
traceback()

devtools::session_info()

Output

> library('GenomicRanges')
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap,
    parApply, parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB

The following object is masked from ‘package:stats’:

    xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, do.call, duplicated,
    eval, evalq, Filter, Find, get, intersect, is.unsorted, lapply, Map, mapply, match,
    mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce,
    rep.int, rownames, sapply, setdiff, sort, table, tapply, union, unique, unlist, unsplit

Loading required package: S4Vectors
Loading required package: stats4
Loading required package: IRanges
Loading required package: GenomeInfoDb
> library('bumphunter')
Loading required package: foreach
foreach: simple, scalable parallel programming from Revolution Analytics
Use Revolution R for scalability, fault tolerance and more.
http://www.revolutionanalytics.com
Loading required package: iterators
Loading required package: locfit
locfit 1.5-9.1   2013-03-22
Warning message:
multiple methods tables found for ‘score’ 
> library('TxDb.Hsapiens.UCSC.hg19.knownGene')
Loading required package: GenomicFeatures
Loading required package: AnnotationDbi
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with 'browseVignettes()'. To cite
    Bioconductor, see 'citation("Biobase")', and for packages 'citation("pkgname")'.

Attaching package: ‘AnnotationDbi’

The following object is masked from ‘package:GenomeInfoDb’:

    species

> txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
> 
> query <- GRanges('chr21', IRanges(22115534, 22115894), strand = "*")
> genes <- annotateTranscripts(txdb = txdb)
No annotationPackage supplied. Trying org.Hs.eg.db.
Loading required package: org.Hs.eg.db
Loading required package: DBI

Getting TSS and TSE.
Getting CSS and CSE.
Getting exons.
Annotating genes.
> 
> 
> res <- matchGenes(x = query, subject = genes)
Error in if (S < CS & E < CS) { : missing value where TRUE/FALSE needed
> traceback()
1: matchGenes(x = query, subject = genes)
> 
> devtools::session_info()
Session info------------------------------------------------------------------------------------------
 setting  value                                             
 version  R Under development (unstable) (2014-11-01 r66923)
 system   x86_64, darwin10.8.0                              
 ui       AQUA                                              
 language (EN)                                              
 collate  en_US.UTF-8                                       
 tz       America/New_York                                  

Packages----------------------------------------------------------------------------------------------
 package                           * version  date       source                                 
 AnnotationDbi                     * 1.29.17  2015-01-21 Bioconductor                           
 base64enc                           0.1.2    2014-06-26 CRAN (R 3.2.0)                         
 BatchJobs                           1.4      2014-09-24 CRAN (R 3.2.0)                         
 BBmisc                              1.7      2014-06-21 CRAN (R 3.2.0)                         
 Biobase                           * 2.27.2   2015-02-28 Bioconductor                           
 BiocGenerics                      * 0.13.6   2015-03-01 Bioconductor                           
 BiocParallel                        1.1.13   2015-01-27 Bioconductor                           
 biomaRt                             2.23.5   2014-11-22 Bioconductor                           
 Biostrings                          2.35.11  2015-02-22 Bioconductor                           
 bitops                              1.0.6    2013-08-17 CRAN (R 3.2.0)                         
 brew                                1.0.6    2011-04-13 CRAN (R 3.2.0)                         
 bumphunter                        * 1.7.5    2015-03-13 Github (lcolladotor/bumphunter@cbf10cd)
 checkmate                           1.5.0    2014-10-19 CRAN (R 3.2.0)                         
 codetools                           0.2.9    2014-08-21 CRAN (R 3.2.0)                         
 DBI                               * 0.3.1    2014-09-24 CRAN (R 3.2.0)                         
 devtools                            1.6.1    2014-10-07 CRAN (R 3.2.0)                         
 digest                              0.6.4    2013-12-03 CRAN (R 3.2.0)                         
 doRNG                               1.6      2014-03-07 CRAN (R 3.2.0)                         
 fail                                1.2      2013-09-19 CRAN (R 3.2.0)                         
 foreach                           * 1.4.2    2014-04-11 CRAN (R 3.2.0)                         
 GenomeInfoDb                      * 1.3.13   2015-02-13 Bioconductor                           
 GenomicAlignments                   1.3.29   2015-02-27 Bioconductor                           
 GenomicFeatures                   * 1.19.20  2015-03-02 Bioconductor                           
 GenomicRanges                     * 1.19.42  2015-03-01 Bioconductor                           
 IRanges                           * 2.1.41   2015-03-01 Bioconductor                           
 iterators                         * 1.0.7    2014-04-11 CRAN (R 3.2.0)                         
 lattice                             0.20.29  2014-04-04 CRAN (R 3.2.0)                         
 locfit                            * 1.5.9.1  2013-04-20 CRAN (R 3.2.0)                         
 matrixStats                         0.10.3   2014-10-15 CRAN (R 3.2.0)                         
 org.Hs.eg.db                      * 3.0.0    2014-09-26 Bioconductor                           
 pkgmaker                            0.22     2014-05-14 CRAN (R 3.2.0)                         
 R.methodsS3                         1.6.1    2014-01-05 CRAN (R 3.2.0)                         
 RCurl                               1.95.4.3 2014-07-29 CRAN (R 3.2.0)                         
 registry                            0.2      2012-01-24 CRAN (R 3.2.0)                         
 rngtools                            1.2.4    2014-03-06 CRAN (R 3.2.0)                         
 Rsamtools                           1.19.38  2015-02-28 Bioconductor                           
 RSQLite                           * 1.0.0    2014-10-25 CRAN (R 3.2.0)                         
 rstudioapi                          0.1      2014-03-27 CRAN (R 3.2.0)                         
 rtracklayer                         1.27.8   2015-03-02 Bioconductor                           
 S4Vectors                         * 0.5.21   2015-02-22 Bioconductor                           
 sendmailR                           1.2.1    2014-09-21 CRAN (R 3.2.0)                         
 stringr                             0.6.2    2012-12-06 CRAN (R 3.2.0)                         
 TxDb.Hsapiens.UCSC.hg19.knownGene * 3.0.0    2014-09-26 Bioconductor                           
 XML                                 3.98.1.1 2013-06-20 CRAN (R 3.2.0)                         
 xtable                              1.7.4    2014-09-12 CRAN (R 3.2.0)                         
 XVector                           * 0.7.4    2015-02-08 Bioconductor                           
 zlibbioc                            1.13.1   2015-02-11 Bioconductor                           
>