[Bioc-devel] Recent R change: switch() and NAMESPACE

Martin Morgan mtmorgan at fhcrc.org
Mon Nov 29 01:20:47 CET 2010


Bioc Developers --

A patch to very recent R (svn revision 53686 for R-devel, r53688 for
R-2-12-patched) corrects a bug -- switch() can only have one unnamed
argument in ... when the first argument is character(). Please review
your code for this problem.

The change has consequences for NAMESPACE files, where in the past
invalid directives were silently ignored. Here are the packages failing
to install, and the required changes. Common problems are:

* simple typos, e.g., use S3method (lower-case m), exportMethods
(plural), etc

* inappropriate code, e.g., .onLoad incorrectly defined or 'invoked'
from NAMESPACE

The changes below (committed to svn) allow affected package to install,
but imply that the NAMESPACE was different from what package authors
were expecting; authors should check carefully that the changes do not
have consequences for their package.

The R on Bioconductor build machines will be updated early next week.
The original thread for this bug is at

https://stat.ethz.ch/pipermail/r-devel/2010-November/059228.html

If you have questions, please do not hesitate to ask.

Index: GGtools/NAMESPACE
===================================================================
--- GGtools/NAMESPACE	(revision 51087)
+++ GGtools/NAMESPACE	(working copy)
@@ -44,4 +44,4 @@

 exportClass(eqtlTestsManager)

-exportMethod("topFeats")
+exportMethods(topFeats)
Index: GLAD/NAMESPACE
===================================================================
--- GLAD/NAMESPACE	(revision 51087)
+++ GLAD/NAMESPACE	(working copy)
@@ -1,3 +1,2 @@
 exportPattern("^[[:alpha:]]+")
 useDynLib("GLAD")
-.onLoad()
Index: LVSmiRNA/NAMESPACE
===================================================================
--- LVSmiRNA/NAMESPACE	(revision 51087)
+++ LVSmiRNA/NAMESPACE	(working copy)
@@ -20,8 +20,8 @@

 exportMethods(exprs,"exprs<-",preproc,"preproc<-",boxplot,sampleNames,featureNames,probeNames)

-S3Method(plot,RA)
-S3Method(lvs,EList)
-S3Method(lvs,RGList)
-S3Method(summarize,EList)
-S3Method(summarize,RGList)
+exportMethods(plot)
+S3method(lvs, EList)
+S3method(lvs, RGList)
+S3method(summarize, EList)
+S3method(summarize, RGList)
Index: MassArray/NAMESPACE
===================================================================
--- MassArray/NAMESPACE	(revision 51087)
+++ MassArray/NAMESPACE	(working copy)
@@ -19,9 +19,9 @@
 	MassArrayData
 )

-S3Method(plot, MassArrayData)
+S3method(plot, MassArrayData)

-S3Method(sum, MassArraySpectrum)
+S3method(sum, MassArraySpectrum)

 export(
 	ampliconPrediction,
Index: RMAPPER/NAMESPACE
===================================================================
--- RMAPPER/NAMESPACE	(revision 51087)
+++ RMAPPER/NAMESPACE	(working copy)
@@ -1,10 +1,10 @@
 exportClasses("mapperHits")

-exportMethod("query")
-exportMethod("hits")
+exportMethods("query")
+exportMethods("hits")

 export(query)
 export(hits)
 export(readMAPPER)
 export(rmapperHelp)
-export(rmapperFactorTable)
\ No newline at end of file
+export(rmapperFactorTable)
Index: biocDatasets/NAMESPACE
===================================================================
--- biocDatasets/NAMESPACE	(revision 51087)
+++ biocDatasets/NAMESPACE	(working copy)
@@ -22,7 +22,7 @@
 ##-- Biostrings
 importClassesFrom("Biostrings",
                   "DNAStringSet")
-importMethodFrom("Biostrings",
+importMethodsFrom("Biostrings",
                  "nchar")

 ##-- export
Index: dualKS/NAMESPACE
===================================================================
--- dualKS/NAMESPACE	(revision 51087)
+++ dualKS/NAMESPACE	(working copy)
@@ -10,7 +10,5 @@
  "dksCustomClass"
 )

-importClasses(methods,base)
-
 exportClasses(DKSGeneScores, DKSClassifier, DKSPredicted)
 exportMethods(plot,show,summary)
Index: edgeR/NAMESPACE
===================================================================
--- edgeR/NAMESPACE	(revision 51087)
+++ edgeR/NAMESPACE	(working copy)
@@ -1,5 +1,3 @@
-.onLoad <- function(lib, pkg) require(methods)
-
 #  All functions exported other than those starting with "."
 exportPattern("^[^\\.]")

Index: geneRecommender/NAMESPACE
===================================================================
--- geneRecommender/NAMESPACE	(revision 51087)
+++ geneRecommender/NAMESPACE	(working copy)
@@ -1,5 +1,5 @@
 import(methods)
-importClasses(Biobase, ExpressionSet, eSet, Versioned, VersionedBiobase)
+importClassesFrom(Biobase, ExpressionSet, eSet, Versioned,
VersionedBiobase)
 importMethodsFrom(Biobase, exprs, "exprs<-")
 importFrom(stats, median, na.omit, var)

Index: limma/NAMESPACE
===================================================================
--- limma/NAMESPACE	(revision 51087)
+++ limma/NAMESPACE	(working copy)
@@ -1,5 +1,3 @@
-.onLoad <- function(lib, pkg) require(methods)
-
 #  All functions exported other than those starting with "."
 exportPattern("^[^\\.]")

Index: mBPCR/NAMESPACE
===================================================================
--- mBPCR/NAMESPACE	(revision 51087)
+++ mBPCR/NAMESPACE	(working copy)
@@ -1,6 +1,5 @@

 importMethodsFrom(Biobase, annotation, assayData,
featureData,featureNames, phenoData)
-importMethodFrom(SNPchip,centromere)
 importClassesFrom(oligoClasses, oligoSnpSet)


Index: marray/NAMESPACE
===================================================================
--- marray/NAMESPACE	(revision 51087)
+++ marray/NAMESPACE	(working copy)
@@ -35,4 +35,3 @@

 exportClasses("marrayInfo","marrayLayout","marrayRaw","marrayNorm","ShowLargeObject")

-.onLoad <- function(lib,pkg) require(methods)
Index: timecourse/NAMESPACE
===================================================================
--- timecourse/NAMESPACE	(revision 51087)
+++ timecourse/NAMESPACE	(working copy)
@@ -1,5 +1,4 @@
-imports(methods)
-importFrom(methods, is, new)
+import(methods)

 importClassesFrom(Biobase, ExpressionSet, eSet, Versioned,
VersionedBiobase)
 importMethodsFrom(Biobase, exprs)

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

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioc-devel mailing list