[BioC] limma MArrayLM subclass question

Gordon Smyth smyth at wehi.edu.au
Fri Sep 16 07:53:24 CEST 2005


Hi Cyrus,

This is a bit laconic for me. Can you give explicit reproducible code which 
leads to an error, and send back to list?

I assume you wouldn't be trying to do something as advanced as creating a 
new sub-class without reading the help for as() and setAs() etc, but the 
usage you describe for as() certainly does not appear to match the function 
definition. Have you successfully experimented with a toy example of a 
class and subclass and got everything working? If not, R-help would be a 
better place for questions about S4.

Regards
Gordon

>Dear bioc-devel,
>
>I'd like to subclass MArrayLM (I think), but I'm having some trouble:
>
>setClass("myMArrayLM", "MArrayLM")
>assign("[.myMArrayLM", function(object, i, j, ...)
>{ "[.MArrayLM"(object, i, j, ...) });
>
>and then I thought I could just do this (given def, an MArrayLM object)
>
>as("myArrayLM", def);
>
>But when I try that I get the following error message:
>
>  > as("myArrayLM", def);
>Error in methodsPackageMetaName("C", name) :
>      'The name of the object (e.g,. a class or generic function) to
>find in the meta-data' must be a single string (got an object of
>class "matrix")
>In addition: Warning message:
>the condition has length > 1 and only the first element will be used
>in: if (is.na(i)) {
>  >
>
>Has anyone successfully subclassed MArrayLM? Is this something I just
>shouldn't be doing? It seems natural to want to store additional data
>in an MArrayLM and get the proper subsetting behavior, piggybacking
>on MArrayLM's existing behavior.
>
>Also, is this the right place for limma questions? It doesn't have
>its own mailing list yet, does it?
>
>Thanks,
>
>Cyrus Harmon



More information about the Bioconductor mailing list