[Bioc-devel] prada package and eSet in Biobase

Florian Hahne f.hahne at dkfz.de
Thu Apr 13 20:52:32 CEST 2006


Hi Seth & Co,
thanks for the extensive essay about eSets...
I totaly agree with the concept of the virtual eSet class and indeed a 
MultiExpressionSet subclass would be contrary to all the ideas behind 
it. But as you know, people are lazy and always try to take the path of 
least resistance...
Regarding discipline: It isn't that much work to program this stuff and 
Martin's code stubs are already very helpful. Maybe two or three more 
sentences what the function calls are doing and it can already be put 
into a vignette. If you are interested I can try to condense the 
messages of this thread into a vignette once all the infrastructural 
stuff is realy finished. But there still remain a couple of open questions:

1.) I prefer to set the validation function already with the class 
definition. Is there a reason I should not do that and use setValidity 
instead?

etClass("mytestSet", contains = "eSet",
         validity = function(object){
           msg <- TRUE
           msg <- assayDataValidMembers(assayData(object), c("exprs", 
"other", "stuff"))
           #some further validity checks...
           return(msg)})

setMethod("initialize", "mytestSet",
          function(.Object,
                   phenoData = new("AnnotatedDataFrame"),
                   experimentData = new("MIAME"),
                   annotation = character(),
                   exprs = new("matrix"),
                   other = new("matrix"),
                   stuff = new("matrix"))
                   {
            callNextMethod(.Object,
                           assayData = assayDataNew(
                 storage.mode="list",
                             exprs = exprs,
                             other = other,
                             stuff = stuff
                            ),
                           phenoData = phenoData,
                           experimentData = experimentData,
                           annotation = annotation)
          })

2.) Does it make sense to program the constructor/initialzer in a way 
that one has to give all the items of assayData individualy? Wouldn't it 
be better to accept a predefined assayData object? Or should one just do 
something like this:

obj  <- new("mytestSet")
ad <- assayDataNew(storage.mode="list",
                                  exprs = matrix(1:9, ncol=3),
                                  other = matrix(1:9, ncol=3),
                                  stuff = matrix(1:9, ncol=3))
assayData(obj) <- ad

3.) Shouldn't all of eSet's replacement methods call validObject before 
they finish? I always find it a waste of time writing validator 
functions and then by doing a stupid replacement (like the one above) 
create invalid objects without even noticing.

validObject(obj)

Of course eventualy it will be necessary to overwrite the replacement 
methods of eSet if your class structure gets sophisticated but for the 
day to day usage most people will probably rely on the methods provided 
by eSet.

Hope these questions are not completely stupid but that's what I noticed 
while playing around with the new stuff.

Cheers,
Florian



More information about the Bioc-devel mailing list