[med-svn] [r-bioc-biocgenerics] 01/06: New upstream version 0.24.0
Andreas Tille
tille at debian.org
Tue Nov 7 16:27:02 UTC 2017
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository r-bioc-biocgenerics.
commit 1bbc3601ee45102d7a61937646e37bef2ca34013
Author: Andreas Tille <tille at debian.org>
Date: Tue Nov 7 17:22:21 2017 +0100
New upstream version 0.24.0
---
DESCRIPTION | 8 ++++----
NAMESPACE | 3 +++
R/Ontology.R | 6 ++++++
R/hotfix73465.R | 5 ++++-
R/replaceSlots.R | 15 +++++---------
inst/unitTests/test_mapply.R | 21 +++++++++++++++++++
man/BiocGenerics-package.Rd | 2 ++
man/Ontology.Rd | 48 ++++++++++++++++++++++++++++++++++++++++++++
8 files changed, 93 insertions(+), 15 deletions(-)
diff --git a/DESCRIPTION b/DESCRIPTION
index 2ab222e..2675ba6 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: BiocGenerics
Title: S4 generic functions for Bioconductor
Description: S4 generic functions needed by many Bioconductor packages.
-Version: 0.22.1
+Version: 0.24.0
Author: The Bioconductor Dev Team
Maintainer: Bioconductor Package Maintainer <maintainer at bioconductor.org>
biocViews: Infrastructure
@@ -20,7 +20,7 @@ Collate: S3-classes-as-S4-classes.R normarg-utils.R hotfix73465.R
tapply.R unique.R unlist.R unsplit.R relist.R var.R which.R
boxplot.R image.R density.R IQR.R mad.R residuals.R weights.R
xtabs.R clusterApply.R annotation.R combine.R dbconn.R dge.R
- fileName.R normalize.R organism_species.R plotMA.R plotPCA.R
- score.R strand.R updateObject.R testPackage.R zzz.R
+ fileName.R normalize.R Ontology.R organism_species.R plotMA.R
+ plotPCA.R score.R strand.R updateObject.R testPackage.R zzz.R
NeedsCompilation: no
-Packaged: 2017-10-06 05:26:47 UTC; biocbuild
+Packaged: 2017-10-30 23:21:40 UTC; biocbuild
diff --git a/NAMESPACE b/NAMESPACE
index ac94259..8ba9755 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -206,6 +206,9 @@ export(
## from R/normalize.R:
normalize,
+ ## from R/Ontology.R:
+ Ontology,
+
## from R/organism_species.R:
organism, "organism<-",
species, "species<-",
diff --git a/R/Ontology.R b/R/Ontology.R
new file mode 100644
index 0000000..e668a82
--- /dev/null
+++ b/R/Ontology.R
@@ -0,0 +1,6 @@
+### =========================================================================
+### The Ontology() generic
+### -------------------------------------------------------------------------
+
+setGeneric("Ontology", function(object) standardGeneric("Ontology"))
+
diff --git a/R/hotfix73465.R b/R/hotfix73465.R
index 66d2a1d..4cdd5c4 100644
--- a/R/hotfix73465.R
+++ b/R/hotfix73465.R
@@ -63,7 +63,10 @@ apply_hotfix73465 <- function(FUN)
stopifnot(is(FUN, "standardGeneric"))
envir <- environment(FUN)
standardGenericsDots <- get("standardGeneric", envir=envir)
- standardGenericsDots <- .patch_standardGenericsDots(standardGenericsDots)
+ standardGenericsDots <-
+ try(.patch_standardGenericsDots(standardGenericsDots))
+ if (inherits(standardGenericsDots, "try-error"))
+ stop("hotfix failed for generic function ", FUN at generic, "()")
assign("standardGeneric", standardGenericsDots, envir=envir)
}
diff --git a/R/replaceSlots.R b/R/replaceSlots.R
index d6d057c..27142de 100644
--- a/R/replaceSlots.R
+++ b/R/replaceSlots.R
@@ -14,6 +14,9 @@
unsafe_replaceSlots <- function(object, ..., .slotList=list())
{
+ ## This function is no longer 'unsafe', in that it does not do
+ ## in-place modification via `slot<-()`; see
+ ## https://github.com/Bioconductor/BiocGenerics/pull/1
slots <- c(list(...), .slotList)
slots_names <- names(slots)
## This is too slow. See further down for a much faster way to check
@@ -24,7 +27,6 @@ unsafe_replaceSlots <- function(object, ..., .slotList=list())
# stop(wmsg("invalid slot(s) for ", class(object), " instance: ",
# in1string))
#}
- first_time <- TRUE
for (i in seq_along(slots)) {
slot_name <- slots_names[[i]]
if (slot_name == "mcols")
@@ -34,7 +36,7 @@ unsafe_replaceSlots <- function(object, ..., .slotList=list())
## We need to check this because the slot setter won't raise an error
## in case of invalid slot name when used with 'check=FALSE'. It will
## silently be a no-op!
- old_slot_val <- slot(object, slot_name) # just a
+ old_slot_val <- slot(object, slot_name) # check slot existence
slot_val <- slots[[i]]
## Too risky! identical() is not reliable enough e.g. with objects
## that contain external pointers. For example, DNAStringSet("A")
@@ -42,14 +44,7 @@ unsafe_replaceSlots <- function(object, ..., .slotList=list())
## would first need to be fixed.
#if (identical(old_slot_val, slot_val))
# next
- if (first_time) {
- ## Triggers a copy.
- slot(object, slot_name, check=FALSE) <- slot_val
- first_time <- FALSE
- } else {
- ## In-place modification (i.e. no copy).
- `slot<-`(object, slot_name, check=FALSE, slot_val)
- }
+ slot(object, slot_name, check=FALSE) <- slot_val
}
object
}
diff --git a/inst/unitTests/test_mapply.R b/inst/unitTests/test_mapply.R
new file mode 100644
index 0000000..4681515
--- /dev/null
+++ b/inst/unitTests/test_mapply.R
@@ -0,0 +1,21 @@
+
+test_ellipsis_forwarding_for_mapply <- function()
+{
+ mapply_wrapper <- function(FUN, x, ...) mapply(FUN, x, ...)
+ x <- list(a=1:3, 1:2)
+ y <- list(104:105, B=103)
+
+ target <- mapply(append, x, y)
+ checkIdentical(target, mapply_wrapper(append, x, y))
+
+ MoreArgs <- list(after=0)
+ target <- mapply(append, x, y, MoreArgs=MoreArgs)
+ current <- mapply_wrapper(append, x, y, MoreArgs=MoreArgs)
+ checkIdentical(target, current)
+
+ MoreArgs <- list(after=2)
+ target <- mapply(append, x, y, MoreArgs=MoreArgs, USE.NAMES=FALSE)
+ current <- mapply_wrapper(append, x, y, MoreArgs=MoreArgs, USE.NAMES=FALSE)
+ checkIdentical(target, current)
+}
+
diff --git a/man/BiocGenerics-package.Rd b/man/BiocGenerics-package.Rd
index 2ce028f..e64c53a 100644
--- a/man/BiocGenerics-package.Rd
+++ b/man/BiocGenerics-package.Rd
@@ -166,6 +166,8 @@
\item \code{\link[BiocGenerics]{normalize}}
+ \item \code{\link[BiocGenerics]{Ontology}}
+
\item \code{\link[BiocGenerics]{organism}},
\code{\link[BiocGenerics]{organism<-}},
\code{\link[BiocGenerics]{species}},
diff --git a/man/Ontology.Rd b/man/Ontology.Rd
new file mode 100644
index 0000000..a611ca8
--- /dev/null
+++ b/man/Ontology.Rd
@@ -0,0 +1,48 @@
+\name{Ontology}
+
+\alias{Ontology}
+
+\title{Generic Ontology getter}
+
+\description{
+ Get the Ontology of an object.
+}
+
+\usage{
+Ontology(object)
+}
+
+\arguments{
+ \item{object}{
+ An object with an Ontology.
+ }
+}
+
+\seealso{
+ \itemize{
+ \item \code{\link[methods]{showMethods}} for displaying a summary of the
+ methods defined for a given generic function.
+
+ \item \code{\link[methods]{selectMethod}} for getting the definition of
+ a specific method.
+
+ \item \link[AnnotationDbi]{Ontology,GOTerms-method} in the
+ \pkg{AnnotationDbi} package for an example of a specific
+ \code{Ontology} method (defined for \link[AnnotationDbi]{GOTerms}
+ objects).
+
+ \item \link{BiocGenerics} for a summary of all the generics defined
+ in the \pkg{BiocGenerics} package.
+ }
+}
+
+\examples{
+Ontology
+showMethods("Ontology")
+
+library(AnnotationDbi)
+showMethods("Ontology")
+selectMethod("Ontology", "GOTerms")
+}
+
+\keyword{methods}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/r-bioc-biocgenerics.git
More information about the debian-med-commit
mailing list