From 194f10439737d2aee85927d4d323e889d7dcf02a Mon Sep 17 00:00:00 2001 From: jorainer Date: Fri, 24 Nov 2023 15:05:40 +0100 Subject: [PATCH] refactor: address Phili's comments --- R/Spectra-functions.R | 2 +- man/processingChunkSize.Rd | 2 +- vignettes/Spectra-large-scale.Rmd | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/R/Spectra-functions.R b/R/Spectra-functions.R index df5fe9b9..1de4e3ba 100644 --- a/R/Spectra-functions.R +++ b/R/Spectra-functions.R @@ -1146,7 +1146,7 @@ filterPrecursorPeaks <- function(object, tolerance = 0, ppm = 20, #' #' @param value `integer(1)` defining the chunk size. #' -#' @return `processingChunkSize` returns the currenlty defined processing +#' @return `processingChunkSize` returns the currently defined processing #' chunk size (or `Inf` if it is not defined). `processingChunkFactor` #' returns a `factor` defining the chunks into which `x` will be split #' for (parallel) chunk-wise processing or a `factor` of length 0 if diff --git a/man/processingChunkSize.Rd b/man/processingChunkSize.Rd index a0191c34..88c2dbcc 100644 --- a/man/processingChunkSize.Rd +++ b/man/processingChunkSize.Rd @@ -18,7 +18,7 @@ processingChunkFactor(x) \item{value}{\code{integer(1)} defining the chunk size.} } \value{ -\code{processingChunkSize} returns the currenlty defined processing +\code{processingChunkSize} returns the currently defined processing chunk size (or \code{Inf} if it is not defined). \code{processingChunkFactor} returns a \code{factor} defining the chunks into which \code{x} will be split for (parallel) chunk-wise processing or a \code{factor} of length 0 if diff --git a/vignettes/Spectra-large-scale.Rmd b/vignettes/Spectra-large-scale.Rmd index 5d10634e..83ee2086 100644 --- a/vignettes/Spectra-large-scale.Rmd +++ b/vignettes/Spectra-large-scale.Rmd @@ -72,9 +72,10 @@ The resulting `Spectra` uses a `MsBackendMzR` for data representation. This backend does only load general spectra data into memory while the *full* MS data (i.e., the *m/z* and intensity values of the individual mass peaks) is only loaded when requested or needed. In contrast to an *in-memory* backend, the -memory footprint of this backend is thus lower. Below we create a `Spectra` that -keeps the full data in memory by changing the backend to a `MsBackendMemory` -backend and compare the sizes of both objects. +memory footprint of this backend is thus lower. + +Below we create a `Spectra` that keeps the full data in memory by changing the +backend to a `MsBackendMemory` backend and compare the sizes of both objects. ```{r} sps_mem <- setBackend(sps_mzr, MsBackendMemory()) @@ -173,6 +174,10 @@ peak data. Subset operations that only reduce the number of spectra (such as `filterRt` or `[`) bypass this mechanism and are applied immediately to the data. +For an evaluation of chunk-wise processing see also this +[issue](https://github.com/rformassspectrometry/Spectra/issues/304#issuecomment-1825699576) +on the *Spectra* github repository. + # Notes and suggestions for parallel or chunk-wise processing