Running R2.4.0 on Apple Mac OS X 10.4.8,
in Emacs ESS mode, and also R.app.
In an attempt to learn a bit more about
a particular method (geneNames in package affy)
I invoked
getMethods("geneNames")
which produced geneNames methods, but not the
one in affy (output below).
I had to know the signature (AffyBatch) in order
to find the method
getMethod("geneNames", "AffyBatch")
Isn't getMethods() supposed to get them all?
Is this a problem, or bug, or am I misunderstanding
something?
I try to use getMethods() to learn how things work,
without having to always get the source code and
grep my way through the source. Is there another
way to get all methods that I should be using?
Any info appreciated.
library(affy)
Loading required package: Biobase
Loading required package: tools
Welcome to Bioconductor
Vignettes contain introductory material. To view, type
'openVignette()' or start with 'help(Biobase)'. For details
on reading vignettes, see the openVignette help page.
Loading required package: affyio
getMethods("geneNames")
An object of class ?MethodsList?
Slot "methods":
$ExpressionSet
Method Definition:
function (object)
{
.Deprecated("featureNames")
featureNames(object)
}
<environment: namespace:Biobase>
Signatures:
object
target "ExpressionSet"
defined "ExpressionSet"
$exprSet
Method Definition:
function (object)
featureNames(object)
<environment: namespace:Biobase>
Signatures:
object
target "exprSet"
defined "exprSet"
Slot "argument":
object
Slot "allMethods":
$ExpressionSet
Method Definition:
function (object)
{
.Deprecated("featureNames")
featureNames(object)
}
<environment: namespace:Biobase>
Signatures:
object
target "ExpressionSet"
defined "ExpressionSet"
$exprSet
Method Definition:
function (object)
featureNames(object)
<environment: namespace:Biobase>
Signatures:
object
target "exprSet"
defined "exprSet"
Method Definition:
function (object)
{
cdf.envir <- getCdfInfo(object)
return(ls(env = cdf.envir))
}
Signatures:
object
target "AffyBatch"
defined "AffyBatch"
Steven McKinney
Statistician
Molecular Oncology and Breast Cancer Program
British Columbia Cancer Research Centre
email: smckinney at bccrc.ca
tel: 604-675-8000 x7561
BCCRC
Molecular Oncology
675 West 10th Ave, Floor 4
Vancouver B.C.
V5Z 1L3
Canada
Running R2.4.0 on Apple Mac OS X 10.4.8,
in Emacs ESS mode, and also R.app.
In an attempt to learn a bit more about
a particular method (geneNames in package affy)
I invoked
getMethods("geneNames")
which produced geneNames methods, but not the
one in affy (output below).
I had to know the signature (AffyBatch) in order
to find the method
getMethod("geneNames", "AffyBatch")
Isn't getMethods() supposed to get them all?
Is this a problem, or bug, or am I misunderstanding
something?
I try to use getMethods() to learn how things work,
without having to always get the source code and
grep my way through the source. Is there another
way to get all methods that I should be using?
Any info appreciated.
I think it may be a bug in getMethods. At least, I would expect it to
show the AffyBatch method. The output of showMethods is, IMO, more
readable and, in this case, more useful:
library(affy)
[snip]
showMethods("geneNames")
Function: geneNames (package Biobase)
object="AffyBatch"
object="ExpressionSet"
object="exprSet"
As an aside, geneNames is deprecated in favor of featureNames, a
somewhat more "P.C." term for the things measured on the chips :-)
Best,
+ seth
Hi Seth,
Thanks for the info - actually one of the things
I like about getMethods is seeing the function
internals - as you point out, geneNames is being
deprecated in favour of featureNames, which is
revealed by the guts of the geneNames method ;)
getMethods("geneNames")
An object of class ?MethodsList?
Slot "methods":
$ExpressionSet
Method Definition:
function (object)
{
.Deprecated("featureNames")
featureNames(object)
}
<environment: namespace:Biobase>
Signatures:
object
target "ExpressionSet"
defined "ExpressionSet"
-----Original Message-----
From: r-devel-bounces at r-project.org on behalf of Seth Falcon
Sent: Thu 10/12/2006 5:28 PM
To: r-devel at stat.math.ethz.ch
Subject: Re: [Rd] getMethods() not finding all methods
"Steven McKinney" <smckinney at bccrc.ca> writes:
Running R2.4.0 on Apple Mac OS X 10.4.8,
in Emacs ESS mode, and also R.app.
In an attempt to learn a bit more about
a particular method (geneNames in package affy)
I invoked
getMethods("geneNames")
which produced geneNames methods, but not the
one in affy (output below).
I had to know the signature (AffyBatch) in order
to find the method
getMethod("geneNames", "AffyBatch")
Isn't getMethods() supposed to get them all?
Is this a problem, or bug, or am I misunderstanding
something?
I try to use getMethods() to learn how things work,
without having to always get the source code and
grep my way through the source. Is there another
way to get all methods that I should be using?
Any info appreciated.
I think it may be a bug in getMethods. At least, I would expect it to
show the AffyBatch method. The output of showMethods is, IMO, more
readable and, in this case, more useful:
library(affy)
[snip]
showMethods("geneNames")
Function: geneNames (package Biobase)
object="AffyBatch"
object="ExpressionSet"
object="exprSet"
As an aside, geneNames is deprecated in favor of featureNames, a
somewhat more "P.C." term for the things measured on the chips :-)
Best,
+ seth
______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Yes, that's why showMethods() has the option includeDefs=TRUE to
include the definitions. There are other options to look at multiple
functions or specific classes. Look at ?showMethods
A feature request: it would be useful in the context of attempting to
build documentation helper tools to have a return value that was
more structured than what printTo=FALSE provides.
And no, it's not a bug in getMethods(), which was never intended for
human-readable output, but a side-effect of the changes for faster
caching and dispatch in 2.4.0. With the use of environments in place
of the methods list objects (returned by getMethods()), getMethods()
will probably be deprecated in the next version.
I was expecting a different result based on the first sentence in the
doc describing getMethods:
The function 'getMethods' returns all the methods for a particular
generic (in the form of a generic function with the methods
information in its environment).
Hence, it surprises me that not all methods are returned. Reading on
I now see:
... is not intended to be called directly.
So I guess I got what I deserve ;-)
+ seth