[Bioc-devel] reusing topGO objects

Lluís Revilla lluis.revilla at gmail.com
Sat Feb 25 13:25:43 CET 2017


Dear Adrian and all

I am using the package topGO and I would like to know if you could help me
to reuse the same object to perform several test, see the examples below:

library("topGO")
data(GOdata)
geneSelectionFun(GOdata) <- function(x) {x == 1L}
GOdata
resultKS.elim <- runTest(GOdata, algorithm = "elim", statistic = "ks")
allRes1 <- GenTable(GOdata, resultKS.elim)
geneSelectionFun(GOdata) <- function(x) {x > 0.5}
GOdata
resultKS.elim2 <- runTest(GOdata, algorithm = "elim", statistic = "ks")
allRes2 <- GenTable(GOdata, resultKS.elim2)
ontology(GOdata) <- "CC"
resultKS.elim3 <- runTest(GOdata, algorithm = "elim", statistic = "ks")
allRes3 <- GenTable(GOdata, resultKS.elim3)
all.equal(score(resultKS.elim), score(resultKS.elim2)) # Shouldn't it be
different?

all(names(score(resultKS.elim3)) == names(score(resultKS.elim2))) # Should
the GO terms be different?
sessionInfo()

R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.2 LTS

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

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

other attached packages:
[1] topGO_2.26.0         SparseM_1.74         GO.db_3.4.0
[4] AnnotationDbi_1.36.2 IRanges_2.8.1        S4Vectors_0.12.1
[7] Biobase_2.34.0       graph_1.52.0         BiocGenerics_0.20.0

loaded via a namespace (and not attached):
[1] Rcpp_0.12.9        matrixStats_0.51.0 lattice_0.20-34
digest_0.6.12
[5] grid_3.3.2         DBI_0.5-1          RSQLite_1.1-2
tools_3.3.2
[9] memoise_1.0.0


The object GOdata have different number of "Significant" genes annotated
when I change the geneSelectionFun, thus I would expect different p-values
but there are the same p-values in allRes2 and allRes1.

Also the test on the cellular component returns the same genes ontologies
as the previous test, which should be different because it is performed in
a different GO subcategory. Maybe that's the reason why the Term column is
NA.

I am doing something wrong? How can I reuse the same object with different
tests?

Thanks your help


Lluís

	[[alternative HTML version deleted]]



More information about the Bioc-devel mailing list