Skip to content
Prev 2678 / 21312 Next

[Bioc-devel] eSet extension

On Mon, Jul 18, 2011 at 6:03 PM, Martin Morgan <mtmorgan at fhcrc.org> wrote:
Some experimentation has lead me to (for the moment) settle on

setMethod("initialize", "RGChannelSet",
          function(.Object, Red = new("matrix"), Green = new("matrix"), ...) {
    callNextMethod(.Object, Red = Red, Green = Green, ...)
})

Comments
(1) There is a difference between matrix() and new("matrix") (1x1 vs
0x0 and I think the later is more appropriate for an empty object).
(2) Your approach with using assayData = assayDataNew() in the
argument to the method led to the following construction fail:
  new("RGChannelSet", Red = SOMETHING, Green = SOMETHING)
because the default value of assayData overrules the explicit values
of Red and Green.  This means that one would have to give an assayData
argument, like
  new("RGChannelSet", assayData = assayDataNew(Red = SOMETHING, Green
= SOMETHING))

There is something appropriate about this, using the explicit
constructor, but in the end I think too much has been invested in the
new() paradigm for me to go this way; hence my solution above.

Thanks for the help,
Kasper