[BioC] problem extending Category classes

Robert M. Flight rflight79 at gmail.com
Thu Dec 23 18:48:39 CET 2010


Hi All,

I am trying to make my own package a little easier to use, and want to
extend some of the Category parameter classes. I can easily extend the
primary virtual class without any problems, but I run into
difficulties if I first extend the virtual class, and then try and
extend that, or extend any of the other classes already built on it. I
want to add just one slot to the classes, but would rather not
redefine a bunch of stuff if the previously defined classes already
have what I need (which is what I would do if I extended the
HyperGParams class directly).

Two examples should illustrate what I am trying to do and the problem.


Extend the VIRTUAL class "HyperGParams", works as expected

> setClass("T1",
+          contains="HyperGParams",
+          representation=representation(numrep="numeric"),
+          prototype=prototype(numrep=1))
[1] "T1"


Now lets extend it to something like the "GOHyperGParams"

> setClass("GOT1",
+ contains="T1",
+         representation=representation(ontology="character",
+                         conditional="logical"),
+         prototype=prototype(categoryName="GO",
+            conditional=FALSE))
Loading required package: .db
Error in DatPkgFactory(annotation) :
  annotation package '.db' not available
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE,
logical.return = TRUE,  :
  there is no package called '.db'


This behavior seems to be caused by the DatPkgFactory function in
Category, but I can't figure out how to get around it in the class
definition


Ok, what about trying to extend the GOHyperGParams directly then?

> setClass("T2",
+          contains="GOHyperGParams",
+          representation=representation(numrep="numeric"),
+          prototype=prototype(numrep=1))
Loading required package: .db
Error in DatPkgFactory(annotation) :
  annotation package '.db' not available
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE,
logical.return = TRUE,  :
  there is no package called '.db'

Same problem. Is this expected behavior? Is there a way to get around
this? I would really appreciate any insight someone might have into
this.

> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

other attached packages:
[1] GOstats_2.16.0       RSQLite_0.9-3        DBI_0.2-5
[4] graph_1.28.0         Category_2.16.0      AnnotationDbi_1.12.0
[7] Biobase_2.10.0

loaded via a namespace (and not attached):
 [1] annotate_1.28.0   genefilter_1.32.0 GO.db_2.4.5       GSEABase_1.12.1
 [5] RBGL_1.26.0       splines_2.12.0    survival_2.36-1   tools_2.12.0
 [9] XML_3.2-0.2       xtable_1.5-6


Regards,

-Robert

Robert M. Flight, Ph.D.
University of Louisville Bioinformatics Laboratory
University of Louisville
Louisville, KY

PH 502-852-0467
EM robert.flight at louisville.edu
EM rflight79 at gmail.com

Williams and Holland's Law:
       If enough data is collected, anything may be proven by
statistical methods.



More information about the Bioconductor mailing list