A poster on the support site reported some warnings issued when running
hyperGTest() from GOstats. I tracked this down to the ls() function from
AnnotationDbi, when it dispatches on AnnDbBimap objects. The method is:
setMethod("ls", signature(name="Bimap"),
function(name, pos, envir, all.names, pattern){
if (!missing(pos))
warning("ignoring 'pos' argument")
if (!missing(envir))
warning("ignoring 'envir' argument")
if (!missing(all.names))
warning("ignoring 'all.names' argument")
.ls(name, pos, envir, all.names, pattern)
}
)
And as noted, everything but 'name' is ignored in .ls().
This seemingly hasn't changed in years. In R-3.1.1 the method appears as
showMethods(ls, class = "AnnDbBimap", includeDefs = T)
Function: ls (package base)
name="AnnDbBimap"
function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE,
pattern)
{
if (!missing(pos))
warning("ignoring 'pos' argument")
if (!missing(envir))
warning("ignoring 'envir' argument")
if (!missing(all.names))
warning("ignoring 'all.names' argument")
.ls(name, pos, envir, all.names, pattern)
}
And now in R-3.2.0, the method appears as
showMethods(ls, class = "Bimap", includeDefs = TRUE)
Function: ls (package base)
name="Bimap"
function (name, pos = -1L, envir = as.environment(pos), all.names = FALSE,
pattern, sorted = TRUE)
{
.local <- function (name, pos, envir, all.names, pattern)
{
if (!missing(pos))
warning("ignoring 'pos' argument")
if (!missing(envir))
warning("ignoring 'envir' argument")
if (!missing(all.names))
warning("ignoring 'all.names' argument")
.ls(name, pos, envir, all.names, pattern)
}
.local(name, pos, envir, all.names, pattern)
}
Where everything gets wrapped in a call to .local(). Prior to this, we
never saw the warnings, but now we do:
z <- ls(annotate:::getAnnMap("BPPARENTS", chip = "GO"))
Warning messages:
1: In .local(name, pos, envir, all.names, pattern) :
ignoring 'pos' argument
2: In .local(name, pos, envir, all.names, pattern) :
ignoring 'envir' argument
3: In .local(name, pos, envir, all.names, pattern) :
ignoring 'all.names' argument
This is going to be a consistent issue going forward, so should all those
warnings be stripped out of the method for ls() in AnnotationDbi?