[Bioc-devel] Nasty function collision

lgautier at altern.org lgautier at altern.org
Tue Oct 31 19:24:14 CET 2006

> I am having a nasty function collision in my affycoretools package that
> is causing things to error out. I have tracked the problem down to the
> getURL() functions that are defined in RCurl and annaffy. If I load
> RCurl first and then annaffy, getURL() is silently masked, probably
> because it is an S4 function in annaffy and a regular function in RCurl.

I would think that this is effectively the case.
'getURL' is declared as a generic (which is apparently
not considered overriding anything in the search path).

This should not be so much of a problem, as setGeneric is
described to behave by default:
"Typically, an existing non-generic function becomes the default method,
but there is much optional control."

However, some code in annaffy could be the causing trouble
(by enforcing a change of the default behavior mentioned above).

The file annotation.R in annaffy (in devel) has:

setMethod("getURL", "ANY", function(object) {


Waiting for a possible fix in annaffy (I might have overlooked
aspects of the problem, and there might be a reason for
enforcing a default behavior returning 'character(0)'), you
might have some luck in calling directly getURL in its namespace
(i.e., RCurl::getURL)



> If I do the opposite, R is nice enough to mention that I have just
> masked a function from annaffy.
> In the past I got around this problem by importing annaffy rather than
> listing it in the Depends line in the DESCRIPTION file, and load()ing it
> when needed. This worked out OK because one is likely to be using either
> annaffy to create output, or biomaRt, but not usually both, so the
> masking problem was a moot point. Having annaffy in Imports ensured that
> things like biocLite() would automatically install it as a dependency.
> Unfortunately now R CMD check complains about "'library' or 'require'
> calls not declared from: annaffy" and points me to Creating R Packages
> and the DESCRIPTION file entry, which doesn't really enlighten.
> Any suggestions?
> Best,
> Jim
> James W. MacDonald, M.S.
> Biostatistician
> Affymetrix and cDNA Microarray Core
> University of Michigan Cancer Center
> 1500 E. Medical Center Drive
> 7410 CCGC
> Ann Arbor MI 48109
> 734-647-5623
> **********************************************************
> Electronic Mail is not secure, may not be read every day, and should not
> be used for urgent or sensitive issues.
> _______________________________________________
> Bioc-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

More information about the Bioc-devel mailing list