[BioC] annotation package and namespace

Georg Otto georg.otto at tuebingen.mpg.de
Wed Feb 13 15:10:01 CET 2008

Dear Bioconductors,

I am struggling with the creation of an annotation package and the
namespace involved. I apologize if this is a trivial question, but I
am not very familiar with namespace issues.

I created environments containing annotation data using functions I
wrote for that purpose (for some reasons I do not want to use
AnnBuilder). This did work, since I can retrieve these data using

> mget(probeids, env=myENV)

As a next step I save the environment as an .rda file, create a
package and move the data into myPackage/data.

My problem now is: how to get the environment in the package namespace
upon loading of the package.

For example if I load the annotation package from bioconductor
(zebrafish) and list the package namespace I get:

> library(zebrafish)
> ls("package:zebrafish")

 [1] "zebrafish"             "zebrafishACCNUM"       "zebrafishCHR"         
 [4] "zebrafishENTREZID"     "zebrafishENZYME"       "zebrafishENZYME2PROBE"
 [7] "zebrafishGENENAME"     "zebrafishGO"           "zebrafishGO2ALLPROBES"
[10] "zebrafishGO2PROBE"     "zebrafishLOCUSID"      "zebrafishMAP"         
[13] "zebrafishMAPCOUNTS"    "zebrafishORGANISM"     "zebrafishPATH"        
[16] "zebrafishPATH2PROBE"   "zebrafishPMID"         "zebrafishPMID2PROBE"  
[19] "zebrafishQC"           "zebrafishQCDATA"       "zebrafishREFSEQ"      
[22] "zebrafishSUMFUNC"      "zebrafishSYMBOL"       "zebrafishUNIGENE"     

If I do the same thing with my own package, I get

> library(myPackage)
> ls("package:myPackage")

What I can do is to load the environment, so it appears in my
workspace, but that is not what I want:

> data(myENV)
> ls("package:zebrafishBM")
> ls()
[1] "myENV"

My question is: How should I construct the package, so the annotation
environment appears in the package workspace, equivalent to the way it
works in the bioconductor package.

This is R version 2.6.1 (2007-11-26), x86_64-redhat-linux-gnu

Thanks a lot!


More information about the Bioconductor mailing list