Title: | Generic infrastructure for Bioconductor mass spectrometry packages |
---|---|
Description: | S4 generic functions and classes needed by Bioconductor proteomics packages. |
Authors: | Laurent Gatto <[email protected]>, Johannes Rainer <[email protected]> |
Maintainer: | Laurent Gatto <[email protected]> |
License: | Artistic-2.0 |
Version: | 1.39.0 |
Built: | 2024-10-31 03:35:26 UTC |
Source: | https://github.com/bioc/ProtGenerics |
These methods are used for implementations of backends e.g. for Spectra
or Chromatograms
object to initialize the backend, merge backends or
extract specific information from them.
See the respective help pages (e.g. in the Spectra
or Chromatograms
packages) for information on the actual implementations of these methods.
backendInitialize(object, ...) isReadOnly(object) setBackend(object, backend, ...) backendMerge(object, ...) backendBpparam(object, ...) backendParallelFactor(object, ...) supportsSetBackend(object, ...)
backendInitialize(object, ...) isReadOnly(object) setBackend(object, backend, ...) backendMerge(object, ...) backendBpparam(object, ...) backendParallelFactor(object, ...) supportsSetBackend(object, ...)
object |
The backend object. |
... |
Optional parameters. |
backend |
A backend object. |
Implementations of this generic filter function are supposed to filter
features in object
based on a filter criteria defined by
parameter filter
.
filterFeatures(object, filter, ...)
filterFeatures(object, filter, ...)
object |
The object to filter. |
filter |
The filtering criteria on which |
... |
Optional parameters. |
Implementations of this generic filter function are supposed to filter
spectra (e.g. within a Spectra
object) based on filter criteria
defined with parameter filter
.
filterSpectra(object, filter, ...)
filterSpectra(object, filter, ...)
object |
The object to filter. |
filter |
The filtering criteria based on which |
... |
Optional parameters. |
The 'Param' class is a virtual class which can be used as *base* class from which *parameter* classes can inherit.
The methods implemented for the 'Param' class are:
- 'as.list': coerces the 'Param' class to a 'list' with list elements representing the object's slot values, names the slot names. *Hidden* slots (i.e. those with a name starting with '.') are not returned. In addition, a 'Param' class can be coerced to a 'list' using 'as(object, "list")'.
- 'show': prints the content of the 'Param' object (i.e. the individual slots and their value).
## S4 method for signature 'Param' as.list(x, ...) ## S4 method for signature 'Param' show(object)
## S4 method for signature 'Param' as.list(x, ...) ## S4 method for signature 'Param' show(object)
x |
'Param' object. |
... |
ignored. |
object |
'Param' object. |
Johannes Rainer
These methods get or set mass spectrometry (MS) peaks data, which can be
m/z, intensity or retention time values.
See the respective help pages (e.g. in the Spectra
or Chromatograms
packages) for information on the actual implementations of these methods.
peaksData(object, ...) peaksData(object) <- value peaksVariables(object, ...)
peaksData(object, ...) peaksData(object) <- value peaksVariables(object, ...)
object |
A data object. |
... |
Optional parameters. |
value |
Replacement for peaks data. |
Class containing the function and arguments to be applied in a lazy-execution framework.
Objects of this class are created using the ProcessingStep()
function. The
processing step is executed with the executeProcessingStep()
function.
ProcessingStep(FUN = character(), ARGS = list()) ## S4 method for signature 'ProcessingStep' show(object) executeProcessingStep(object, ...)
ProcessingStep(FUN = character(), ARGS = list()) ## S4 method for signature 'ProcessingStep' show(object) executeProcessingStep(object, ...)
FUN |
|
ARGS |
|
object |
|
... |
optional additional arguments to be passed along. |
This object contains all relevant information of a data analysis processing
step, i.e. the function and all of its arguments to be applied to the data.
This object is mainly used to record possible processing steps of a
Spectra
or OnDiskMSnExp
object (from the Spectra
and MSnbase
packages, respectively).
The ProcessingStep
function returns and object of type
ProcessingStep
.
Johannes Rainer
## Create a simple processing step object ps <- ProcessingStep(sum) executeProcessingStep(ps, 1:10)
## Create a simple processing step object ps <- ProcessingStep(sum) executeProcessingStep(ps, 1:10)
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.
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, ...) ## and many more
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, ...) ## and many more
object |
Object of class for which methods are defined. |
file |
for |
: the name of the file to which the data should be exported.
... |
Further arguments, possibly used by downstream methods. |
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.
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
Laurent Gatto
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.
## List all the symbols defined in this package: ls('package:ProtGenerics') ## Not run: ## What methods exists for 'peaks' showMethods("peaks") ## To look at one method in particular getMethod("peaks", "mzRpwiz") ## End(Not run)
## List all the symbols defined in this package: ls('package:ProtGenerics') ## Not run: ## What methods exists for 'peaks' showMethods("peaks") ## To look at one method in particular getMethod("peaks", "mzRpwiz") ## End(Not run)