I'm trying to run a hyperGTest from GOstats (bioconductor) package on human genome data and keep getting error messages as detailed below.
The data is from hgu133plus2 and the R commands I ran (slightly paraphrased for clarity and length) are
gen <- read.table("path/genes_hum.txt", sep="\t",stringsAsFactors=FALSE, header=TRUE)
genes <- unlist(gen)
params <- new("GOHyperGParams", annotation="hgu133plus2.db", geneIds = genes, universeGeneIds = unique(toTable(hgu133plus2ENTREZID)[,2]), ontology = "BP", pvalueCutoff = 0.05, conditional = FALSE, testDirection = "over")
Results <- hyperGTest(params)
First I kept getting the following error :
Error in .checkKeys(value, Lkeys(x), x@ifnotfound) : value for "GO:0061377" not found Calls: summary ... keys<- -> keys<- -> Lkeys<- -> Lkeys<- -> .checkKeys
(though the faulty GO accession was occasionally "GO:2000142" or "GO:0072677", depending on genes selected for gene set).
Them internets often attributed this to outdated packages, so I updated all R packages that I've assumed relevant (namely AnnotationDbi, GO.db, GOstats, org.Hs.eg.db and hgu133plus2.db) and the error changed into
Error in mget(probes, ID2EntrezID(datPkg)) : second argument must be an environment Calls: hyperGTest ... getUniverseViaGo -> getUniverseHelper -> unique -> unlist -> mget
Can someone hint what I'm doing wrong?
Thanks in advance!
[sessionInfo() gives:
R version 2.13.0 (2011-04-13) Platform: i686-pc-linux-gnu (32-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=en_US.UTF-8 LC_NAME=en_US.UTF-8 [9] LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8 [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8attached base packages: [1] stats graphics grDevices utils
datasets methods baseother attached packages: [1] optparse_0.9.5 getopt_1.17
oligo_1.16.2 [4] preprocessCore_1.14.0 oligoClasses_1.14.0
GOstats_2.22.0 [7] Category_2.18.0 GO.db_2.7.1
GSEABase_1.14.0 [10] graph_1.30.0 annotate_1.30.1
hgu133plus2.db_2.7.1 [13] org.Hs.eg.db_2.7.1 RSQLite_0.11.1
DBI_0.2-5 [16] AnnotationDbi_1.18.1 Biobase_2.12.2
BiocGenerics_0.2.0 [19] rkward_0.5.4loaded via a namespace (and not attached): [1] affxparser_1.24.0 affyio_1.20.0 Biostrings_2.20.4 bit_1.1-8 [5] ff_2.2-5
genefilter_1.34.0 IRanges_1.10.6 RBGL_1.28.0 [9] splines_2.13.0 survival_2.36-9 tools_2.13.0 XML_3.9-4
[13] xtable_1.7-0 ]
Please update your R to a current version. Your R version and, subsequently, your Bioconductor packages are almost two years out-of-date.
Lo and behold! Updating R and Bioconductor solved the problem. Silly me for not thinking of the basics. Thanks for your help!
I love it when that works!