rcavalcante / annotatr

Package Homepage: http://bioconductor.org/packages/devel/bioc/html/annotatr.html Bug Reports: https://support.bioconductor.org/p/new/post/?tag_val=annotatr.
26 stars 8 forks source link

build_annotations() error "argument to 'which' is not logical' #38

Closed wkc1986 closed 4 years ago

wkc1986 commented 4 years ago

From a fresh start:

> library(annotatr)
Warning messages:
1: multiple methods tables found for ‘which’
2: multiple methods tables found for ‘which’
> mm10.annots <- build_annotations("mm10", c("mm10_basicgenes"))
Loading required package: GenomicFeatures
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 objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

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

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

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: ‘S4Vectors’

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

    expand.grid

Loading required package: IRanges
Loading required package: GenomeInfoDb
Loading required package: GenomicRanges
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")'.

'select()' returned 1:1 mapping between keys and columns
Building promoters...
Error in base::which(x, arr.ind, useNames, ...) :
  argument to 'which' is not logical

R 4.0.0, annotatr 1.15.0. I'd appreciate it if you could help, thanks!

rcavalcante commented 4 years ago

Hello,

Thanks for giving the version number, I think that's the key to this mystery. Excuse me if you already know this, but release versions of Bioconductor packages are even (e.g. current release for annotatr is 1.14.0) and devel versions are odd (e.g. 1.15.0). Sometimes when there is a mixture of release and devel packages, things can get a little weird.

When I spin up the rcavalcante/r4.0_bioc3.11 docker image, I don't get the warnings you did for which, and the build_annotations() function works with the command you give.

I wonder, can you do BiocManager::valid() and give the result here?

Thanks.

wkc1986 commented 4 years ago

Thanks for the response. Yes, I had to install the developer version of another package. Here's output of valid():

> BiocManager::valid()

* sessionInfo()

R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
 [1] org.Mm.eg.db_3.11.1
 [2] TxDb.Mmusculus.UCSC.mm10.knownGene_3.10.0
 [3] GenomicFeatures_1.41.0
 [4] AnnotationDbi_1.51.0
 [5] Biobase_2.49.0
 [6] GenomicRanges_1.41.5
 [7] GenomeInfoDb_1.25.0
 [8] IRanges_2.23.9
 [9] S4Vectors_0.27.12
[10] BiocGenerics_0.35.2
[11] annotatr_1.15.0

loaded via a namespace (and not attached):
 [1] httr_1.4.1                    regioneR_1.21.0
 [3] bit64_0.9-7                   AnnotationHub_2.21.0
 [5] shiny_1.4.0.2                 assertthat_0.2.1
 [7] interactiveDisplayBase_1.27.0 askpass_1.1
 [9] BiocManager_1.30.10           BiocFileCache_1.13.0
[11] blob_1.2.1                    BSgenome_1.57.0
[13] GenomeInfoDbData_1.2.3        Rsamtools_2.5.0
[15] yaml_2.2.1                    progress_1.2.2
[17] BiocVersion_3.12.0            pillar_1.4.4
[19] RSQLite_2.2.0                 lattice_0.20-41
[21] glue_1.4.1                    digest_0.6.25
[23] promises_1.1.0                XVector_0.29.2
[25] colorspace_1.4-1              plyr_1.8.6
[27] htmltools_0.4.0               httpuv_1.5.2
[29] Matrix_1.2-18                 XML_3.99-0.3
[31] pkgconfig_2.0.3               biomaRt_2.45.0
[33] zlibbioc_1.35.0               purrr_0.3.4
[35] xtable_1.8-4                  scales_1.1.1
[37] later_1.0.0                   BiocParallel_1.23.0
[39] tibble_3.0.1                  openssl_1.4.1
[41] ggplot2_3.3.0                 ellipsis_0.3.1
[43] SummarizedExperiment_1.19.5   magrittr_1.5
[45] crayon_1.3.4                  mime_0.9
[47] memoise_1.1.0                 tools_4.0.0
[49] prettyunits_1.1.1             hms_0.5.3
[51] lifecycle_0.2.0               matrixStats_0.56.0
[53] stringr_1.4.0                 munsell_0.5.0
[55] DelayedArray_0.15.1           Biostrings_2.57.2
[57] compiler_4.0.0                rlang_0.4.6
[59] grid_4.0.0                    RCurl_1.98-1.2
[61] rappdirs_0.3.1                bitops_1.0-6
[63] gtable_0.3.0                  DBI_1.1.0
[65] curl_4.3                      reshape2_1.4.4
[67] R6_2.4.1                      GenomicAlignments_1.25.0
[69] dplyr_0.8.5                   rtracklayer_1.49.1
[71] fastmap_1.0.1                 bit_1.1-15.2
[73] readr_1.3.1                   stringi_1.4.6
[75] Rcpp_1.0.4.6                  vctrs_0.3.0
[77] dbplyr_1.4.3                  tidyselect_1.1.0

Bioconductor version '3.12'

  * 66 packages out-of-date
  * 0 packages too new

create a valid installation with

  BiocManager::install(c(
    "AnnotationDbi", "AnnotationHub", "annotatr", "backports", "BiocGenerics",
    "BiocParallel", "biomaRt", "bit64", "broom", "BSgenome", "bsseq", "dbplyr",
    "DelayedArray", "DelayedMatrixStats", "dplyr", "DT", "fs", "GenomeInfoDb",
    "GenomicAlignments", "GenomicFeatures", "ggforce", "ggplot2", "ggraph",
    "Gviz", "haven", "HDF5Array", "htmlTable", "htmltools", "httpuv",
    "interactiveDisplayBase", "IRanges", "isoband", "jsonlite", "knitr",
    "later", "limma", "lubridate", "openssl", "org.Mm.eg.db", "pillar",
    "pkgbuild", "pkgload", "processx", "promises", "Rcpp", "RcppArmadillo",
    "regioneR", "rhdf5", "Rhdf5lib", "Rhtslib", "rlang", "rmarkdown",
    "roxygen2", "Rsamtools", "rtracklayer", "rversions", "shiny",
    "SummarizedExperiment", "tibble", "tidyr", "tinytex", "VariantAnnotation",
    "vctrs", "xfun", "XML", "XVector"
  ), update = TRUE, ask = FALSE)

more details: BiocManager::valid()$too_new, BiocManager::valid()$out_of_date

Warning message:
66 packages out-of-date; 0 packages too new
rcavalcante commented 4 years ago

Thanks for that, so it seems like you're consistently using devel, which rules out the mixture issue.

It's a little strange to me that the devel builds are fine on Bioconductor, but it doesn't work for you. It would be helpful to know which package is causing the which problem... let me update my devel Docker image and see if the problem is replicated there.

rcavalcante commented 4 years ago

I just updated all the packages in my devel Docker image rcavalcante/rdevel_bioc3.12, and couldn't replicate the problem either. Hmm.

> BiocManager::valid()
[1] TRUE
> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS

Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so

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

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

other attached packages:
 [1] org.Mm.eg.db_3.11.4                      
 [2] TxDb.Mmusculus.UCSC.mm10.knownGene_3.10.0
 [3] GenomicFeatures_1.41.2                   
 [4] AnnotationDbi_1.51.1                     
 [5] Biobase_2.49.0                           
 [6] GenomicRanges_1.41.5                     
 [7] GenomeInfoDb_1.25.8                      
 [8] IRanges_2.23.10                          
 [9] S4Vectors_0.27.12                        
[10] BiocGenerics_0.35.4                      
[11] annotatr_1.15.2                          
[12] BiocManager_1.30.10                      

loaded via a namespace (and not attached):
 [1] httr_1.4.1                    regioneR_1.21.1              
 [3] bit64_0.9-7.1                 AnnotationHub_2.21.1         
 [5] shiny_1.5.0                   assertthat_0.2.1             
 [7] interactiveDisplayBase_1.27.5 askpass_1.1                  
 [9] BiocFileCache_1.13.0          blob_1.2.1                   
[11] BSgenome_1.57.4               GenomeInfoDbData_1.2.3       
[13] Rsamtools_2.5.3               yaml_2.2.1                   
[15] progress_1.2.2                BiocVersion_3.12.0           
[17] pillar_1.4.6                  RSQLite_2.2.0                
[19] lattice_0.20-41               glue_1.4.1                   
[21] digest_0.6.25                 promises_1.1.1               
[23] XVector_0.29.3                colorspace_1.4-1             
[25] plyr_1.8.6                    htmltools_0.5.0              
[27] httpuv_1.5.4                  Matrix_1.2-18                
[29] XML_3.99-0.4                  pkgconfig_2.0.3              
[31] biomaRt_2.45.2                zlibbioc_1.35.0              
[33] purrr_0.3.4                   xtable_1.8-4                 
[35] scales_1.1.1                  later_1.1.0.1                
[37] BiocParallel_1.23.2           tibble_3.0.3                 
[39] openssl_1.4.2                 generics_0.0.2               
[41] ggplot2_3.3.2                 ellipsis_0.3.1               
[43] SummarizedExperiment_1.19.6   magrittr_1.5                 
[45] crayon_1.3.4                  mime_0.9                     
[47] memoise_1.1.0                 tools_4.0.0                  
[49] prettyunits_1.1.1             hms_0.5.3                    
[51] lifecycle_0.2.0               matrixStats_0.56.0           
[53] stringr_1.4.0                 munsell_0.5.0                
[55] DelayedArray_0.15.7           Biostrings_2.57.2            
[57] compiler_4.0.0                rlang_0.4.7                  
[59] grid_4.0.0                    RCurl_1.98-1.2               
[61] rappdirs_0.3.1                bitops_1.0-6                 
[63] gtable_0.3.0                  DBI_1.1.0                    
[65] curl_4.3                      reshape2_1.4.4               
[67] R6_2.4.1                      GenomicAlignments_1.25.3     
[69] dplyr_1.0.0                   rtracklayer_1.49.3           
[71] fastmap_1.0.1                 bit_1.1-15.2                 
[73] readr_1.3.1                   stringi_1.4.6                
[75] Rcpp_1.0.5                    vctrs_0.3.2                  
[77] dbplyr_1.4.4                  tidyselect_1.1.0

I wonder, could you try updating your packages and see if the problem persists?

wkc1986 commented 4 years ago

After updating R to 4.0.2 and all packages except vctrs (staying on latest binary version) it works. Not sure where the problem was but it seems to be gone. Thank you.