[BioC] Error when trying to build a package that needs to import GO.db, GOstats, ath1121501.db packages

Rich Savage r.s.savage at warwick.ac.uk
Wed Oct 29 14:17:49 CET 2008


Hi all,

I am trying to build a small package that contains some specific functions to 
perform GO annotation and have encountered an error when running 'R CMD check' 
on the package I (try to) build.  Specifically:

[1] "S4"
            Length             Class              Mode
             25369 GOTermsAnnDbBimap                S4
TERM map for GO (object of class "GOTermsAnnDbBimap")
Error in eapply(GOTERM, function(x) { : argument must be an environment
Calls: WriteGoAnnotationToCsv -> AnnotateClusters -> unlist -> eapply
Execution halted


The relevant code in my package (that generates the above) is:

   print(mode(GOTERM))
   print(summary(GOTERM))
   print(GOTERM)
   print(is.environment(GOTERM))

   goTermMaster  <- unlist(eapply(GOTERM, function(x) {x at Term}));


These functions work fine when I just 'source' them and run them via a script. 
The example in my package that 'check' is testing also runs fine when I 
cut-and-paste it into R (having sourced the relevant functions).  Then problem 
only occurs with the package version.

My concern is that I might not be importing something properly into my package. 
    My NAMESPACE file looks like this:

export(WriteGoAnnotationToCsv)
export(WriteGoAnnotationToLatex)
import(GO.db)
import(GOstats)
import(ath1121501.db)

(both the exports are my own functions)


Finally, I've also noticed that when I use the above print statements in R on 
GOTERM, I get different info.  Compare:

CODE
----
print(mode(GOTERM))
print(summary(GOTERM))
print(GOTERM)


PACKAGE-BUILDING
----------------
[1] "S4"
            Length             Class              Mode
             25369 GOTermsAnnDbBimap                S4
TERM map for GO (object of class "GOTermsAnnDbBimap")


IN R ITSELF
-----------
 >   print(mode(GOTERM))
[1] "S4"
 >   print(summary(GOTERM))
TERM map for GO (object of class "GOTermsAnnDbBimap")
|
| Lkeyname: go_id (Ltablename: go_term)
|    Lkeys: "GO:0000001", "GO:0000002", ... (total=25369/mapped=25369)
|
| Rkeyname: go_id (Rtablename: go_term)
|    Rkeys: "GO:0000001", "GO:0000002", ... (total=25369/mapped=25369)
|
| direction: L --> R
NULL
 >   print(GOTERM)
TERM map for GO (object of class "GOTermsAnnDbBimap")





SESSION INFO
R version 2.8.0 (2008-10-20)
i386-apple-darwin8.11.1

locale:
en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8

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

other attached packages:
  [1] BHC.GoAnnotation_1.2 ath1121501.db_2.2.7  GOstats_2.8.0 
Category_2.8.0
  [5] genefilter_1.22.0    survival_2.34-1      RBGL_1.18.0 
annotate_1.20.0
  [9] xtable_1.5-4         graph_1.20.0         GO.db_2.2.5 
RSQLite_0.7-0
[13] DBI_0.2-4            AnnotationDbi_1.4.0  Biobase_2.2.0        BHC_1.2.0 


loaded via a namespace (and not attached):
[1] GSEABase_1.4.0  XML_1.98-1      cluster_1.11.11



Thanks very much for any help you can offer!

Rich


-- 
------------------------------------------------------------------
   Dr. Richard Savage			Tel: +44 (0)24 765 50243
   Systems Biology Centre		
   University of Warwick
   Coventry
   CV4 7AL
   United Kingdom

   Web:  http://www.programming4scientists.com/
   	http://wsbc.warwick.ac.uk/~richsavage/



More information about the Bioconductor mailing list