ProtGenerics/DESCRIPTION0000644000175400017540000000074413175740233015724 0ustar00biocbuildbiocbuildPackage: ProtGenerics Title: S4 generic functions for Bioconductor proteomics infrastructure Description: S4 generic functions needed by Bioconductor proteomics packages. Version: 1.10.0 Author: Laurent Gatto Maintainer: Laurent Gatto biocViews: Infrastructure, Proteomics, MassSpectrometry URL: https://github.com/lgatto/ProtGenerics Depends: methods License: Artistic-2.0 NeedsCompilation: no Packaged: 2017-10-31 00:15:23 UTC; biocbuild ProtGenerics/NAMESPACE0000644000175400017540000000053313175714715015437 0ustar00biocbuildbiocbuildimport(methods) export(psms, peaks, modifications, database, rtime, tic, spectra, intensity, mz, "mz<-", peptides, proteins, accessions, scans, mass, ions, chromatograms, chromatogram, isCentroided, writeMSData ) ProtGenerics/NEWS0000644000175400017540000000272413175714715014723 0ustar00biocbuildbiocbuildCHANGES IN VERSION 1.9.1 ------------------------ o add writeMSData <2017-09-20 Wed> CHANGES IN VERSION 1.5.1 ------------------------ o added isCentroided generic <2016-07-23 Sat> CHANGES IN VERSION 1.5.0 ------------------------ o Version bump Bioc devel CHANGES IN VERSION 1.4.0 ------------------------ o Version bump Bioc 3.3 CHANGES IN VERSION 1.3.3 ------------------------ o exporting mz<- generic <2015-10-19 Mon> CHANGES IN VERSION 1.3.2 ------------------------ o Not depending on BiocGenerics <2015-10-16 Fri> CHANGES IN VERSION 1.3.1 ------------------------ o added chomatogram generic (previously defined in MSnbase) <2015-10-15 Thu> CHANGES IN VERSION 1.3.0 ------------------------ o Bioc release 3.3 CHANGES IN VERSION 1.2.0 ------------------------ o Bioc release 3.2 CHANGES IN VERSION 1.1.1 ------------------------ o new mz<- generic function <2015-10-01 Thu> CHANGES IN VERSION 1.1.0 ------------------------ o Bioc devel version 3.2 CHANGES IN VERSION 1.0.0 ------------------------ o Bioc release version 3.1 CHANGES IN VERSION 0.99.3 ------------------------- o update man with when and why ProtGenerics [2015-03-16 Mon] CHANGES IN VERSION 0.99.2 ------------------------- o updating DESCRIPTION as with BiocContributions::clean [2015-03-03 Tue] CHANGES IN VERSION 0.99.1 ------------------------- o Adding NEWS file [2015-02-27 Fri] CHANGES IN VERSION 0.99.0 ------------------------- o adding ProtGenerics to Manifest ProtGenerics/R/0000755000175400017540000000000013175714715014420 5ustar00biocbuildbiocbuildProtGenerics/R/protgenerics.R0000644000175400017540000000274213175714715017254 0ustar00biocbuildbiocbuild## from mzR setGeneric("psms", function(object, ...) standardGeneric("psms")) setGeneric("peaks", function(object, ...) standardGeneric("peaks")) setGeneric("modifications", function(object, ...) standardGeneric("modifications")) setGeneric("database", function(object, ...) standardGeneric("database")) ## from MSnbase setGeneric("rtime", function(object, ...) standardGeneric("rtime")) setGeneric("tic", function(object, ...) standardGeneric("tic")) setGeneric("spectra", function(object, ...) standardGeneric("spectra")) setGeneric("intensity", function(object, ...) standardGeneric("intensity")) setGeneric("mz", function(object, ...) standardGeneric("mz")) ## new setGeneric("peptides", function(object, ...) standardGeneric("peptides")) setGeneric("proteins", function(object, ...) standardGeneric("proteins")) setGeneric("accessions", function(object, ...) standardGeneric("accessions")) setGeneric("scans", function(object, ...) standardGeneric("scans")) setGeneric("mass", function(object, ...) standardGeneric("mass")) setGeneric("ions", function(object, ...) standardGeneric("ions")) setGeneric("chromatograms", function(object, ...) standardGeneric("chromatograms")) setGeneric("chromatogram", function(object, ...) standardGeneric("chromatogram")) setGeneric("mz<-", function(object, value) standardGeneric("mz<-")) setGeneric("isCentroided", function(object, ...) standardGeneric("isCentroided")) setGeneric("writeMSData", function(object, file, ...) standardGeneric("writeMSData")) ProtGenerics/README.md0000644000175400017540000001110613175714715015475 0ustar00biocbuildbiocbuild # S4 generic functions for Bioconductor proteomics infrastructure ## Description: These generic functions provide basic interfaces to operations on and data access to proteomics and mass spectrometry infrastructure in the Bioconductor project. For the details, please consult the respective methods' manual pages. ## Usage: ```r psms(object, ...) peaks(object, ...) modifications(object, ...) database(object, ...) rtime(object, ...) tic(object, ...) spectra(object, ...) intensity(object, ...) mz(object, ...) peptides(object, ...) proteins(object, ...) accessions(object, ...) scans(object, ...) mass(object, ...) ions(object, ...) chromatograms(object, ...) chromatogram(object, ...) isCentroided(object, ...) ``` ## Arguments: - `object`: Object of class for which methods are defined. - `...`: Further arguments, possibly used by downstream methods. ## Details: ### When should one define a generics?: Generics are appropriate for functions that have _generic_ names, i.e. names that occur in multiple circumstances, (with different input classes, most often defined in different packages) or, when (multiple) dispatching is better handled by the generics mechanism rather than the developer. The dispatching mechanism will then automatically call the appropriate method and save the user from explicitly calling `package::method` or the developer to handle the multiple input types cases. When no such conflict exists or is unlikely to happen (for example when the name of the function is specific to a package or domain, or for class slots accessors and replacement methods), the usage of a generic is arguably questionable, and in most of these cases, simple, straightforward functions would be perfectly valid. ### When to define a generic in `ProtGenerics`?: `ProtGenerics` is not meant to be the central package for generics, nor should it stop developers from defining the generics they need. It is a means to centralise generics that are defined in different packages (for example `mzR::psms` and `mzID::psms`, or `IRanges::score` and `mzR::score`, now `BioGenerics::score`) or generics that live in a rather big package (say `mzR`) on which one wouldn't want to depend just for the sake of that generics' definition. The goal of `ProtGenerics` is to step in when namespace conflicts arise so as to to facilitate inter-operability of packages. In case such conflict appears due to multiple generics, we would (1) add these same definitions in `ProtGenerics`, (2) remove the definitions from the packages they stem from, which then (3) only need to import `ProtGenerics`. This would be very minor/straightforward changes for the developers and would resolve issues when they arise. More generics can be added on request by opening an issue or sending a pull request on: [https://github.com/lgatto/ProtGenerics](https://github.com/lgatto/ProtGenerics) ## Author(s): Laurent Gatto ## See Also: - The `BiocGenerics` package for S4 generic functions needed by many Bioconductor packages. - `showMethods` for displaying a summary of the methods defined for a given generic function. - `selectMethod` for getting the definition of a specific method. - `setGeneric` and `setMethod` for defining generics and methods. ## Examples: ```r library("ProtGenerics") ## List all the symbols defined in this package: ls('package:ProtGenerics') ## [1] "accessions" "chromatogram" "chromatograms" "database" ## [5] "intensity" "ions" "mass" "modifications" ## [9] "mz" "mz<-" "peaks" "peptides" ## [13] "proteins" "psms" "rtime" "scans" ## [17] "spectra" "tic" library("mzR") ## Loading required package: Rcpp ## What methods exists for 'peaks' showMethods("peaks") ## Function: peaks (package ProtGenerics) ## object="mzRnetCDF" ## object="mzRpwiz" ## object="mzRramp" ## To look at one method in particular getMethod("peaks", "mzRpwiz") ## Method Definition: ## ## function (object, ...) ## { ## .local <- function (object, scans) ## { ## if (missing(scans)) ## scans <- 1:length(object) ## if (length(scans) == 1) { ## return(object@backend$getPeakList(scans)$peaks) ## } ## else { ## return(sapply(scans, function(x) object@backend$getPeakList(x)$peaks, ## simplify = FALSE)) ## } ## } ## .local(object, ...) ## } ## ## ## Signatures: ## object ## target "mzRpwiz" ## defined "mzRpwiz" ``` ProtGenerics/man/0000755000175400017540000000000013175714715014772 5ustar00biocbuildbiocbuildProtGenerics/man/protgenerics.Rd0000644000175400017540000001053613175714715017772 0ustar00biocbuildbiocbuild\name{ProtGenerics} \alias{ProtGenerics-package} \alias{ProtGenerics} \alias{psms} \alias{peaks} \alias{modifications} \alias{database} \alias{rtime} \alias{tic} \alias{spectra} \alias{intensity} \alias{mz} \alias{mz<-} \alias{peptides} \alias{proteins} \alias{accessions} \alias{scans} \alias{mass} \alias{ions} \alias{chromatograms} \alias{chromatogram} \alias{isCentroided} \alias{writeMSData} \title{ S4 generic functions for Bioconductor proteomics infrastructure } \description{ These generic functions provide basic interfaces to operations on and data access to proteomics and mass spectrometry infrastructure in the Bioconductor project. For the details, please consult the respective methods' manual pages. } \details{ \subsection{When should one define a generics?}{ Generics are appropriate for functions that have \emph{generic} names, i.e. names that occur in multiple circumstances, (with different input classes, most often defined in different packages) or, when (multiple) dispatching is better handled by the generics mechanism rather than the developer. The dispatching mechanism will then automatically call the appropriate method and save the user from explicitly calling \code{package::method} or the developer to handle the multiple input types cases. When no such conflict exists or is unlikely to happen (for example when the name of the function is specific to a package or domain, or for class slots accessors and replacement methods), the usage of a generic is arguably questionable, and in most of these cases, simple, straightforward functions would be perfectly valid. } \subsection{When to define a generic in \code{ProtGenerics}?}{ \code{ProtGenerics} is not meant to be the central package for generics, nor should it stop developers from defining the generics they need. It is a means to centralise generics that are defined in different packages (for example \code{mzR::psms} and \code{mzID::psms}, or \code{IRanges::score} and \code{mzR::score}, now \code{BioGenerics::score}) or generics that live in a rather big package (say \code{mzR}) on which one wouldn't want to depend just for the sake of that generics' definition. The goal of \code{ProtGenerics} is to step in when namespace conflicts arise so as to to facilitate inter-operability of packages. In case such conflict appears due to multiple generics, we would (1) add these same definitions in \code{ProtGenerics}, (2) remove the definitions from the packages they stem from, which then (3) only need to import \code{ProtGenerics}. This would be very minor/straightforward changes for the developers and would resolve issues when they arise. More generics can be added on request by opening an issue or sending a pull request on: \url{https://github.com/lgatto/ProtGenerics} } } \usage{ psms(object, ...) peaks(object, ...) modifications(object, ...) database(object, ...) rtime(object, ...) tic(object, ...) spectra(object, ...) intensity(object, ...) mz(object, ...) peptides(object, ...) proteins(object, ...) accessions(object, ...) scans(object, ...) mass(object, ...) ions(object, ...) chromatograms(object, ...) chromatogram(object, ...) isCentroided(object, ...) writeMSData(object, file, ...) } \arguments{ \item{object}{Object of class for which methods are defined. } \item{file}{for \code{writeMSData}}: the name of the file to which the data should be exported. \item{\dots}{Further arguments, possibly used by downstream methods. } } \seealso{ \itemize{ \item The \pkg{BiocGenerics} package for S4 generic functions needed by many Bioconductor packages. \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 \code{\link[methods]{setGeneric}} and \code{\link[methods]{setMethod}} for defining generics and methods. } } \author{ Laurent Gatto } \examples{ ## List all the symbols defined in this package: ls('package:ProtGenerics') \dontrun{ ## What methods exists for 'peaks' showMethods("peaks") ## To look at one method in particular getMethod("peaks", "mzRpwiz") } } \keyword{methods}