diff -Nru r-bioc-biocgenerics-0.14.0/debian/changelog r-bioc-biocgenerics-0.16.0/debian/changelog --- r-bioc-biocgenerics-0.14.0/debian/changelog 2015-05-09 05:30:15.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/debian/changelog 2015-10-29 15:48:07.000000000 +0000 @@ -1,3 +1,10 @@ +r-bioc-biocgenerics (0.16.0-1) unstable; urgency=medium + + * New upstream version + * Add missing r-cran-runit to debian/test/control + + -- Andreas Tille Thu, 29 Oct 2015 16:30:20 +0100 + r-bioc-biocgenerics (0.14.0-1) unstable; urgency=medium * New upstream version diff -Nru r-bioc-biocgenerics-0.14.0/debian/tests/control r-bioc-biocgenerics-0.16.0/debian/tests/control --- r-bioc-biocgenerics-0.14.0/debian/tests/control 2015-05-09 05:30:15.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/debian/tests/control 2015-10-29 15:48:07.000000000 +0000 @@ -1,3 +1,3 @@ Tests: run-unit-test -Depends: @ +Depends: @, r-cran-runit Restrictions: allow-stderr diff -Nru r-bioc-biocgenerics-0.14.0/DESCRIPTION r-bioc-biocgenerics-0.16.0/DESCRIPTION --- r-bioc-biocgenerics-0.14.0/DESCRIPTION 2015-04-17 03:42:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/DESCRIPTION 2015-10-14 02:13:19.000000000 +0000 @@ -1,7 +1,7 @@ Package: BiocGenerics Title: S4 generic functions for Bioconductor Description: S4 generic functions needed by many Bioconductor packages. -Version: 0.14.0 +Version: 0.16.0 Author: The Bioconductor Dev Team Maintainer: Bioconductor Package Maintainer biocViews: Infrastructure @@ -11,15 +11,16 @@ oligoClasses, oligo, affyPLM, flowClust, affy, DESeq2, MSnbase, annotate, RUnit License: Artistic-2.0 -Collate: S3-classes-as-S4-classes.R normarg-utils.R update-utils.R - show-utils.R append.R as.data.frame.R as.list.R as.vector.R - cbind.R do.call.R duplicated.R eval.R Extremes.R funprog.R - get.R is.unsorted.R lapply.R mapply.R match.R nrow.R order.R - paste.R rank.R rep.R row_colnames.R sets.R sort.R start.R - table.R tapply.R unique.R unlist.R unsplit.R relist.R boxplot.R - image.R density.R residuals.R weights.R xtabs.R clusterApply.R - annotation.R combine.R dge.R fileName.R normalize.R - organism_species.R plotMA.R plotPCA.R score.R strand.R - updateObject.R testPackage.R test_BiocGenerics_package.R zzz.R +Collate: S3-classes-as-S4-classes.R normarg-utils.R replaceSlots.R + append.R as.data.frame.R as.list.R as.vector.R cbind.R + do.call.R duplicated.R eval.R Extremes.R funprog.R get.R grep.R + IQR.R is.unsorted.R lapply.R lengths.R mad.R mapply.R match.R + nrow.R order.R paste.R rank.R rep.R row_colnames.R sets.R + sort.R start.R subset.R table.R tapply.R unique.R unlist.R + unsplit.R relist.R boxplot.R image.R density.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 test_BiocGenerics_package.R zzz.R NeedsCompilation: no -Packaged: 2015-04-17 03:42:27 UTC; biocbuild +Packaged: 2015-10-14 02:13:19 UTC; biocbuild diff -Nru r-bioc-biocgenerics-0.14.0/man/BiocGenerics-package.Rd r-bioc-biocgenerics-0.16.0/man/BiocGenerics-package.Rd --- r-bioc-biocgenerics-0.14.0/man/BiocGenerics-package.Rd 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/BiocGenerics-package.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -58,6 +58,8 @@ \item \code{BiocGenerics::\link[BiocGenerics]{lapply}}, \code{BiocGenerics::\link[BiocGenerics]{sapply}} + \item \code{BiocGenerics::\link[BiocGenerics]{lengths}} + \item \code{BiocGenerics::\link[BiocGenerics]{mapply}} \item \code{BiocGenerics::\link[BiocGenerics]{match}} @@ -94,6 +96,8 @@ \code{BiocGenerics::\link[BiocGenerics]{width}}, \code{BiocGenerics::\link[BiocGenerics]{width<-}} + \item \code{BiocGenerics::\link[BiocGenerics]{subset}} + \item \code{BiocGenerics::\link[BiocGenerics]{table}} \item \code{BiocGenerics::\link[BiocGenerics]{tapply}} @@ -152,6 +156,9 @@ \item \code{\link[BiocGenerics]{combine}} + \item \code{\link[BiocGenerics]{dbconn}}, + \code{\link[BiocGenerics]{dbfile}} + \item \code{\link[BiocGenerics]{fileName}} \item \code{\link[BiocGenerics]{normalize}} diff -Nru r-bioc-biocgenerics-0.14.0/man/cbind.Rd r-bioc-biocgenerics-0.16.0/man/cbind.Rd --- r-bioc-biocgenerics-0.14.0/man/cbind.Rd 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/cbind.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -53,7 +53,7 @@ \item \code{\link[methods]{selectMethod}} for getting the definition of a specific method. - \item \link[IRanges]{cbind,DataFrame-method} in the \pkg{IRanges} + \item \link[S4Vectors]{cbind,DataFrame-method} in the \pkg{S4Vectors} package for an example of a specific \code{cbind} method (defined for \link[S4Vectors]{DataFrame} objects). diff -Nru r-bioc-biocgenerics-0.14.0/man/dbconn.Rd r-bioc-biocgenerics-0.16.0/man/dbconn.Rd --- r-bioc-biocgenerics-0.14.0/man/dbconn.Rd 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/dbconn.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,60 @@ +\name{dbconn} + +\alias{dbconn} +\alias{dbfile} + +\title{Accessing SQLite DB information} + +\description{ + Get a connection object or file path for a SQLite DB +} + +\usage{ +dbconn(x) +dbfile(x) +} + +\arguments{ + \item{x}{ + An object with a SQLite connection. + } +} + +\value{ + \code{dbconn} returns a connection object to the SQLite DB containing + \code{x}'s data. + + \code{dbfile} returns a path (character string) to the SQLite DB (file) + containing \code{x}'s data. +} + +\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]{dbconn,AnnotationDb-method} in the + \pkg{AnnotationDbi} package for an example of a specific + \code{dbconn} method (defined for \link[AnnotationDbi]{dbconn} + objects). + + \item \link{BiocGenerics} for a summary of all the generics defined + in the \pkg{BiocGenerics} package. + } +} + +\examples{ +dbconn +showMethods("dbconn") +dbfile +showMethods("dbfile") + +library(AnnotationDbi) +showMethods("dbconn") +selectMethod("dbconn", "AnnotationDb") +} + +\keyword{methods} diff -Nru r-bioc-biocgenerics-0.14.0/man/grep.Rd r-bioc-biocgenerics-0.16.0/man/grep.Rd --- r-bioc-biocgenerics-0.14.0/man/grep.Rd 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/grep.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,70 @@ +\name{grep} + +\alias{grep} +\alias{grepl} + +\title{Pattern Matching and Replacement} + +\description{ + Search for matches to argument 'pattern' within each element of a character + vector. + + NOTE: This man page is for the \code{grep} and \code{grepl} + \emph{S4 generic functions} defined in the \pkg{BiocGenerics} package. + See \code{?base::\link[base]{grep}} for the default methods + (defined in the \pkg{base} package). + Bioconductor packages can define specific methods for objects + not supported by the default method. +} + +\usage{ +grep(pattern, x, ignore.case = FALSE, perl = FALSE, value = FALSE, + fixed = FALSE, useBytes = FALSE, invert = FALSE) +grepl(pattern, x, ignore.case = FALSE, perl = FALSE, + fixed = FALSE, useBytes = FALSE) +} + +\arguments{ + \item{pattern}{ + The pattern for searching in \code{x}, such as a regular expression. + } + \item{x}{ + The character vector (in the general sense) to search. + } + \item{ignore.case, perl, value, fixed, useBytes, invert}{ + See \code{?base::\link[base]{grep}} for a description of + these arguments. + } +} + +\value{ + See \code{?base::\link[base]{grep}} for the value returned + by the default method. + + Specific methods defined in Bioconductor packages should + behave as consistently as possible with the default method. +} + +\seealso{ + \itemize{ + \item \code{base::\link[base]{grep}} for the default + \code{grep} and \code{grepl} methods. + + \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{BiocGenerics} for a summary of all the generics defined + in the \pkg{BiocGenerics} package. + } +} + +\examples{ +grep # note the dispatch on 'pattern' and 'x' args only +showMethods("grep") +selectMethod("grep", "ANY") # the default method +} + +\keyword{methods} diff -Nru r-bioc-biocgenerics-0.14.0/man/IQR.Rd r-bioc-biocgenerics-0.16.0/man/IQR.Rd --- r-bioc-biocgenerics-0.14.0/man/IQR.Rd 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/IQR.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,58 @@ +\name{IQR} + +\alias{IQR} + +\title{The Interquartile Range} + +\description{ + Compute the interquartile range for a vector. + + NOTE: This man page is for the \code{IQR} \emph{S4 generic function} + defined in the \pkg{BiocGenerics} package. + See \code{?stats::\link[stats]{IQR}} for the default method + (defined in the \pkg{stats} package). + Bioconductor packages can define specific methods for objects + not supported by the default method. +} + +\usage{ +IQR(x, na.rm = FALSE, type = 7) +} + +\arguments{ + \item{x, na.rm, type}{ + See \code{?stats::\link[stats]{IQR}}. + } +} + +\value{ + See \code{?stats::\link[stats]{IQR}} for the value returned by the + default method. + + Specific methods defined in Bioconductor packages should + behave as consistently as possible with the default method. +} + +\seealso{ + \itemize{ + \item \code{stats::\link[stats]{IQR}} for the default + \code{IQR} method. + + \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{BiocGenerics} for a summary of all the generics defined + in the \pkg{BiocGenerics} package. + } +} + +\examples{ +IQR +showMethods("IQR") +selectMethod("IQR", "ANY") # the default method +} + +\keyword{methods} diff -Nru r-bioc-biocgenerics-0.14.0/man/is.unsorted.Rd r-bioc-biocgenerics-0.16.0/man/is.unsorted.Rd --- r-bioc-biocgenerics-0.14.0/man/is.unsorted.Rd 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/is.unsorted.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -38,7 +38,7 @@ } \note{ - TO DEVELOPPERS: + TO DEVELOPERS: The \code{is.unsorted} method for specific vector-like objects should adhere to the same underlying order used by the diff -Nru r-bioc-biocgenerics-0.14.0/man/lengths.Rd r-bioc-biocgenerics-0.16.0/man/lengths.Rd --- r-bioc-biocgenerics-0.14.0/man/lengths.Rd 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/lengths.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,99 @@ +\name{lengths} + +\alias{lengths} + +\title{Lengths of the list elements of a list-like object} + +\description{ + Get the length of each list element of a list-like object. + + NOTE: This man page is for the \code{lengths} \emph{S4 generic + function} defined in the \pkg{BiocGenerics} package. + See \code{?base::\link[base]{lengths}} for the default method + (defined in the \pkg{base} package). + Bioconductor packages can define specific methods for list-like + objects not supported by the default method. +} + +\usage{ +lengths(x, use.names=TRUE) +} + +\arguments{ + \item{x}{ + A list-like object. Can also be a vector-like object that is not + list-like, in which case the result is trivial. + } + \item{use.names}{ + See \code{?base::\link[base]{lengths}} for a description of + this argument. + } +} + +\value{ + See \code{?base::\link[base]{lengths}} for the value returned by the + default method. + + Specific methods defined in Bioconductor packages should + behave as consistently as possible with the default method. +} + +\note{ + IMPORTANT: The default method (\code{base::\link[base]{lengths}}) + is equivalent to \code{sapply(x, length)}. However, because the + \code{lengths} method for \link[S4Vectors]{Vector} objects is currently + defined as an alias for \code{S4Vectors::\link[S4Vectors]{elementLengths}}, + it's equivalent to \code{sapply(x, NROW)}, not to \code{sapply(x, length)}. + + This makes a difference if \code{x} has array-like list elements. + See \code{?base::\link[base]{NROW}} for the difference between + \code{length()} and \code{NROW()}. + This difference is illustrated in the Examples section below. + + This is a temporary situation that will be addressed in BioC 3.3. +} + +\seealso{ + \itemize{ + \item \code{base::\link[base]{lengths}} for the default \code{lengths} + method. + + \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[S4Vectors]{lengths,Vector-method} in the \pkg{S4Vectors} + package for an example of a specific \code{lengths} method (defined + for \link[S4Vectors]{Vector} objects). + + \item \link{BiocGenerics} for a summary of all the generics defined + in the \pkg{BiocGenerics} package. + } +} + +\examples{ +lengths # note the dispatch on the 'x' arg only +showMethods("lengths") +selectMethod("lengths", "ANY") # the default method + +library(S4Vectors) +showMethods("lengths") +selectMethod("lengths", "Vector") # the "lengths" method for Vector + # objects + +## Difference between default method and method for Vector objects: +groups <- c("group1", "group2") +df <- data.frame( + a=letters[1:10], + i=101:110, + group=rep(factor(groups, levels=groups), c(6, 4)) +) +x1 <- split(df, df$group) +x2 <- split(DataFrame(df), df$group) +lengths(x1) # dispatch on default method +lengths(x2) # dispatch on method for Vector objects +} + +\keyword{methods} diff -Nru r-bioc-biocgenerics-0.14.0/man/mad.Rd r-bioc-biocgenerics-0.16.0/man/mad.Rd --- r-bioc-biocgenerics-0.14.0/man/mad.Rd 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/mad.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,60 @@ +\name{mad} + +\alias{mad} + +\title{Median Absolute Deviation} + +\description{ + Compute the median absolute deviation for a vector, dispatching only + on the first argument, \code{x}. + + NOTE: This man page is for the \code{mad} \emph{S4 generic function} + defined in the \pkg{BiocGenerics} package. + See \code{?stats::\link[stats]{mad}} for the default method + (defined in the \pkg{stats} package). + Bioconductor packages can define specific methods for objects + not supported by the default method. +} + +\usage{ +mad(x, center = median(x), constant = 1.4826, + na.rm = FALSE, low = FALSE, high = FALSE) +} + +\arguments{ + \item{x, center, constant, na.rm, low, high}{ + See \code{?stats::\link[stats]{mad}}. + } +} + +\value{ + See \code{?stats::\link[stats]{mad}} for the value returned by the + default method. + + Specific methods defined in Bioconductor packages should + behave as consistently as possible with the default method. +} + +\seealso{ + \itemize{ + \item \code{stats::\link[stats]{mad}} for the default + \code{mad} method. + + \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{BiocGenerics} for a summary of all the generics defined + in the \pkg{BiocGenerics} package. + } +} + +\examples{ +mad +showMethods("mad") +selectMethod("mad", "ANY") # the default method +} + +\keyword{methods} diff -Nru r-bioc-biocgenerics-0.14.0/man/order.Rd r-bioc-biocgenerics-0.16.0/man/order.Rd --- r-bioc-biocgenerics-0.14.0/man/order.Rd 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/order.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -43,7 +43,7 @@ } \note{ - TO DEVELOPPERS: + TO DEVELOPERS: Specific \code{order} methods should preferably be made "stable" for consistent behavior across platforms and consistency with diff -Nru r-bioc-biocgenerics-0.14.0/man/organism_species.Rd r-bioc-biocgenerics-0.16.0/man/organism_species.Rd --- r-bioc-biocgenerics-0.14.0/man/organism_species.Rd 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/organism_species.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -42,7 +42,7 @@ } \note{ - TO DEVELOPPERS: + TO DEVELOPERS: \code{species} has been historically misused in many places in Bioconductor and is redundant with \code{organism}. So implementing the \code{species} diff -Nru r-bioc-biocgenerics-0.14.0/man/rank.Rd r-bioc-biocgenerics-0.16.0/man/rank.Rd --- r-bioc-biocgenerics-0.14.0/man/rank.Rd 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/rank.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -40,7 +40,7 @@ } \note{ - TO DEVELOPPERS: + TO DEVELOPERS: See note in \code{?BiocGenerics::\link[BiocGenerics]{order}} about "stable" order. diff -Nru r-bioc-biocgenerics-0.14.0/man/rep.Rd r-bioc-biocgenerics-0.16.0/man/rep.Rd --- r-bioc-biocgenerics-0.14.0/man/rep.Rd 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/rep.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -16,18 +16,16 @@ } \usage{ -## Unlike the standard rep.int() function defined in base (default method), -## the generic function described here have a '...' argument (instead of -## 'times'). -rep.int(x, ...) +rep.int(x, times) } \arguments{ \item{x}{ The object to replicate (typically vector-like). } - \item{...}{ - Additional arguments, for use in specific \code{rep.int} methods. + \item{times}{ + See \code{?base::\link[base]{rep.int}} for a description of + this argument. } } diff -Nru r-bioc-biocgenerics-0.14.0/man/sort.Rd r-bioc-biocgenerics-0.16.0/man/sort.Rd --- r-bioc-biocgenerics-0.14.0/man/sort.Rd 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/sort.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -38,7 +38,7 @@ } \note{ - TO DEVELOPPERS: + TO DEVELOPERS: See note in \code{?BiocGenerics::\link[BiocGenerics]{order}} about "stable" order. diff -Nru r-bioc-biocgenerics-0.14.0/man/subset.Rd r-bioc-biocgenerics-0.16.0/man/subset.Rd --- r-bioc-biocgenerics-0.14.0/man/subset.Rd 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/subset.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,69 @@ +\name{subset} + +\alias{subset} + +\title{Subsetting vector-like, matrix-like and data-frame-like objects} + +\description{ + Return subsets of vector-like, matrix-like or data-frame-like objects + which meet conditions. + + NOTE: This man page is for the \code{subset} \emph{S4 generic function} + defined in the \pkg{BiocGenerics} package. + See \code{?base::\link[base]{subset}} for the \code{subset} S3 generic + defined in the \pkg{base} package. +} + +\usage{ +subset(x, ...) +} + +\arguments{ + \item{x}{ + A vector-like, matrix-like or data-frame-like object to be subsetted. + } + \item{...}{ + Additional arguments (e.g. \code{subset}, \code{select}, \code{drop}), + for use in specific methods. See \code{?base::\link[base]{subset}} for + more information. + } +} + +\value{ + An object similar to \code{x} containing just the selected elements (for a + vector-like object), or the selected rows and columns (for a matrix-like or + data-frame-like object). +} + +\seealso{ + \itemize{ + \item \code{base::\link[base]{subset}} in the \pkg{base} package + for the \code{subset} S3 generic. + + \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[S4Vectors]{subset,DataTable-method} in the \pkg{S4Vectors} + package for an example of a specific \code{subset} method (defined + for \link[S4Vectors]{DataTable} objects). + + \item \link{BiocGenerics} for a summary of all the generics defined + in the \pkg{BiocGenerics} package. + } +} + +\examples{ +subset +showMethods("subset") +selectMethod("subset", "ANY") # the default method + +library(S4Vectors) +showMethods("subset") +selectMethod("subset", "DataTable") # the "subset" method for + # DataTable objects +} + +\keyword{methods} diff -Nru r-bioc-biocgenerics-0.14.0/man/testPackage.Rd r-bioc-biocgenerics-0.16.0/man/testPackage.Rd --- r-bioc-biocgenerics-0.14.0/man/testPackage.Rd 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/testPackage.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,79 @@ +\name{testPackage} + +\alias{testPackage} + +\title{Run RUnit package unit tests} + +\description{ + \code{testPackage} helps developers implement unit tests using the + \pkg{RUnit} testing conventions. +} + +\usage{ +testPackage(pkgname=NULL, subdir="unitTests", pattern="^test_.*\\\\.R$", + path=getwd()) +} + +\arguments{ + \item{pkgname}{ + The name of the package whose installed unit tests are to be run. A + missing or NULL value implies that the \code{testPackage} command + will look for tests within the package source directory indicated by + \code{path}. + } + \item{subdir}{ + A character(1) vector providing the subdirectory in which unit tests + are located. The directory is searched first in the (installed or + source) package root, or in a subdirectory \code{inst/} below the + root. + } + \item{pattern}{ + A character(1) regular expression describing the file names to be + evaluated; typically used to restrict tests to a subset of all test + files. + } + \item{path}{ + A character(1) directory path indicating, when \code{pkgname} is + missing or NULL, where unit tests will be searched. \code{path} can + be any location at or below the package root. + } +} + +\details{ + This function is not exported from the package namespace, and must be + invoked using triple colons, \code{BiocGenerics:::testPackage()}; it + is provided primarily for the convenience of developers. + + When invoked with missing or NULL \code{pkgname} argument, the + function assumes that it has been invoked from within the package + source tree (or that the source tree is located above \code{path}), + and finds unit tests in \code{subdir="unitTests"} in either the base + or \code{inst/} directories at the root of the package source + tree. This mode is useful when developing unit tests, since the + package does not have to be re-installed to run an updated test. + + When invoked with \code{pkgname} set to the name of an installed + package, unit tests are searched for in the installed package + directory. +} + +\value{ + The function returns the result of \code{RUnit::runTestSuite} invoked + on the unit tests specified in the function call. +} + +\seealso{ + \url{http://bioconductor.org/developers/how-to/unitTesting-guidelines/} +} + +\examples{ +## Run unit tests found in the library location where +## BiocGenerics is installed +BiocGenerics:::testPackage("BiocGenerics") +\dontrun{## Run unit tests for the package whose source tree implied +## by getwd() +BiocGenerics:::testPackage() +} +} + +\keyword{methods} diff -Nru r-bioc-biocgenerics-0.14.0/man/unsplit.Rd r-bioc-biocgenerics-0.16.0/man/unsplit.Rd --- r-bioc-biocgenerics-0.14.0/man/unsplit.Rd 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/man/unsplit.Rd 2015-10-13 20:31:17.000000000 +0000 @@ -18,7 +18,7 @@ } \usage{ -unsplit(x, recursive=TRUE, use.names=TRUE) +unsplit(value, f, drop=FALSE) } \arguments{ diff -Nru r-bioc-biocgenerics-0.14.0/NAMESPACE r-bioc-biocgenerics-0.16.0/NAMESPACE --- r-bioc-biocgenerics-0.14.0/NAMESPACE 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/NAMESPACE 2015-10-13 20:31:17.000000000 +0000 @@ -57,12 +57,18 @@ ## from R/get.R: get, mget, + ## from R/grepl.R: + grep, grepl, + ## from R/is.unsorted.R: is.unsorted, - + ## from R/lapply.R: lapply, sapply, + ## from R/lengths.R: + lengths, + ## from R/mapply.R: mapply, @@ -98,6 +104,9 @@ end, "end<-", width, "width<-", + ## from R/subset.R: + subset, + ## from R/table.R: table, @@ -134,6 +143,12 @@ ## from R/density.R: density, + ## from R/IQR.R: + IQR, + + ## from R/mad.R: + mad, + ## from R/residuals.R: residuals, @@ -166,6 +181,9 @@ ## from R/combine.R: combine, + ## from R/dbconn.R: + dbconn, dbfile, + ## from R/fileName.R: fileName, diff -Nru r-bioc-biocgenerics-0.14.0/R/dbconn.R r-bioc-biocgenerics-0.16.0/R/dbconn.R --- r-bioc-biocgenerics-0.14.0/R/dbconn.R 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/dbconn.R 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,8 @@ +### ========================================================================= +### The dbconn() and dbfile() generics +### ------------------------------------------------------------------------- +### + +setGeneric("dbconn", function(x) standardGeneric("dbconn")) + +setGeneric("dbfile", function(x) standardGeneric("dbfile")) diff -Nru r-bioc-biocgenerics-0.14.0/R/grep.R r-bioc-biocgenerics-0.16.0/R/grep.R --- r-bioc-biocgenerics-0.14.0/R/grep.R 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/grep.R 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,11 @@ +### ========================================================================= +### The grep() and grepl() generics +### ------------------------------------------------------------------------- +### +### Need to explicitly define those generics otherwise the implicit generics +### in package "base" would dispatch on all their arguments. Here we set +### dispatch on the first 2 args ('pattern', 'x'). + +setGeneric("grep", signature = c("pattern", "x")) + +setGeneric("grepl", signature = c("pattern", "x")) diff -Nru r-bioc-biocgenerics-0.14.0/R/IQR.R r-bioc-biocgenerics-0.16.0/R/IQR.R --- r-bioc-biocgenerics-0.14.0/R/IQR.R 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/IQR.R 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,6 @@ +### ========================================================================= +### The IQR() generic +### ------------------------------------------------------------------------- +### + +setGeneric("IQR", signature="x") diff -Nru r-bioc-biocgenerics-0.14.0/R/is.unsorted.R r-bioc-biocgenerics-0.16.0/R/is.unsorted.R --- r-bioc-biocgenerics-0.14.0/R/is.unsorted.R 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/is.unsorted.R 2015-10-13 20:31:17.000000000 +0000 @@ -2,7 +2,4 @@ ### The is.unsorted() generic ### ------------------------------------------------------------------------- -setGeneric("is.unsorted", - function(x, na.rm = FALSE, strictly = FALSE) - standardGeneric("is.unsorted"), - signature = "x") +setGeneric("is.unsorted", signature = "x") diff -Nru r-bioc-biocgenerics-0.14.0/R/lengths.R r-bioc-biocgenerics-0.16.0/R/lengths.R --- r-bioc-biocgenerics-0.14.0/R/lengths.R 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/lengths.R 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,10 @@ +### ========================================================================= +### The lengths() generic +### ------------------------------------------------------------------------- +### +### Need to explicitly define this generic otherwise the implicit generic in +### package "base" would dispatch on all its arguments. Here we set dispatch +### on the first arg ('x') only. + +setGeneric("lengths", signature="x") + diff -Nru r-bioc-biocgenerics-0.14.0/R/mad.R r-bioc-biocgenerics-0.16.0/R/mad.R --- r-bioc-biocgenerics-0.14.0/R/mad.R 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/mad.R 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,8 @@ +### ========================================================================= +### The mad() generic +### ------------------------------------------------------------------------- +### +### Dispatches only on 'x' +### + +setGeneric("mad", signature="x") diff -Nru r-bioc-biocgenerics-0.14.0/R/replaceSlots.R r-bioc-biocgenerics-0.16.0/R/replaceSlots.R --- r-bioc-biocgenerics-0.14.0/R/replaceSlots.R 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/replaceSlots.R 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,54 @@ +### ========================================================================= +### Efficient multiple slots replacement of an S4 object +### ------------------------------------------------------------------------- +### +### NOTE: The stuff in this file (not exported) doesn't really belong to +### BiocGenerics. +### +### TODO: This stuff would need to be moved to a more appropriate place (when +### we have one). + +unsafe_replaceSlots <- function(object, ..., .slotList = list()) { + valid_argnames <- slotNames(object) + args <- extraArgsAsList(valid_argnames, ...) + firstTime <- TRUE + listUpdate <- function(object, l) { + for (nm in names(l)) { + ## Too risky! identical() is not reliable enough e.g. with objects + ## that contain external pointers. For example, DNAStringSet("A") and + ## DNAStringSet("T") are considered to be identical! identical() needs + ## to be fixed first. + ##if (identical(slot(object, nm), l[[nm]])) + ## next + if (firstTime) { + ## Triggers a copy. + slot(object, nm, check=FALSE) <- l[[nm]] + firstTime <<- FALSE + } else { + ## In-place modification (i.e. no copy). + `slot<-`(object, nm, check=FALSE, l[[nm]]) + } + } + object + } + listUpdate(listUpdate(object, args), .slotList) +} + +### 'replaceSlots' is essentially a more efficient initialize for (value) S4 +### objects. +replaceSlots <- function(object, ..., check = TRUE) { + if (!isTRUEorFALSE(check)) + stop("'check' must be TRUE or FALSE") + object <- unsafe_replaceSlots(object, ...) + if (check) { + validObject(object) + } + object +} + +updateS4 <- function(...) +{ + .Deprecated("replaceSlots") + replaceSlots(...) +} + diff -Nru r-bioc-biocgenerics-0.14.0/R/rep.R r-bioc-biocgenerics-0.16.0/R/rep.R --- r-bioc-biocgenerics-0.14.0/R/rep.R 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/rep.R 2015-10-13 20:31:17.000000000 +0000 @@ -1,39 +1,6 @@ ### ========================================================================= -### The rep() and rep.int() generics +### The rep.int() generic ### ------------------------------------------------------------------------- -### Actually, rep() seems to be already a generic function (that's what the -### man page claims) but the reality is confusing. On a fresh R session (this -### is with R-2.14.0): -### -### > isGeneric("rep") -### [1] FALSE -### > showMethods("rep") -### Function: rep (package base) -### -### > isGeneric("rep") -### [1] TRUE -### -#setGeneric("rep") - -### A more natural (and cleaner) thing to do for this generic would be to -### use the same arguments as base::rep.int() (i.e. 'x', 'times') but then -### 'R CMD check' would get confused and think that we are trying to define -### an S3 method for base::rep and would complain (observed with R <= 2.12): -### -### * checking S3 generic/method consistency ... WARNING -### rep: -### function(x, ...) -### rep.int: -### function(x, times) -### -### so we use the arguments of base::rep() (i.e. 'x', '...') just to make -### 'R CMD check' happy :-) ... Kind of an ugly/silly hack though :-( - -.rep.int.useAsDefault <- function(x, ...) base::rep.int(x, ...) - -setGeneric("rep.int", - function(x, ...) standardGeneric("rep.int"), - useAsDefault=.rep.int.useAsDefault -) +setGeneric("rep.int") diff -Nru r-bioc-biocgenerics-0.14.0/R/show-utils.R r-bioc-biocgenerics-0.16.0/R/show-utils.R --- r-bioc-biocgenerics-0.14.0/R/show-utils.R 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/show-utils.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -### ========================================================================= -### Utilities for showing object components in a systematic way -### ------------------------------------------------------------------------- -### - -labeledLine <- - function(label, els, count = TRUE, labelSep = ":", sep = " ", ellipsis = "...", - ellipsisPos = c("middle", "end", "start")) -{ - if (count && !is.null(els)) - label <- paste(label, "(", length(els), ")", sep = "") - label <- paste(label, labelSep, sep, sep = "") - width <- getOption("width") - nchar(label) - line <- ellipsize(els, width, sep, ellipsis, ellipsisPos) - paste(label, line, "\n", sep = "") -} - -ellipsize <- - function(obj, width = getOption("width"), sep = " ", ellipsis = "...", - pos = c("middle", "end", "start")) -{ - pos <- match.arg(pos) - if (is.null(obj)) - obj <- "NULL" - if (is.factor(obj)) - obj <- as.character(obj) - ## get order selectSome() would print - if (pos == "middle") { - if (length(obj) > 2 * width) - obj <- c(head(obj, width), tail(obj, width)) - half <- seq_len(ceiling(length(obj) / 2L)) - ind <- as.vector(rbind(half, length(obj) - half + 1L)) - } else if (pos == "end") { - obj <- head(obj, width) - ind <- seq_len(length(obj)) - } else { - obj <- tail(obj, width) - ind <- rev(seq_len(length(obj))) - } - str <- encodeString(obj) - nc <- cumsum(nchar(str[ind]) + nchar(sep)) - nchar(sep) - last <- findInterval(width, nc) - if (length(obj) > last) { - ## make sure ellipsis fits - while (last && - (nc[last] + nchar(sep)*2^(last>1) + nchar(ellipsis)) > width) - last <- last - 1L - if (last == 0) { ## have to truncate the first/last element - if (pos == "start") { - str <- - paste(ellipsis, - substring(tail(str, 1L), - nchar(tail(str, 1L))-(width-nchar(ellipsis))+1L, - nchar(ellipsis)), - sep = "") - } else { - str <- - paste(substring(str[1L], 1, width - nchar(ellipsis)), ellipsis, - sep = "") - } - } - else if (last == 1) { ## can only show the first/last - if (pos == "start") - str <- c(ellipsis, tail(str, 1L)) - else str <- c(str[1L], ellipsis) - } - else { - str <- selectSome(str, last + 1L, ellipsis, pos) - } - } - paste(str, collapse = sep) -} - -## taken directly from Biobase, then added 'ellipsisPos' argument -selectSome <- function(obj, maxToShow = 5, ellipsis = "...", - ellipsisPos = c("middle", "end", "start"), quote=FALSE) -{ - if(is.character(obj) && quote) - obj <- sQuote(obj) - ellipsisPos <- match.arg(ellipsisPos) - len <- length(obj) - if (maxToShow < 3) - maxToShow <- 3 - if (len > maxToShow) { - maxToShow <- maxToShow - 1 - if (ellipsisPos == "end") { - c(head(obj, maxToShow), ellipsis) - } else if (ellipsisPos == "start") { - c(ellipsis, tail(obj, maxToShow)) - } else { - bot <- ceiling(maxToShow/2) - top <- len - (maxToShow - bot - 1) - nms <- obj[c(1:bot, top:len)] - c(as.character(nms[1:bot]), ellipsis, as.character(nms[-c(1:bot)])) - } - } else { - obj - } -} diff -Nru r-bioc-biocgenerics-0.14.0/R/subset.R r-bioc-biocgenerics-0.16.0/R/subset.R --- r-bioc-biocgenerics-0.14.0/R/subset.R 1970-01-01 00:00:00.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/subset.R 2015-10-13 20:31:17.000000000 +0000 @@ -0,0 +1,8 @@ +### ========================================================================= +### The subset() generic +### ------------------------------------------------------------------------- +### +### base::subset is an S3 generic. + +setGeneric("subset") + diff -Nru r-bioc-biocgenerics-0.14.0/R/testPackage.R r-bioc-biocgenerics-0.16.0/R/testPackage.R --- r-bioc-biocgenerics-0.14.0/R/testPackage.R 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/testPackage.R 2015-10-13 20:31:17.000000000 +0000 @@ -1,6 +1,33 @@ -### +### -testPackage <- function(pkgname, subdir="unitTests", pattern="^test_.*\\.R$") +packageRoot <- function(path) +{ + hasDescription <- function(path) { + file.exists(file.path(path, "DESCRIPTION")) + } + isRoot <- function(path) { + identical(path, dirname(path)) + } + while (!hasDescription(path) && !isRoot(path)) { + path <- dirname(path) + } + if (isRoot(path)) { + NULL + } else { + path + } +} + +packageInfo <- function(path) +{ + as.data.frame(read.dcf(file.path(path, "DESCRIPTION")), + stringsAsFactors=FALSE) +} + +testPackage <- function(pkgname = NULL, + subdir="unitTests", + pattern="^test_.*\\.R$", + path = getwd()) { .failure_details <- function(result) { res <- result[[1L]] @@ -14,17 +41,38 @@ } else list() } - require(pkgname, quietly=TRUE, character.only=TRUE) || - stop("package '", pkgname, "' not found") - dir <- system.file(subdir, package=pkgname) - if (nchar(dir) == 0L) - stop("unable to find unit tests, no '", subdir, "' dir") - require("RUnit", quietly=TRUE) || stop("RUnit package not found") + if (is.null(pkgname)) { + root <- packageRoot(path) + if (is.null(root)) + stop("could not infer package root directory") + + pkgname0 <- packageInfo(root)$Package + if (is.null(pkgname)) { + pkgname <- pkgname0 + } else if (!identical(pkgname, pkgname0)) { + stop("'pkgname' and inferred DESCRIPTION 'Package' differ") + } + } else { + root <- system.file(package=pkgname) + } + + library(pkgname, character.only = TRUE, quietly=TRUE) + + dir <- file.path(root, subdir) + if (!file.exists(dir)) { # try inst/subdir + dir <- file.path(root, "inst", subdir) + } + if (!file.exists(dir)) { + stop("unable to find unit tests, no subdir ", sQuote(subdir)) + } + + library("RUnit", quietly=TRUE) RUnit_opts <- getOption("RUnit", list()) RUnit_opts$verbose <- 0L RUnit_opts$silent <- TRUE RUnit_opts$verbose_fail_msg <- TRUE - options(RUnit = RUnit_opts) + oopt <- options(RUnit = RUnit_opts) + on.exit(options(oopt)) suite <- RUnit::defineTestSuite(name=paste(pkgname, "RUnit Tests"), dirs=dir, testFileRegexp=pattern, @@ -33,7 +81,7 @@ result <- RUnit::runTestSuite(suite) cat("\n\n") RUnit::printTextProtocol(result, showDetails=FALSE) - if (length(details <- .failure_details(result)) >0) { + if (length(details <- .failure_details(result)) > 0) { cat("\nTest files with failing tests\n") for (i in seq_along(details)) { cat("\n ", basename(names(details)[[i]]), "\n") @@ -46,4 +94,3 @@ } result } - diff -Nru r-bioc-biocgenerics-0.14.0/R/update-utils.R r-bioc-biocgenerics-0.16.0/R/update-utils.R --- r-bioc-biocgenerics-0.14.0/R/update-utils.R 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/R/update-utils.R 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -### ========================================================================= -### Efficient update behavior for S4 objects -### ------------------------------------------------------------------------- -### -### NOTE: The stuff in this file (not exported) doesn't really belong to -### BiocGenerics. -### -### TODO: This stuff would need to be moved to a more appropriate place (when -### we have one). - -unsafe_updateS4 <- function(object, ..., .slotList = list()) { - valid_argnames <- slotNames(object) - args <- extraArgsAsList(valid_argnames, ...) - firstTime <- TRUE - listUpdate <- function(object, l) { - for (nm in names(l)) { - ## Too risky! identical() is not reliable enough e.g. with objects - ## that contain external pointers. For example, DNAStringSet("A") and - ## DNAStringSet("T") are considered to be identical! identical() needs - ## to be fixed first. - ##if (identical(slot(object, nm), l[[nm]])) - ## next - if (firstTime) { - ## Triggers a copy. - slot(object, nm, check=FALSE) <- l[[nm]] - firstTime <<- FALSE - } else { - ## In-place modification (i.e. no copy). - `slot<-`(object, nm, check=FALSE, l[[nm]]) - } - } - object - } - listUpdate(listUpdate(object, args), .slotList) -} - -### 'updateS4' is essentially a more efficient initialize for (value) S4 -### objects. -updateS4 <- function(object, ..., check = TRUE) { - if (!isTRUEorFALSE(check)) - stop("'check' must be TRUE or FALSE") - object <- unsafe_updateS4(object, ...) - if (check) { - validObject(object) - } - object -} diff -Nru r-bioc-biocgenerics-0.14.0/TODO r-bioc-biocgenerics-0.16.0/TODO --- r-bioc-biocgenerics-0.14.0/TODO 2015-04-16 20:12:27.000000000 +0000 +++ r-bioc-biocgenerics-0.16.0/TODO 2015-10-13 20:31:17.000000000 +0000 @@ -3,8 +3,6 @@ made generics by the IRanges package): From package base: - - is.unsorted(): implicit generic dispatches on (x, na.rm, strictly). - Explicit generic should dispatch on (x) only. - split(): implicit generic dispatches on (x, f, drop). Explicit generic should dispatch on (x, f) only. - which(): implicit generic dispatches on (x, arr.ind, useNames). @@ -45,6 +43,4 @@ - runmed(): implicit generic dispatches on (x, k, endrule, algorithm, print.level). Explicit generic should dispatch on (x) only. -o Move all the generics for count datasets defined in Biobase (and used by the - DESeq and DEXSeq packages) to BiocGenerics.