From renaud at mancala.cbio.uct.ac.za  Wed May  8 08:05:48 2013
From: renaud at mancala.cbio.uct.ac.za (Renaud Gaujoux)
Date: Wed, 8 May 2013 09:05:48 +0300
Subject: [Rd] Namespace/inheritance problem in S4 methods for a union class
Message-ID: <CAHavPHH2SWuCHPOz6O33KxUOjWbfGrBwfZ0-6dPn06uBydq3iA@mail.gmail.com>

Hi,

I started this post on bioc-devel but this seems to be more general:

https://stat.ethz.ch/pipermail/bioc-devel/2013-May/004311.html

See reproducible example from Martin below.

Thank you.

Renaud

---------- Forwarded message ----------
From: Martin Morgan <mtmorgan at fhcrc.org>
Date: 7 May 2013 19:55
Subject: Re: [Bioc-devel] ExpressionSet and LumiBatch: inheritance problem
in S4 methods for union class
To: Renaud Gaujoux <renaud at mancala.cbio.uct.ac.za>
Cc: bioc-devel at r-project.org, dupan.mail at gmail.com

I can replicate this with a simpler example, where PkgA has

  setClass("A", representation(x="numeric"))

with NAMESPACE

  import(methods)
  exportClasses("A")

PkgB has

  setClass("B", contains="A")

NAMESPACE

  import(methods)
  importClassesFrom("PkgA", "A")
  exportClasses("B")

and then

  library(PkgA); library(PkgB)
  setClassUnion("C", c("matrix", "A"))
  setGeneric("do", function(x) standardGeneric("do"))
  setMethod("do", "C", function(x) "done")

leading to

  > do(new("A"))
  [1] "done"
  > do(new("B"))

  Error in (function (classes, fdef, mtable)  :
    unable to find an inherited method for function ?do? for signature ?"B"?

suggesting name space issues rather than something about ExpressionSet. The
sample packages and test script are attached; it would be appropriate to
pursue this on the R-devel mailing list.

Martin

-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setClassUnion.tar.gz
Type: application/x-gzip
Size: 777 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20130508/cf4cbfb4/attachment.gz>


[Rd] Namespace/inheritance problem in S4 methods for a union class
Renaud Gaujoux