topGo GenTable returns result column as character
1
0
Entering edit mode
@darioberaldi-6991
Last seen 22 months ago
United Kingdom

I don't know if this is the right place to report this...

Unless I'm missing something, GenTable from the topGO package has a serious bug in that the column reporting the results of the test is of type character instead of numeric. Example:

library(topGO)

data(GOdata)
data(results.tGO)
sig.tab <- GenTable(GOdata, Fis = resultFisher, topNodes = 20)

str(sig.tab)
'data.frame':   20 obs. of  6 variables:
 $ GO.ID      : chr  "GO:0006091" "GO:0022900" "GO:0009267" "GO:0042594" ...
 $ Term       : chr  "generation of precursor metabolites and ..." "electron transport chain" "cellular response to starvation" "response to starvation" ...
 $ Annotated  : int  8 8 6 6 30 30 9 9 7 7 ...
 $ Significant: int  6 6 5 5 12 12 6 6 5 5 ...
 $ Expected   : num  1.26 1.26 0.94 0.94 4.72 4.72 1.42 1.42 1.1 1.1 ...
 $ Fis        : chr  "0.00025" "0.00025" "0.00043" "0.00043" ...
                ^^^

This means that results like '2.9e-06' would be filtered out by something like Fis < 0.01

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /export/projects/III-data/wcmp_bioinformatics/db291g/miniconda3/envs/20210301_nelson_act_mutants/lib/libopenblasp-r0.3.10.so

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] topGO_2.42.0         SparseM_1.81         GO.db_3.12.1         AnnotationDbi_1.52.0 IRanges_2.24.0       S4Vectors_0.28.0     Biobase_2.50.0       graph_1.68.0         BiocGenerics_0.36.0 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6         matrixStats_0.58.0 lattice_0.20-41    grid_4.0.3         DBI_1.1.1          RSQLite_2.2.3      cachem_1.0.4       rlang_0.4.10       blob_1.2.1         vctrs_0.3.6        tools_4.0.3        bit64_4.0.5        bit_4.0.4          fastmap_1.1.0     
[15] compiler_4.0.3     pkgconfig_2.0.3    memoise_2.0.0
GenTable topGO • 966 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 12 minutes ago
United States

Nope, you aren't missing anything. The GenTable function calls format.FUN which calls format to make the values 'pretty'. And format returns character results.

> format(1:5)
[1] "1" "2" "3" "4" "5"

As to whether or not this constitutes a bug, I imagine that is up to Adrian Alexa? I mean, a bug is when a function returns something that the programmer didn't intend. Perhaps the intention was that the p-values should get run through format in order to make the resulting table pretty, and there was never any intent that the table should be easily subsetted on the p-value. I actually have no idea, and so far as I can tell Adrian doesn't really actively maintain topGO any longer?

$ git log -n 200 | grep Alexa --after-context=2
Author: Adrian Alexa <adrian.alexa@gmail.com>
Date:   Tue Dec 10 01:36:39 2019 +0000

--
Author: Adrian Alexa <adrian.alexa@gmail.com>
Date:   Wed Feb 28 02:08:18 2018 +0000

--
Author: Adrian Alexa <adrian.alexa@gmail.com>
Date:   Wed Feb 28 02:06:18 2018 +0000

--
Author: Adrian Alexa <alexa@mpi-inf.mpg.de>
Date:   Thu Apr 10 15:41:48 2014 +0000

--
Author: Adrian Alexa <alexa@mpi-inf.mpg.de>
Date:   Mon Oct 10 00:07:19 2011 +0000

--
Author: Adrian Alexa <alexa@mpi-inf.mpg.de>
Date:   Mon Oct 10 00:04:58 2011 +0000

--
Author: Adrian Alexa <alexa@mpi-inf.mpg.de>
Date:   Thu Oct 14 17:33:29 2010 +0000

--
Author: Adrian Alexa <alexa@mpi-inf.mpg.de>
Date:   Fri Jun 4 14:28:07 2010 +0000

Or maybe it's fully mature and doesn't need any more work. Anyway, it's easy enough to cast to numeric using as.numeric, so there's that.

ADD COMMENT

Login before adding your answer.

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