diff --git a/NAMESPACE b/NAMESPACE index 24fb6605..42c10f71 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -530,7 +530,8 @@ exportMethods("hasChromPeaks", "featureSpectra", "chromPeakSpectra", "chromPeakChromatograms", - "featureChromatograms" + "featureChromatograms", + "chromPeakSummary" ) ## feature grouping functions and methods. diff --git a/NEWS.md b/NEWS.md index ad0c69f6..48cff211 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,6 +8,7 @@ - Fix calculation of the correlation coefficient for peak shape similarity with an idealized bell shape (*beta*) during gap filling for centWave-based chromatographic peak detection with parameter `verboseBetaColumns = TRUE`. +- Add `chromPeakSummary` generic (issue #705). ## Changes in version 4.3.3 diff --git a/R/AllGenerics.R b/R/AllGenerics.R index 72a0aeb9..202b02a4 100644 --- a/R/AllGenerics.R +++ b/R/AllGenerics.R @@ -535,6 +535,35 @@ setGeneric("chromPeakData<-", function(object, value) setGeneric("chromPeakSpectra", function(object, ...) standardGeneric("chromPeakSpectra")) +#' @title Chromatographic peak summaries +#' +#' @name chromPeakSummary +#' +#' @description +#' +#' The `chromPeakSummary()` method calculates summary statistic or other +#' metrics for each of the identified chromatographic peaks in an *xcms* +#' result object, such as the [XcmsExperiment()]. Different metrics can be +#' calculated, depending (and configured) using dedicated *parameter* classes. +#' As a result, the method returns a `matrix` or `data.frame` with one row +#' per chromatographic peak. Each column contains calculated values, depending +#' on the used method/parameter class. +#' +#' Currently implemented methods/parameter classes are: +#' +#' @return +#' +#' A `matrix` or `data.frame` with the same number of rows as there are +#' chromatographic peaks. Columns contain the calculated values. The number of +#' columns, their names and content depend on the used parameter object. See +#' the respective documentation above for more details. +#' +#' @author Pable Vangeenderhuysen, Johannes Rainer +#' +#' +setGeneric("chromPeakSummary", function(object, param, ...) + standardGeneric("chromPeakSummary")) + setGeneric("collect", function(object, ...) standardGeneric("collect")) setGeneric("consecMissedLimit", function(object, ...) standardGeneric("consecMissedLimit"))