Skip to content

Commit

Permalink
Address William's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jorainer committed Oct 1, 2024
1 parent 156788a commit fd9cf65
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 27 deletions.
23 changes: 12 additions & 11 deletions R/AllGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -541,20 +541,21 @@ setGeneric("chromPeakSpectra", function(object, ...)
#'
#' @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.
#' The `chromPeakSummary()` method calculates summary statistics 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 upon (and configured by) 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:
#'
#' - `BetaDistributionParam`: calculates the *beta_cor* and *beta_snr* quality
#' metrics as described in (Kumler 2023) representing the result from a
#' (correlation) test of similarity to a bell curve and the signal-to-noise
#' ratio calculated on the residulas of this test.
#' metrics as described in Kumler 2023 representing the result from a
#' (correlation) test of similarity (using Pearson's correlation coefficient)
#' to a bell curve and the signal-to-noise ratio calculated on the residuals
#' of this test.
#'
#' @param BPPARAM Parallel processing setup. See [bpparam()] for details.
#'
Expand All @@ -579,7 +580,7 @@ setGeneric("chromPeakSpectra", function(object, ...)
#' columns, their names and content depend on the used parameter object. See
#' the respective documentation above for more details.
#'
#' @author Pablo Vangeenderhuysen, Johannes Rainer
#' @author Pablo Vangeenderhuysen, Johannes Rainer, William Kumler
#'
#' @md
#'
Expand Down
2 changes: 1 addition & 1 deletion R/methods-XChromatogram.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ setMethod("show", "XChromatogram", function(object) {
#' value) and `"mzmax"` (maximal m/z value), `"rt"` (retention time of the
#' peak apex), `"rtmin"` (the lower peak boundary in retention time
#' dimension), `"rtmax"` (the upper peak boundary in retention time
#' dimension), `"into"` (the ingegrated peak signal/area of the peak),
#' dimension), `"into"` (the integrated peak signal/area of the peak),
#' `"maxo"` (the maximum instensity of the peak and `"sn"` (the signal to
#' noise ratio).
#' Note that, depending on the peak detection algorithm, the matrix may
Expand Down
2 changes: 1 addition & 1 deletion man/XChromatogram.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions man/chromPeakSummary.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/xcms.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ eics <- chromPeakChromatograms(
faahko, peaks = rownames(chromPeaks(faahko))[c(4, 6)])
```

```{r peak-quality-metrics, fig.widht = 10, fig.height = 5, fig.cap = "Plots of high and low quality peaks. Left: peak CP0004 with a beta_cor = 0.98, right: peak CP0006 with a beta_cor = 0.13."}
```{r peak-quality-metrics, fig.width = 10, fig.height = 5, fig.cap = "Plots of high and low quality peaks. Left: peak CP0004 with a beta_cor = 0.98, right: peak CP0006 with a beta_cor = 0.13."}
peak_1 <- eics[1]
peak_2 <- eics[2]
par(mfrow = c(1, 2))
Expand Down Expand Up @@ -509,7 +509,7 @@ faahko_pp <- refineChromPeaks(faahko, mpp)

An example for a merged peak is given below.

```{r peak-postprocessing-merged, fig.widht = 10, fig.height = 5, fig.cap = "Result from the peak refinement step. Left: data before processing, right: after refinement. The splitted peak was merged into one."}
```{r peak-postprocessing-merged, fig.width = 10, fig.height = 5, fig.cap = "Result from the peak refinement step. Left: data before processing, right: after refinement. The splitted peak was merged into one."}
mzr_1 <- 305.1 + c(-0.01, 0.01)
chr_1 <- chromatogram(faahko[1], mz = mzr_1)
chr_2 <- chromatogram(faahko_pp[1], mz = mzr_1)
Expand All @@ -524,7 +524,7 @@ plot(chr_2)
peaks into a single one (right panel in the figure above). Other close peaks,
with a lower intensity between them, were however not merged (see below).

```{r peak-postprocessing-not-merged, fig.widht = 10, fig.height = 5, fig.cap = "Result from the peak refinement step. Left: data before processing, right: after refinement. The peaks were not merged."}
```{r peak-postprocessing-not-merged, fig.width = 10, fig.height = 5, fig.cap = "Result from the peak refinement step. Left: data before processing, right: after refinement. The peaks were not merged."}
mzr_1 <- 496.2 + c(-0.01, 0.01)
chr_1 <- chromatogram(faahko[1], mz = mzr_1)
chr_2 <- chromatogram(faahko_pp[1], mz = mzr_1)
Expand Down

0 comments on commit fd9cf65

Please sign in to comment.