Missing as.list generic from AnnotationDbi?
2
0
Entering edit mode
@ryan-c-thompson-5618
Last seen 7 months ago
Scripps Research, La Jolla, CA
According to here: https://stat.ethz.ch/pipermail/bioc-devel/2009-December/002061.html the AnnotationDbi pacakge promotes as.list to an S4 generic that knows about Bimap objects and such. However, after loading AnnotationDbi in my R, I get: > showMethods("as.list") Function "as.list": <not an="" s4="" generic="" function=""> Furthermore, when loading the annotate package, I get: > library(annotate) Warning message: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc, : No generic function found corresponding to requested imported methods for "as.list" from package "AnnotationDbi" (malformed exports?) And now all the functions from annotate, such as getSYMBOL, lookUp, etc., fail with an error, exemplified by the following snippet from the help text of lookUp: > library("hgu95av2.db") > library("GO.db") > > data(sample.ExpressionSet) > gN <- featureNames(sample.ExpressionSet)[100:105] > lookUp(gN, "hgu95av2", "SYMBOL") Error in as.list.default(envir) : no method for coercing this S4 class to a vector Can anyone help me find my missing S4 as.list generic? -Ryan Thompson > sessionInfo() R version 3.0.1 (2013-05-16) Platform: x86_64-unknown-linux-gnu (64-bit) 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=en_US.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] parallel stats graphics grDevices utils datasets methods [8] base other attached packages: [1] annotate_1.39.0 AnnotationDbi_1.23.15 Biobase_2.21.4 [4] BiocGenerics_0.7.2 loaded via a namespace (and not attached): [1] colorspace_1.2-2 DBI_0.2-7 IRanges_1.19.12 RSQLite_0.11.4 [5] stats4_3.0.1 XML_3.96-1.1 xtable_1.7-1 > biocVersion() [1] ?2.13?
annotate AnnotationDbi annotate AnnotationDbi • 2.2k views
ADD COMMENT
0
Entering edit mode
@ryan-c-thompson-5618
Last seen 7 months ago
Scripps Research, La Jolla, CA
Never mind, reinstalling the AnnotationDbi package seems to have solved the problem. No idea what was wrong. On Mon 17 Jun 2013 03:23:54 PM PDT, Ryan C. Thompson wrote: > According to here: > https://stat.ethz.ch/pipermail/bioc-devel/2009-December/002061.html > > the AnnotationDbi pacakge promotes as.list to an S4 generic that knows > about Bimap objects and such. However, after loading AnnotationDbi in > my R, I get: > > > showMethods("as.list") > > Function "as.list": > <not an="" s4="" generic="" function=""> > > Furthermore, when loading the annotate package, I get: > > > library(annotate) > Warning message: > In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc, : > No generic function found corresponding to requested imported methods > for "as.list" from package "AnnotationDbi" (malformed exports?) > > And now all the functions from annotate, such as getSYMBOL, lookUp, > etc., fail with an error, exemplified by the following snippet from > the help text of lookUp: > > > library("hgu95av2.db") > > library("GO.db") > > > > data(sample.ExpressionSet) > > gN <- featureNames(sample.ExpressionSet)[100:105] > > lookUp(gN, "hgu95av2", "SYMBOL") > Error in as.list.default(envir) : > no method for coercing this S4 class to a vector > > Can anyone help me find my missing S4 as.list generic? > > -Ryan Thompson > > > sessionInfo() > R version 3.0.1 (2013-05-16) > Platform: x86_64-unknown-linux-gnu (64-bit) > > 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=en_US.UTF-8 > [7] LC_PAPER=C LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] parallel stats graphics grDevices utils datasets methods > [8] base > > other attached packages: > [1] annotate_1.39.0 AnnotationDbi_1.23.15 Biobase_2.21.4 > [4] BiocGenerics_0.7.2 > > loaded via a namespace (and not attached): > [1] colorspace_1.2-2 DBI_0.2-7 IRanges_1.19.12 RSQLite_0.11.4 > [5] stats4_3.0.1 XML_3.96-1.1 xtable_1.7-1 > > biocVersion() > [1] ?2.13? >
ADD COMMENT
0
Entering edit mode
Jenny Drnevich ★ 2.0k
@jenny-drnevich-2812
Last seen 4 months ago
United States

I just had the same issue with R 3.1.1 when I upgraded a whole bunch of packages. When I load affycoretools, I get the following warnings:

Warning messages:
1: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc,  :
  No generic function found corresponding to requested imported methods for "summary" from package "AnnotationDbi" (malformed exports?)
2: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc,  :
  No generic function found corresponding to requested imported methods for "summary" from package "Category" (malformed exports?)
3: found methods to import for function ‘summary’ but not the generic itself 
4: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc,  :
  No generic function found corresponding to requested imported methods for "summary" from package "GOstats" (malformed exports?)
5: found methods to import for function ‘summary’ but not the generic itself

I don't get these warnings when I load AnnotationDbi, Category and GOstats on their own. I've tried deleting and re-installing affycoretools and the other packages and I'm still getting the warnings. Interestingly, neither affycoretools (v 1.36.1), AnnotationDbi (v 1.26.0), Category (v  2.30.0) nor GOstats (v 2.30.0) were upgraded! I didn't record what packages were upgraded, but there were over a dozen. I've got the output of sessionInfo() for my current problem plus one from before the upgrade. It looks like acepack_1.3-3.3, foreign_0.8-61, nnet_7.3-8, rpart_4.1-8  are now being loaded via a namespace when they weren't before and several other packages were upgraded (biovizBase, caTools, checkmate, cluster, codetools, formatR, GenomicAlignments, ggbio, gplots, Hmisc, hwriter, KernSmooth, limma, MASS, R.utils, R2HTML, RBGL, RcppArmadillo, reshape, and xtable).

Any idea what could be the problem? I guess I could try to completely re-install R, but I don't have time today...

Thanks,

Jenny

Newest R:

R version 3.1.1 (2014-07-10) -- "Sock it to Me"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 2.14 (BiocInstaller 1.14.2), ?biocLite for help
> biocLite("affycoretools")
BioC_mirror: http://bioconductor.org
Using Bioconductor version 2.14 (BiocInstaller 1.14.2), R version
  3.1.1.
Installing package(s) 'affycoretools'
trying URL 'http://bioconductor.org/packages/2.14/bioc/bin/windows/contrib/3.1/affycoretools_1.36.1.zip'
Content type 'application/zip' length 1052018 bytes (1.0 Mb)
opened URL
downloaded 1.0 Mb

package ‘affycoretools’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\drnevich\AppData\Local\Temp\Rtmp2JRam4\downloaded_packages
> library(affycoretools)
Loading required package: affy
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

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")'.

Loading required package: GO.db
Loading required package: AnnotationDbi
Loading required package: GenomeInfoDb
Loading required package: DBI


Warning messages:
1: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc,  :
  No generic function found corresponding to requested imported methods for "summary" from package "AnnotationDbi" (malformed exports?)
2: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc,  :
  No generic function found corresponding to requested imported methods for "summary" from package "Category" (malformed exports?)
3: found methods to import for function ‘summary’ but not the generic itself 
4: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc,  :
  No generic function found corresponding to requested imported methods for "summary" from package "GOstats" (malformed exports?)
5: found methods to import for function ‘summary’ but not the generic itself 
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
 [1] affycoretools_1.36.1 GO.db_2.14.0         RSQLite_0.11.4       DBI_0.3.0            AnnotationDbi_1.26.0 GenomeInfoDb_1.0.2  
 [7] affy_1.42.3          Biobase_2.24.0       BiocGenerics_0.10.0  BiocInstaller_1.14.2

loaded via a namespace (and not attached):
 [1] acepack_1.3-3.3          affyio_1.32.0            annaffy_1.36.0           annotate_1.42.1          AnnotationForge_1.6.1   
 [6] BatchJobs_1.3            BBmisc_1.7               BiocParallel_0.6.1       biomaRt_2.20.0           Biostrings_2.32.1       
[11] biovizBase_1.12.3        bit_1.1-12               bitops_1.0-6             brew_1.0-6               BSgenome_1.32.0         
[16] Category_2.30.0          caTools_1.17.1           checkmate_1.4            cluster_1.15.3           codetools_0.2-9         
[21] colorspace_1.2-4         DESeq2_1.4.5             dichromat_2.0-0          digest_0.6.4             edgeR_3.6.8             
[26] evaluate_0.5.5           fail_1.2                 ff_2.2-13                foreach_1.4.2            foreign_0.8-61          
[31] formatR_1.0              Formula_1.1-2            gcrma_2.36.0             gdata_2.13.3             genefilter_1.46.1       
[36] geneplotter_1.42.0       GenomicAlignments_1.0.6  GenomicFeatures_1.16.2   GenomicRanges_1.16.4     ggbio_1.12.10           
[41] ggplot2_1.0.0            GOstats_2.30.0           gplots_2.14.2            graph_1.42.0             grid_3.1.1              
[46] gridExtra_0.9.1          GSEABase_1.26.0          gtable_0.1.2             gtools_3.4.1             Hmisc_3.14-5            
[51] hwriter_1.3.2            IRanges_1.22.10          iterators_1.0.7          KernSmooth_2.23-13       knitr_1.6               
[56] lattice_0.20-29          latticeExtra_0.6-26      limma_3.20.9             locfit_1.5-9.1           MASS_7.3-34             
[61] Matrix_1.1-4             munsell_0.4.2            nnet_7.3-8               oligoClasses_1.26.0      PFAM.db_2.14.0          
[66] plyr_1.8.1               preprocessCore_1.26.1    proto_0.3-10             R.methodsS3_1.6.1        R.oo_1.18.0             
[71] R.utils_1.33.0           R2HTML_2.3.0             RBGL_1.40.1              RColorBrewer_1.0-5       Rcpp_0.11.2             
[76] RcppArmadillo_0.4.400.0  RCurl_1.95-4.3           ReportingTools_2.4.0     reshape2_1.4             rpart_4.1-8             
[81] Rsamtools_1.16.1         rtracklayer_1.24.2       scales_0.2.4             sendmailR_1.1-2          splines_3.1.1           
[86] stats4_3.1.1             stringr_0.6.2            survival_2.37-7          tools_3.1.1              VariantAnnotation_1.10.5
[91] XML_3.98-1.1             xtable_1.7-4             XVector_0.4.0            zlibbioc_1.10.0 

 

Before upgrade:

sessionInfo() #as of sept 8, 2014
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
 [1] Heatplus_2.10.0       rtracklayer_1.24.2    GenomicRanges_1.16.4  IRanges_1.22.10       edgeR_3.6.8          
 [6] limma_3.20.8          affyPLM_1.40.1        preprocessCore_1.26.1 gcrma_2.36.0          affycoretools_1.36.1 
[11] GO.db_2.14.0          RSQLite_0.11.4        DBI_0.2-7             AnnotationDbi_1.26.0  GenomeInfoDb_1.0.2   
[16] affy_1.42.3           Biobase_2.24.0        BiocGenerics_0.10.0   MASS_7.3-33           RWinEdt_2.0-2        
[21] WGCNA_1.41-1          flashClust_1.01-2     dynamicTreeCut_1.62   BiocInstaller_1.14.2 

loaded via a namespace (and not attached):
 [1] affyio_1.32.0            annaffy_1.36.0           annotate_1.42.1          AnnotationForge_1.6.1    BatchJobs_1.3           
 [6] BBmisc_1.7               BiocParallel_0.6.1       biomaRt_2.20.0           Biostrings_2.32.1        biovizBase_1.12.1       
[11] bit_1.1-12               bitops_1.0-6             brew_1.0-6               BSgenome_1.32.0          Category_2.30.0         
[16] caTools_1.17             checkmate_1.3            cluster_1.15.2           codetools_0.2-8          colorspace_1.2-4        
[21] DESeq2_1.4.5             dichromat_2.0-0          digest_0.6.4             doParallel_1.0.8         evaluate_0.5.5          
[26] fail_1.2                 ff_2.2-13                foreach_1.4.2            formatR_0.10             Formula_1.1-2           
[31] gdata_2.13.3             genefilter_1.46.1        geneplotter_1.42.0       GenomicAlignments_1.0.5  GenomicFeatures_1.16.2  
[36] ggbio_1.12.8             ggplot2_1.0.0            GOstats_2.30.0           gplots_2.14.1            graph_1.42.0            
[41] grid_3.1.1               gridExtra_0.9.1          GSEABase_1.26.0          gtable_0.1.2             gtools_3.4.1            
[46] Hmisc_3.14-4             hwriter_1.3              impute_1.38.1            iterators_1.0.7          KernSmooth_2.23-12      
[51] knitr_1.6                lattice_0.20-29          latticeExtra_0.6-26      locfit_1.5-9.1           Matrix_1.1-4            
[56] matrixStats_0.10.0       munsell_0.4.2            oligoClasses_1.26.0      PFAM.db_2.14.0           plyr_1.8.1              
[61] proto_0.3-10             R.methodsS3_1.6.1        R.oo_1.18.0              R.utils_1.32.4           R2HTML_2.2.1            
[66] RBGL_1.40.0              RColorBrewer_1.0-5       Rcpp_0.11.2              RcppArmadillo_0.4.320.0  RCurl_1.95-4.3          
[71] ReportingTools_2.4.0     reshape_0.8.5            reshape2_1.4             Rsamtools_1.16.1         scales_0.2.4            
[76] sendmailR_1.1-2          splines_3.1.1            stats4_3.1.1             stringr_0.6.2            survival_2.37-7         
[81] tools_3.1.1              VariantAnnotation_1.10.5 XML_3.98-1.1             xtable_1.7-3             XVector_0.4.0           
[86] zlibbioc_1.10.0 

 

ADD COMMENT
0
Entering edit mode

Does BiocInstaller::biocValid() provide any hint of out-of-date or too-recent packages?

ADD REPLY
0
Entering edit mode

HI Martin,

2 annotation packages for Affy arrays are out of date, but I doubt that's what's causing the problem. I'm going to be sitting in a workshop this afternoon and I can try doing a fresh install of R then.

> BiocInstaller::biocValid()

* sessionInfo()

R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
 [1] GOstats_2.30.0                  graph_1.42.0                    Category_2.30.0                
 [4] Matrix_1.1-4                    KEGG.db_2.14.0                  genefilter_1.46.1              
 [7] RnAgilentDesign028282.db_2.14.0 org.Rn.eg.db_2.14.0             org.Hs.eg.db_2.14.0            
[10] limma_3.20.9                    affyPLM_1.40.1                  preprocessCore_1.26.1          
[13] gcrma_2.36.0                    affycoretools_1.36.1            GO.db_2.14.0                   
[16] RSQLite_0.11.4                  DBI_0.3.0                       AnnotationDbi_1.26.0           
[19] GenomeInfoDb_1.0.2              affy_1.42.3                     Biobase_2.24.0                 
[22] BiocGenerics_0.10.0             MASS_7.3-34                     RWinEdt_2.0-2                  
[25] WGCNA_1.41-1                    flashClust_1.01-2               dynamicTreeCut_1.62            
[28] BiocInstaller_1.14.2           

loaded via a namespace (and not attached):
 [1] acepack_1.3-3.3          affyio_1.32.0            annaffy_1.36.0           annotate_1.42.1          AnnotationForge_1.6.1   
 [6] BatchJobs_1.3            BBmisc_1.7               BiocParallel_0.6.1       biomaRt_2.20.0           Biostrings_2.32.1       
[11] biovizBase_1.12.3        bit_1.1-12               bitops_1.0-6             brew_1.0-6               BSgenome_1.32.0         
[16] caTools_1.17.1           checkmate_1.4            cluster_1.15.3           codetools_0.2-9          colorspace_1.2-4        
[21] DESeq2_1.4.5             dichromat_2.0-0          digest_0.6.4             doParallel_1.0.8         edgeR_3.6.8             
[26] evaluate_0.5.5           fail_1.2                 ff_2.2-13                foreach_1.4.2            foreign_0.8-61          
[31] formatR_1.0              Formula_1.1-2            gdata_2.13.3             geneplotter_1.42.0       GenomicAlignments_1.0.6 
[36] GenomicFeatures_1.16.2   GenomicRanges_1.16.4     ggbio_1.12.10            ggplot2_1.0.0            gplots_2.14.2           
[41] grid_3.1.1               gridExtra_0.9.1          GSEABase_1.26.0          gtable_0.1.2             gtools_3.4.1            
[46] Hmisc_3.14-5             hwriter_1.3.2            impute_1.38.1            IRanges_1.22.10          iterators_1.0.7         
[51] KernSmooth_2.23-13       knitr_1.6                lattice_0.20-29          latticeExtra_0.6-26      locfit_1.5-9.1          
[56] matrixStats_0.10.0       munsell_0.4.2            nnet_7.3-8               oligoClasses_1.26.0      PFAM.db_2.14.0          
[61] plyr_1.8.1               proto_0.3-10             R.methodsS3_1.6.1        R.oo_1.18.0              R.utils_1.33.0          
[66] R2HTML_2.3.0             RBGL_1.40.1              RColorBrewer_1.0-5       Rcpp_0.11.2              RcppArmadillo_0.4.400.0 
[71] RCurl_1.95-4.3           ReportingTools_2.4.0     reshape_0.8.5            reshape2_1.4             rpart_4.1-8             
[76] Rsamtools_1.16.1         rtracklayer_1.24.2       scales_0.2.4             sendmailR_1.1-2          splines_3.1.1           
[81] stats4_3.1.1             stringr_0.6.2            survival_2.37-7          tools_3.1.1              VariantAnnotation_1.10.5
[86] XML_3.98-1.1             xtable_1.7-4             XVector_0.4.0            zlibbioc_1.10.0         

* Out-of-date packages
                    Package               LibPath                              Installed Built   ReposVer
pd.hugene.1.0.st.v1 "pd.hugene.1.0.st.v1" "C:/Program Files/R/R-3.1.1/library" "3.8.0"   "3.0.0" "3.8.0" 
pd.mogene.1.0.st.v1 "pd.mogene.1.0.st.v1" "C:/Program Files/R/R-3.1.1/library" "3.8.0"   "3.0.0" "3.8.0" 
                    Repository                                                                     
pd.hugene.1.0.st.v1 "http://bioconductor.org/packages/2.14/data/annotation/bin/windows/contrib/3.1"
pd.mogene.1.0.st.v1 "http://bioconductor.org/packages/2.14/data/annotation/bin/windows/contrib/3.1"

update with biocLite()

Error: 2 package(s) out of date

 

ADD REPLY
0
Entering edit mode

Rather than a fresh install I'd try starting your R with only the 'base' packages, and then library(affycoretools) -- my current guess is that functions in one of the other packages are masking those in the package you want to use. Ultimately this can be fixed in the packages concerned, but with 20-odd packages loaded and 86 attached things are too complicated to debug.

ADD REPLY
0
Entering edit mode

Yes, I've run into that before. However, I did end up doing the complete re-install and that solved the problem. Not sure what happened where, but at least it's fixed. Thanks for your help!

ADD REPLY

Login before adding your answer.

Traffic: 612 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6