Unexpected error with topGO, cannot build topGOdata object
1
0
Entering edit mode
abf ▴ 30
@abf-14661
Last seen 2.3 years ago
United States

When I try and create the topGOdata object, I get an error warning about a zero-length vector. I've recently moved to a Mac (see session info). Previously I had no issues using topGO on a linux box, under R-3.6.3 (with an up to date bioconductor). I was hoping someone might have gotten a similar error and could help me troubleshoot? I'm not certain where to start looking.

Quick Start Example from the vignette:

>  library(topGO)
>  library(ALL)
>  data(ALL)
>  data(geneList)
> 
>  affyLib <- paste(annotation(ALL), "db", sep = ".")
>  library(package = affyLib, character.only = TRUE)
>  
>  sampleGOdata <- new("topGOdata",
+                      description = "Simple session", ontology = "BP",
+                      allGenes = geneList, geneSel = topDiffGenes, nodeSize = 10,
+                      annot = annFUN.db, affyLib = affyLib)

Building most specific GOs .....
    ( 1647 GO terms found. )

Build GO DAG topology ..........
Error in if (node == GENE.ONTO.ROOT) return(2) : 
  argument is of length zero

There is also a warning message:

> warnings()
Warning message:
In result_fetch(res@ptr, n = n) :
  SQL statements must be issued with dbExecute() or dbSendStatement() instead of dbGetQuery() or dbSendQuery().

Session Info:

> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.4

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.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
[6] utils     datasets  methods   base     

other attached packages:
 [1] hgu95av2.db_3.2.3    org.Hs.eg.db_3.11.0 
 [3] ALL_1.29.0           org.Mm.eg.db_3.11.0 
 [5] topGO_2.40.0         SparseM_1.78        
 [7] GO.db_3.11.0         AnnotationDbi_1.50.0
 [9] IRanges_2.22.1       S4Vectors_0.26.0    
[11] Biobase_2.48.0       graph_1.66.0        
[13] BiocGenerics_0.34.0 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6       bit_1.1-15.2       lattice_0.20-41   
 [4] rlang_0.4.6        blob_1.2.1         tools_4.0.0       
 [7] grid_4.0.0         DBI_1.1.0          matrixStats_0.56.0
[10] bit64_0.9-7        digest_0.6.25      vctrs_0.2.4       
[13] memoise_1.1.0      RSQLite_2.2.0      compiler_4.0.0    
[16] pkgconfig_2.0.3
topGO • 1.3k views
ADD COMMENT
0
Entering edit mode

I think that the issue may be with the new GO.db package, as elaborated here:

ADD REPLY
1
Entering edit mode

There may be an issue with that, but I just ran the code using R-4.0.0 and Bioc11 and it works for me on Windows. So I sort of doubt the issue is any problems with GO.db (although there may be other silent issues).

ADD REPLY
0
Entering edit mode

e.g.

> sampleGOdata <- new("topGOdata",
+                       description = "Simple session", ontology = "BP",
+                       allGenes = geneList, geneSel = topDiffGenes, nodeSize = 10,
+                       annot = annFUN.db, affyLib = affyLib)

Building most specific GOs .....
    ( 1647 GO terms found. )

Build GO DAG topology ..........
    ( 4545 GO terms and 10466 relations. )

Annotating nodes ...............
    ( 310 genes annotated to the GO terms. )
Warning message:
In result_fetch(res@ptr, n = n) :
  SQL statements must be issued with dbExecute() or dbSendStatement() instead of dbGetQuery() or dbSendQuery().
> sampleGOdata

------------------------- topGOdata object -------------------------

 Description:
   -  Simple session 

 Ontology:
   -  BP 

 323 available genes (all genes from the array):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 50  significant genes. 

 310 feasible genes (genes that can be used in the analysis):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 46  significant genes. 

 GO graph (nodes with at least  10  genes):
   - a graph with directed edges
   - number of nodes = 1110 
   - number of edges = 2400 

------------------------- topGOdata object -------------------------

> sessionInfo()
R version 4.0.0 RC (2020-04-20 r78265)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

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

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

other attached packages:
 [1] hgu95av2.db_3.2.3    org.Hs.eg.db_3.10.0  ALL_1.29.0          
 [4] topGO_2.39.1         SparseM_1.78         GO.db_3.10.0        
 [7] AnnotationDbi_1.49.1 IRanges_2.21.8       S4Vectors_0.25.15   
[10] Biobase_2.47.3       graph_1.65.3         BiocGenerics_0.33.3 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6       bit_1.1-15.2       lattice_0.20-41    rlang_0.4.5       
 [5] blob_1.2.1         tools_4.0.0        grid_4.0.0         DBI_1.1.0         
 [9] matrixStats_0.56.0 bit64_0.9-7        digest_0.6.25      vctrs_0.2.4       
[13] memoise_1.1.0      RSQLite_2.2.0      compiler_4.0.0     pkgconfig_2.0.3   
ADD REPLY
0
Entering edit mode

Urp. Maybe it is a problem with the current GO.db package. The topGO package makes use of the old BiMap interface, and does this under the hood:

GOParents <- get(paste("GO", whichOnto, "PARENTS", sep = ""))
GENE.ONTO.ROOT <- as.character(revmap(GOParents)$all)

Which is the equivalent of

as.character(revmap(GOBPPARENTS)$all)

Which in previous versions gave

> as.character(revmap(GOBPPARENTS)$all)
[1] "GO:0008150"

## but now with the current version of GO.db it does

> as.character(revmap(GOBPPARENTS)$all)
character(0)

And this looks different as well

## old GO.db
> head(toTable(GOBPPARENTS))
       go_id      go_id RelationshipType
1 GO:0000001 GO:0048308             is_a
2 GO:0000001 GO:0048311             is_a
3 GO:0000002 GO:0007005             is_a
4 GO:0000003 GO:0008150             is_a
5 GO:0042254 GO:0022613             is_a
6 GO:0000011 GO:0007033             is_a

# New GO.db
> head(toTable(GOBPPARENTS))
       go_id      go_id RelationshipType
1 GO:0000002 GO:0032042          part of
2 GO:0000002 GO:0033955             is_a
3 GO:0000003 GO:0019953             is_a
4 GO:0000003 GO:0019954             is_a
5 GO:0000003 GO:0022414          part of
6 GO:0000003 GO:0032504             is_a

So let's wait for Kayla to update GO.db and that should make all this work again.

ADD REPLY
0
Entering edit mode

Perhaps you can now re-try: https://support.bioconductor.org/p/130753/

ADD REPLY
1
Entering edit mode

Et voila

> library(topGO)
>  library(ALL)
>   data(ALL)
>   data(geneList)
>  
>   affyLib <- paste(annotation(ALL), "db", sep = ".")
>   library(package = affyLib, character.only = TRUE)
Loading required package: org.Hs.eg.db


>   
>   sampleGOdata <- new("topGOdata",
+                       description = "Simple session", ontology = "BP",
+                       allGenes = geneList, geneSel = topDiffGenes, nodeSize = 10,
+                       annot = annFUN.db, affyLib = affyLib)

Building most specific GOs .....
    ( 1647 GO terms found. )

Build GO DAG topology ..........
    ( 4545 GO terms and 10466 relations. )

Annotating nodes ...............
    ( 310 genes annotated to the GO terms. )
Warning message:
In result_fetch(res@ptr, n = n) :
  SQL statements must be issued with dbExecute() or dbSendStatement() instead of dbGetQuery() or dbSendQuery().
> sampleGOdata

------------------------- topGOdata object -------------------------

 Description:
   -  Simple session 

 Ontology:
   -  BP 

 323 available genes (all genes from the array):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 50  significant genes. 

 310 feasible genes (genes that can be used in the analysis):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 46  significant genes. 

 GO graph (nodes with at least  10  genes):
   - a graph with directed edges
   - number of nodes = 1110 
   - number of edges = 2400 

------------------------- topGOdata object -------------------------

> sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

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

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

other attached packages:
 [1] hgu95av2.db_3.2.3    org.Hs.eg.db_3.11.1  ALL_1.30.0          
 [4] topGO_2.40.0         SparseM_1.78         graph_1.66.0        
 [7] GO.db_3.11.1         AnnotationDbi_1.50.0 IRanges_2.22.1      
[10] S4Vectors_0.26.0     Biobase_2.48.0       BiocGenerics_0.34.0 
[13] BiocManager_1.30.10 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6       bit_1.1-15.2       lattice_0.20-41    rlang_0.4.6       
 [5] blob_1.2.1         tools_4.0.0        grid_4.0.0         DBI_1.1.0         
 [9] matrixStats_0.56.0 bit64_0.9-7        digest_0.6.25      vctrs_0.2.4       
[13] memoise_1.1.0      RSQLite_2.2.0      compiler_4.0.0     pkgconfig_2.0.3   
ADD REPLY
3
Entering edit mode
abf ▴ 30
@abf-14661
Last seen 2.3 years ago
United States

I updated GO.db using

BiocManager::install('GO.db')

topGO is now working properly for me. Thanks to Kayla for her update and Kevin and James for identifying the cause.

ADD COMMENT

Login before adding your answer.

Traffic: 546 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