Hi,
The "initialize" method of the Versioned class in Biobase is defined in a way
that breaks when inheriting classes want to define a copy constructor.
Code to reproduce:
library(Biobase)
setClass("A",
representation = representation(var1="integer"),
prototype=prototype(var1=integer(),
new("Versioned", versions=c(A = "0.1.0"))),
contains="Versioned")
ia <- new("A")
ia2 <- new("A", ia)
# "ia" is mapped to the argument "versions" of the Versioned "initialize"
method!
Full gist snippet including bugfix:
https://gist.github.com/meowcat/c51a4260fb710e2fa51a
For explanation, see:
http://stackoverflow.com/questions/16247583/inheritance-in-r/16248773#16248773
The Versioned class in Biobase has the following "initialize" method:
function (.Object, ...)
{
.local <- function (.Object, versions = list(), ...)
{
.Object <- callNextMethod(.Object, ...)
classVersion(.Object)[names(versions)] <- versions
.Object
}
.local(.Object, ...)
}
Can you change it as follows:
function (.Object, ...)
{
.local <- function (.Object, ..., versions = list())
{
.Object <- callNextMethod(.Object, ...)
classVersion(.Object)[names(versions)] <- versions
.Object
}
.local(.Object, ...)
}
This will fix the problem.
Michael Stravs
Eawag
Umweltchemie
BU E 23
�berlandstrasse 133
8600 D�bendorf
+41 58 765 6742
[[alternative HTML version deleted]]
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel