[Bioc-devel] unexpected interaction of "exprSet" and "DBI" package

Martin Morgan mtmorgan at fhcrc.org
Sun Apr 15 03:03:08 CEST 2007

I wonder if it's a bug in methods?

> setClass("A", contains="list")
[1] "A"
> as(list(), "A")
An object of class "A"
> library(DBI)
Error in .mergeMethodsTable(generic, mtable, get(tname, envir = env),  : 
	Invalid object in meta table of methods for "coerce", label "list#A", had class "function"

The method table entry for the auto-generated 'as' is a simple function

> get(".MTable", environment(coerce))[["list#A"]]
function (from, to) 
    obj <- new("A")
    as(obj, "list") <- from
<environment: namespace:methods>

whereas all the other entries are

> class(get(".MTable", environment(coerce))[["ANY#vector"]])
[1] "MethodDefinition"
[1] "methods"

If so, the culprit is methods:::.asFromReplace, called from


> sessionInfo()
R version 2.6.0 Under development (unstable) (2007-04-06 r41065) 


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

Seth Falcon <sfalcon at fhcrc.org> writes:

> Wolfgang Huber <huber at ebi.ac.uk> writes:
>> Hi
>> has anybody seen the following phenomenon before or have an idea whether 
>> it is to be considered a bug in either methods, Biobase or DBI?
> Not until now.
>> library("Biobase")
>> new("exprSet", description = new("MIAME"))
>> library("DBI")
>> Error in .mergeMethodsTable(generic, mtable, get(tname, envir = env),  :
>>          Invalid object in meta table of methods for "coerce", label 
>> "list#Versions", had class "function"
>> Thanks to Jelle Goeman, who pointed out a version of this problem. My 
>> attempts to more closely locate the origin have so far not been 
>> successul. The error does not occur when 'description = new("MIAME")' is 
>> omitted.
> Very odd.  The NAMESPACE file in DBI was exporting a coerce method
> when it should not have (there is no call to setAs).  Removing the
> coerce export from DBI seems to have made the problem go away.  I will
> send an update to CRAN.
> Still, this seems buggy to me: I would expect at least a warning about
> exporting methods that you don't define in any way.  And not ending up
> with a corrupt methods table would be nice.
> Thanks for the report.
> Bw,
> + seth
> -- 
> Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
> http://bioconductor.org
> _______________________________________________
> Bioc-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

Martin Morgan
Bioconductor / Computational Biology

More information about the Bioc-devel mailing list