[BioC] GOHyperGResult in a data.frame, possible NAMESPACE problem?

Robert Castelo robert.castelo at upf.edu
Tue Jan 12 12:49:22 CET 2010


hi Seth,

> This sort of post might have a better home on the bioc-devel list, but 
> since we've started here, some comments below...

i was afraid this would something too trivial for bioc-devel

> I would try:
> 
> import(GOstats)
> 
> You need to import the classes as well as the methods.  You could try 
> declaring just those that you use, but I would try the above catch-all 
> first.

I've tried it out but it doesn't work either

> If you are able to post a .tar.gz of your source package to a public 
> URL, we could take a closer look.

thanks!! that's very nice from you, please see below

> > sessionInfo()
> > R version 2.9.1 (2009-06-26)
> > x86_64-unknown-linux-gnu
> 
> Especially since you are developing a package of your own, I would 
> recommend upgrading to the latest R and BioC releases.  You might also 
> consider using R-devel and Bioc-devel versions to make sure that what 
> you develope remains compatible as the project(s) evolve.

i know, rather than a software package this is a "packaged" analysis
pipeline that has been evolving since last year and i still have to port
it to the latest release which haven't done yet due to major changes
i'll have to do in re-making a custom annotation package to adapt to the
new .db annotation-package standards.

anyway, i've isolated the piece of code that produces the error and made
a package running under the devel version and as you'll see below the
error reproduces also in the current devel version.

i've put the package in the following public url:

http://functionalgenomics.upf.edu/myPkg_1.0.tar.gz

which has been created by calling package.skeleton("myPkg", "GOreport")
from the R shell with the GOreport function definition in the workspace.
then i added something to \title{ } in myPkg/man/GOreport.rd (otherwise
it cannot be installed) and added the DESCRIPTION and NAMESPACE files i
paste in my previous email. these are the commands and session info that
reproduce the problem using this package with the devel version:


library(annotate)
library(org.Hs.eg.db)
library(GOstats)
library(myPkg)

## use the genes from the death GO category as test
deathEGs <- org.Hs.egGO2EG[["GO:0016265"]]
## sample 100 genes randomly and add the death genes as universe
universeEGs <- unique(c(sample(mappedLkeys(org.Hs.egGO2EG), size=100),
deathEGs))

## test from GO enrichment
goHypGparams <- new("GOHyperGParams",
                    geneIds=deathEGs,
                    universeGeneIds=universeEGs,
                    annotation="org.Hs.eg.db",
                    ontology="BP",
                    pvalueCutoff=0.05,
                    conditional=TRUE,
                    testDirection="over")
goHypGcond <- hyperGTest(goHypGparams)

## call the problematic function
report <- GOreport(goHypGcond, "org.Hs.eg.db")
Error in do.call("expand.grid", c(dimnames(x), stringsAsFactors =
stringsAsFactors)) : 
  second argument must be a list
traceback()
9: stop("second argument must be a list")
8: do.call("expand.grid", c(dimnames(x), stringsAsFactors =
stringsAsFactors))
7: data.frame(do.call("expand.grid", c(dimnames(x), stringsAsFactors =
stringsAsFactors)), 
       Freq = c(x), row.names = row.names)
6: eval(expr, envir, enclos)
5: eval(ex)
4: as.data.frame.table(x[[i]], optional = TRUE, stringsAsFactors =
stringsAsFactors)
3: as.data.frame(x[[i]], optional = TRUE, stringsAsFactors =
stringsAsFactors)
2: data.frame(summary(goHypGresult), GeneSyms = reportGeneSyms, 
       Genes = reportGenes)
1: GOreport(goHypGcond, "org.Hs.eg.db")

sessionInfo()
R version 2.11.0 Under development (unstable) (2009-10-06 r49948) 
x86_64-unknown-linux-gnu 

locale:
[1] C

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

other attached packages:
 [1] GO.db_2.3.5         myPkg_1.0           IRanges_1.5.16     
 [4] GOstats_2.13.0      graph_1.25.3        Category_2.13.0    
 [7] org.Hs.eg.db_2.3.6  RSQLite_0.7-3       DBI_0.2-4          
[10] annotate_1.25.0     AnnotationDbi_1.9.2 Biobase_2.7.2      

loaded via a namespace (and not attached):
[1] GSEABase_1.9.0    RBGL_1.23.0       XML_2.6-0
genefilter_1.29.5
[5] splines_2.11.0    survival_2.35-7   tools_2.11.0
xtable_1.5-6     


thanks!!
robert.



More information about the Bioconductor mailing list