ProtGenerics/DESCRIPTION0000644000175400017540000000123713556162421015722 0ustar00biocbuildbiocbuildPackage: ProtGenerics Title: S4 generic functions for Bioconductor proteomics infrastructure Description: S4 generic functions needed by Bioconductor proteomics packages. Version: 1.18.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 git_url: https://git.bioconductor.org/packages/ProtGenerics git_branch: RELEASE_3_10 git_last_commit: ff9705b git_last_commit_date: 2019-10-29 Date/Publication: 2019-10-29 Packaged: 2019-10-30 01:19:13 UTC; biocbuild ProtGenerics/NAMESPACE0000644000175400017540000000006013556120145015421 0ustar00biocbuildbiocbuildimport(methods) exportPattern("^[[:alpha:]]+") ProtGenerics/NEWS0000644000175400017540000000356613556120145014717 0ustar00biocbuildbiocbuildCHANGES IN VERSION 1.17.4 ------------------------- o New generics needed in Spectra and Chromatograms packages <2019-08-20 Tue> CHANGES IN VERSION 1.17.3 ------------------------- o New tolerance generic <2019-08-16 Fri> CHANGES IN VERSION 1.17.2 ------------------------- o New generics (see issue #8) <2019-05-12 Sun> CHANGES IN VERSION 1.17.1 ------------------------- o Move many generics from MSnbase <2019-05-11 Sat> CHANGES 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/0000755000175400017540000000000013556120145014407 5ustar00biocbuildbiocbuildProtGenerics/R/protgenerics.R0000644000175400017540000002123313556120145017237 0ustar00biocbuildbiocbuild## ------------------------------------------------------------- ## Data slots ## ------------------------------------------------------------- setGeneric("processingData", function(object, ...) standardGeneric("processingData")) setGeneric("processingData<-", function(object, ..., value) standardGeneric("processingData<-")) setGeneric("spectraVariables", function(object, ...) standardGeneric("spectraVariables")) setGeneric("spectraNames", function(object, ...) standardGeneric("spectraNames")) setGeneric("spectraNames<-", function(object, ..., value) standardGeneric("spectraNames<-")) setGeneric("spectraData", function(object, ...) standardGeneric("spectraData")) setGeneric("spectraData<-", function(object, ..., value) standardGeneric("spectraData<-")) setGeneric("dataOrigin", function(object, ...) standardGeneric("dataOrigin")) setGeneric("dataOrigin<-", function(object, value) standardGeneric("dataOrigin<-")) setGeneric("dataStorage", function(object, ...) standardGeneric("dataStorage")) setGeneric("dataStorage<-", function(object, value) standardGeneric("dataStorage<-")) ## ------------------------------------------------------------- ## Metadata ## ------------------------------------------------------------- setGeneric("ionCount", function(object, ...) standardGeneric("ionCount")) setGeneric("scanIndex", function(object, ...) standardGeneric("scanIndex")) setGeneric("precursorMz", function(object, ...) standardGeneric("precursorMz")) setGeneric("precursorMz<-", function(object, ..., value) standardGeneric("precursorMz<-")) setGeneric("precursorIntensity", function(object, ...) standardGeneric("precursorIntensity")) setGeneric("precursorIntensity<-", function(object, ..., value) standardGeneric("precursorIntensity<-")) setGeneric("precursorCharge", function(object, ...) standardGeneric("precursorCharge")) setGeneric("precursorCharge<-", function(object, ..., value) standardGeneric("precursorCharge<-")) setGeneric("acquisitionNum", function(object, ...) standardGeneric("acquisitionNum")) setGeneric("precAcquisitionNum", function(object, ...) standardGeneric("precAcquisitionNum")) setGeneric("precScanNum", function(object, ...) standardGeneric("precScanNum")) setGeneric("msLevel", function(object, ...) standardGeneric("msLevel")) setGeneric("msLevel<-", function(object, ..., value) standardGeneric("msLevel<-")) setGeneric("collisionEnergy", function(object, ...) standardGeneric("collisionEnergy")) setGeneric("collisionEnergy<-", function(object, ..., value) standardGeneric("collisionEnergy<-")) setGeneric("polarity", function(object, ...) standardGeneric("polarity")) setGeneric("polarity<-", function(object, ..., value) standardGeneric("polarity<-")) setGeneric("tic", function(object, ...) standardGeneric("tic")) setGeneric("rtime", function(object, ...) standardGeneric("rtime")) setGeneric("rtime<-", function(object, ..., value) standardGeneric("rtime<-")) setGeneric("centroided", function(object, ...) standardGeneric("centroided")) setGeneric("centroided<-", function(object, ..., value) standardGeneric("centroided<-")) setGeneric("smoothed", function(object) standardGeneric("smoothed")) setGeneric("smoothed<-", function(object, ..., value) standardGeneric("smoothed<-")) setGeneric("isCentroided", function(object, ...) standardGeneric("isCentroided")) setGeneric("isolationWindowTargetMz", function(object, ...) standardGeneric("isolationWindowTargetMz")) setGeneric("isolationWindowTargetMz<-", function(object, ..., value) standardGeneric("isolationWindowTargetMz<-")) setGeneric("isolationWindowLowerMz", function(object, ...) standardGeneric("isolationWindowLowerMz")) setGeneric("isolationWindowLowerMz<-", function(object, ..., value) standardGeneric("isolationWindowLowerMz<-")) setGeneric("isolationWindowUpperMz", function(object, ...) standardGeneric("isolationWindowUpperMz")) setGeneric("isolationWindowUpperMz<-", function(object, ..., value) standardGeneric("isolationWindowUpperMz<-")) setGeneric("productMz", function(object, ...) standardGeneric("productMz")) setGeneric("productMz<-", function(object, ..., value) standardGeneric("productMz<-")) ## ------------------------------------------------------------- ## Raw data ## ------------------------------------------------------------- setGeneric("peaks", function(object, ...) standardGeneric("peaks")) setGeneric("peaks<-", function(object, ..., value) standardGeneric("peaks<-")) setGeneric("intensity", function(object, ...) standardGeneric("intensity")) setGeneric("intensity<-", function(object, ..., value) standardGeneric("intensity<-")) setGeneric("mz", function(object, ...) standardGeneric("mz")) setGeneric("mz<-", function(object, ..., value) standardGeneric("mz<-")) setGeneric("spectra", function(object, ...) standardGeneric("spectra")) setGeneric("spectra<-", function(object, ..., value) standardGeneric("spectra<-")) setGeneric("scans", function(object, ...) standardGeneric("scans")) setGeneric("chromatograms", function(object, ...) standardGeneric("chromatograms")) setGeneric("chromatogram", function(object, ...) standardGeneric("chromatogram")) setGeneric("mass", function(object, ...) standardGeneric("mass")) setGeneric("ions", function(object, ...) standardGeneric("ions")) ## ------------------------------------------------------------- ## Identification ## ------------------------------------------------------------- setGeneric("modifications", function(object, ...) standardGeneric("modifications")) setGeneric("database", function(object, ...) standardGeneric("database")) setGeneric("psms", function(object, ...) standardGeneric("psms")) setGeneric("peptides", function(object, ...) standardGeneric("peptides")) setGeneric("proteins", function(object, ...) standardGeneric("proteins")) setGeneric("accessions", function(object, ...) standardGeneric("accessions")) setGeneric("tolerance", function(object, ...) standardGeneric("tolerance")) ## ------------------------------------------------------------- ## Instrument ## ------------------------------------------------------------- setGeneric("msInfo", function(object) standardGeneric("msInfo")) setGeneric("expemail", function(object) standardGeneric("expemail")) setGeneric("exptitle", function(object) standardGeneric("exptitle")) setGeneric("ionSource", function(object) standardGeneric("ionSource")) setGeneric("ionSourceDetails", function(object) standardGeneric("ionSourceDetails")) setGeneric("analyser", function(object) standardGeneric("analyser")) setGeneric("analyzer", function(object) standardGeneric("analyzer")) setGeneric("analyzerDetails", function(object) standardGeneric("analyzerDetails")) setGeneric("analyserDetails", function(object) standardGeneric("analyserDetails")) setGeneric("detectorType", function(object) standardGeneric("detectorType")) setGeneric("instrumentManufacturer", function(object) standardGeneric("instrumentManufacturer")) setGeneric("instrumentCustomisations", function(object) standardGeneric("instrumentCustomisations")) setGeneric("instrumentModel", function(object) standardGeneric("instrumentModel")) ## ------------------------------------------------------------- ## Data-processing ## ------------------------------------------------------------- setGeneric("smooth", function(x, ...) standardGeneric("smooth")) ## stats::smooth already exists setGeneric("combineFeatures", function(object, ...) standardGeneric("combineFeatures")) ## ------------------------------------------------------------- ## IO ## ------------------------------------------------------------- setGeneric("writeMSData", function(object, file, ...) standardGeneric("writeMSData")) ## ------------------------------------------------------------- ## Filtering ## ------------------------------------------------------------- setGeneric("filterAcquisitionNum", function(object, ...) standardGeneric("filterAcquisitionNum")) setGeneric("filterDataOrigin", function(object, ...) standardGeneric("filterDataOrigin")) setGeneric("filterDataStorage", function(object, ...) standardGeneric("filterDataStorage")) setGeneric("filterEmptySpectra", function(object, ...) standardGeneric("filterEmptySpectra")) setGeneric("filterIsolationWindow", function(object, ...) standardGeneric("filterIsolationWindow")) setGeneric("filterMsLevel", function(object, ...) standardGeneric("filterMsLevel")) setGeneric("filterPolarity", function(object, ...) standardGeneric("filterPolarity")) setGeneric("filterPrecursorMz", function(object, ...) standardGeneric("filterPrecursorMz")) setGeneric("filterProductMz", function(object, ...) standardGeneric("filterProductMz")) setGeneric("filterPrecursorScan", function(object, ...) standardGeneric("filterPrecursorScan")) setGeneric("filterRt", function(object, ...) standardGeneric("filterRt")) setGeneric("filterMz", function(object, ...) standardGeneric("filterMz")) ProtGenerics/README.md0000644000175400017540000001110613556120145015464 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/0000755000175400017540000000000013556120145014761 5ustar00biocbuildbiocbuildProtGenerics/man/protgenerics.Rd0000644000175400017540000001367713556120145017772 0ustar00biocbuildbiocbuild\name{ProtGenerics} \alias{ProtGenerics-package} \alias{ProtGenerics} \alias{psms} \alias{peaks} \alias{peaks<-} \alias{modifications} \alias{database} \alias{rtime} \alias{tic} \alias{spectra} \alias{spectra<-} \alias{ionCount} \alias{scanIndex} \alias{precursorMz} \alias{precursorIntensity} \alias{precursorCharge} \alias{precursorCharge<-} \alias{acquisitionNum} \alias{precAcquisitionNum} \alias{precScanNum} \alias{msLevel} \alias{collisionEnergy} \alias{polarity} \alias{intensity} \alias{mz} \alias{mz<-} \alias{combineFeatures} \alias{processingData} \alias{processingData<-} \alias{msInfo} \alias{expemail} \alias{exptitle} \alias{ionSource} \alias{ionSourceDetails} \alias{analyser} \alias{analyzer} \alias{analyzerDetails} \alias{analyserDetails} \alias{detectorType} \alias{instrumentManufacturer} \alias{instrumentCustomisations} \alias{smooth} \alias{centroided} \alias{centroided<-} \alias{smoothed} \alias{smoothed<-} \alias{instrumentModel} \alias{peptides} \alias{proteins} \alias{accessions} \alias{scans} \alias{mass} \alias{ions} \alias{chromatograms} \alias{chromatogram} \alias{isCentroided} \alias{writeMSData} \alias{isolationWindowTargetMz} \alias{isolationWindowTargetMz<-} \alias{isolationWindowLowerMz} \alias{isolationWindowLowerMz<-} \alias{isolationWindowUpperMz} \alias{isolationWindowUpperMz<-} \alias{intensity<-} \alias{precursorMz<-} \alias{precursorIntensity<-} \alias{msLevel<-} \alias{collisionEnergy<-} \alias{polarity<-} \alias{rtime<-} \alias{spectraNames} \alias{spectraNames<-} \alias{spectraData} \alias{spectraData<-} \alias{spectraVariables} \alias{dataOrigin} \alias{dataOrigin<-} \alias{dataStorage} \alias{dataStorage<-} \alias{productMz} \alias{productMz<-} \alias{filterAcquisitionNum} \alias{filterDataOrigin} \alias{filterDataStorage} \alias{filterEmptySpectra} \alias{filterIsolationWindow} \alias{filterMsLevel} \alias{filterPolarity} \alias{filterPrecursorMz} \alias{filterProductMz} \alias{filterPrecursorScan} \alias{filterRt} \alias{filterMz} \alias{tolerance} \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}