diff --git a/DESCRIPTION b/DESCRIPTION index b1a33c7d..bda18ab1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: Spectra Title: Spectra Infrastructure for Mass Spectrometry Data -Version: 1.17.2 +Version: 1.17.3 Description: The Spectra package defines an efficient infrastructure for storing and handling mass spectrometry spectra and functionality to subset, process, visualize and compare spectra data. It provides different diff --git a/NEWS.md b/NEWS.md index 40622b24..6fd58890 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,14 @@ # Spectra 1.17 +## Change in 1.17.3 + +- Fix `cbind2()` unit test for backends that fails if the number of spectra in + the tested backend is (by chance) equal to 4. + ## Change in 1.17.2 -- Add `cbind2()` method to easily add multiple `spectraVariables` and their - content to the `spectraData` of a `Spectra` object. +- Add `cbind2()` method to easily add multiple `spectraVariables` and their + content to the `spectraData` of a `Spectra` object. See also [issue #342](https://github.com/rformassspectrometry/Spectra/issues/342) ## Changes in 1.17.1 diff --git a/R/MsBackend.R b/R/MsBackend.R index 6bd97749..6b66fef1 100644 --- a/R/MsBackend.R +++ b/R/MsBackend.R @@ -9,6 +9,7 @@ #' @aliases supportsSetBackend #' @aliases backendBpparam #' @aliases backendInitialize +#' @aliases backendParallelFactor #' @aliases backendParallelFactor,MsBackendMzR-method #' @aliases backendParallelFactor,MsBackendHdf5Peaks-method #' @aliases dataStorageBasePath @@ -64,8 +65,8 @@ #' #' @param BPPARAM for `backendBpparam()`: parameter object from the #' `BiocParallel` package defining the parallel processing setup. -#' Defaults to `BPPARAM = bpparam()`. See [bpparam()] for more -#' information. +#' Defaults to `BPPARAM = bpparam()`. See [BiocParallel::bpparam()] +#' for more information. #' #' @param columns For `spectraData()` accessor: optional `character` with #' column names (spectra variables) that should be included in the @@ -133,7 +134,7 @@ #' #' @param ppm For `filterPrecursorMzValues()`: `numeric(1)` with the #' m/z-relative maximal acceptable difference for a m/z to be considered -#' matching. See [closest()] for details. +#' matching. See [MsCoreUtils::closest()] for details. #' For `filterValues()`: `numeric` of any length allowing to define #' a maximal accepted difference between user input `values` and the #' `spectraVariables` values. If it is not equal to the length of the @@ -171,7 +172,8 @@ #' #' @param tolerance For `filterPrecursorMzValues()`: `numeric(1)` with the #' maximal absolute acceptable difference for a m/z value to be considered -#' matching. See [closest()] for details. For `filterValues()`: `numeric` +#' matching. See [MsCoreUtils::closest()] for details. +#' For `filterValues()`: `numeric` #' accepted tolerance between the `values` and the spectra variables. #' Defaults to `tolerance = 0`. If it is not equal to the length of the #' value provided with parameter `spectraVariables`, `tolerance[1]` will @@ -358,9 +360,9 @@ #' support `logical` and eventually `character`). While being apparently #' redundant to `[`, this methods avoids package namespace errors/problems #' that can result in implementations of `[` being not found by R (which -#' can happen sometimes in parallel processing using the [SnowParam()]). This -#' method is used internally by `Spectra` to extract/subset its backend. -#' Implementation of this method is mandatory. +#' can happen sometimes in parallel processing using the +#' [BiocParallel::SnowParam()]). This method is used internally by `Spectra` +#' to extract/subset its backend. Implementation of this method is mandatory. #' #' - `filterAcquisitionNum()`: filters the object keeping only spectra matching #' the provided acquisition numbers (argument `n`). If `dataOrigin` or @@ -462,14 +464,14 @@ #' for `MsBackend` is available. #' #' - `intensity()`: gets the intensity values from the spectra. Returns -#' a [NumericList()] of `numeric` vectors (intensity values for each +#' a [IRanges::NumericList()] of `numeric` vectors (intensity values for each #' spectrum). The length of the `list` is equal to the number of #' `spectra` in `object`. #' #' - `intensity<-`: replaces the intensity values. `value` has to be a `list` -#' (or [NumericList()]) of length equal to the number of spectra and the -#' number of values within each list element identical to the number of -#' peaks in each spectrum (i.e. the `lengths(x)`). Note that just +#' (or [IRanges::NumericList()]) of length equal to the number of spectra +#' and the number of values within each list element identical to the +#' number of peaks in each spectrum (i.e. the `lengths(x)`). Note that just #' writeable backends support this method. #' #' - `ionCount()`: returns a `numeric` with the sum of intensities for @@ -512,8 +514,8 @@ #' - `msLevel<-`: replaces the spectra's MS level. #' #' - `mz()`: gets the mass-to-charge ratios (m/z) from the -#' spectra. Returns a [NumericList()] or length equal to the number of -#' spectra, each element a `numeric` vector with the m/z values of +#' spectra. Returns a [IRanges::NumericList()] or length equal to the +#' number of spectra, each element a `numeric` vector with the m/z values of #' one spectrum. #' #' - `mz<-`: replaces the m/z values. `value` has to be a `list` of length equal @@ -700,10 +702,10 @@ #' precursor. #' - `"precursorCharge"`: `integer` with the charge of the precursor. #' - `"collisionEnergy"`: `numeric` with the collision energy. -#' - `"mz"`: [NumericList()] of `numeric` vectors representing the m/z values -#' for each spectrum. -#' - `"intensity"`: [NumericList()] of `numeric` vectors representing the -#' intensity values for each spectrum. +#' - `"mz"`: [IRanges::NumericList()] of `numeric` vectors representing the +#' m/z values for each spectrum. +#' - `"intensity"`: [IRanges::NumericList()] of `numeric` vectors +#' representing the intensity values for each spectrum. #' #' Additional columns are allowed too. #' diff --git a/R/MsBackendCached.R b/R/MsBackendCached.R index e2f4d4d2..bc1db97a 100644 --- a/R/MsBackendCached.R +++ b/R/MsBackendCached.R @@ -104,7 +104,7 @@ setClassUnion("characterOrInteger", c("character", "integer")) #' the mzML file from which the data was read. #' #' - `intensity()`: gets the intensity values from the spectra. Returns -#' a [NumericList()] of `numeric` vectors (intensity values for each +#' a [IRanges::NumericList()] of `numeric` vectors (intensity values for each #' spectrum). The length of the `list` is equal to the number of #' `spectra` in `object`. #' @@ -136,8 +136,8 @@ setClassUnion("characterOrInteger", c("character", "integer")) #' level for each spectrum (or `NA_integer_` if not available). #' #' - `mz()`: gets the mass-to-charge ratios (m/z) from the -#' spectra. Returns a [NumericList()] or length equal to the number of -#' spectra, each element a `numeric` vector with the m/z values of +#' spectra. Returns a [IRanges::NumericList()] or length equal to the +#' number of spectra, each element a `numeric` vector with the m/z values of #' one spectrum. #' #' - `polarity()`, `polarity<-`: gets or sets the polarity for each diff --git a/R/Spectra-estimatePrecursorMz.R b/R/Spectra-estimatePrecursorMz.R index ad6ff630..b82dd750 100644 --- a/R/Spectra-estimatePrecursorMz.R +++ b/R/Spectra-estimatePrecursorMz.R @@ -46,7 +46,8 @@ #' m/z. See documentation of parameter `tolerance` for more information. #' #' @param BPPARAM parallel processing setup. Defaults to -#' `BPPARAM = SerialParam()`. See [SerialParam()] for more information. +#' `BPPARAM = SerialParam()`. See [BiocParallel::SerialParam()] for +#' more information. #' #' @return `numeric` of length equal to the number of spectra in `object` with #' the fragment spectra's estimated precursor m/z values. For MS1 spectra diff --git a/R/Spectra-functions.R b/R/Spectra-functions.R index 93d9f2db..48ede719 100644 --- a/R/Spectra-functions.R +++ b/R/Spectra-functions.R @@ -198,7 +198,8 @@ NULL #' @param ... Additional parameters for `FUN`. #' #' @param BPPARAM Optional settings for `BiocParallel`-based parallel -#' processing. See [bpparam()] for more informations and options. +#' processing. See [BiocParallel::bpparam()] for more informations and +#' options. #' #' @return A `list` with the result of `FUN`. #' @@ -959,8 +960,8 @@ filterPrecursorPeaks <- function(object, tolerance = 0, ppm = 20, #' per file parallel processing if `f` or `chunkSize` is not defined. #' Other on-disk backends: only if requested by the user. #' -#' @param BPPARAM Parallel setup configuration. See [bpparam()] for more -#' information. +#' @param BPPARAM Parallel setup configuration. See [BiocParallel::bpparam()] +#' for more information. #' #' @param object `Spectra` object. #' @@ -1039,8 +1040,8 @@ filterPrecursorPeaks <- function(object, tolerance = 0, ppm = 20, #' For these, the `backendBpparam()` function will always return a #' `SerialParam()` independently on how parallel processing was defined. #' -#' @param BPPARAM Parallel setup configuration. See [bpparam()] for more -#' information. +#' @param BPPARAM Parallel setup configuration. See [BiocParallel::bpparam()] +#' for more information. #' #' @param object `Spectra` object. #' diff --git a/R/Spectra.R b/R/Spectra.R index 2502db4a..86fa6c8e 100644 --- a/R/Spectra.R +++ b/R/Spectra.R @@ -49,9 +49,9 @@ NULL #' creation of `Spectra` objects for details. #' For `export()`: [MsBackend-class] to be used to export the data. #' -#' @param BPPARAM Parallel setup configuration. See [bpparam()] for more -#' information. This is passed directly to the [backendInitialize()] method -#' of the [MsBackend-class]. +#' @param BPPARAM Parallel setup configuration. See [BiocParallel::bpparam()] +#' for more information. This is passed directly to the +#' [backendInitialize()] method of the [MsBackend-class]. #' #' @param f For `setBackend()`: factor defining how to split the data #' for parallelized copying of the spectra data to the new backend. For @@ -65,7 +65,7 @@ NULL #' `Spectra` objects for details. For all other methods a `Spectra` object. #' #' @param processingQueue For `Spectra()`: optional `list` of -#' [ProcessingStep-class] objects. +#' [ProtGenerics::ProcessingStep-class] objects. #' #' @param source For `Spectra()`: instance of [MsBackend-class] that can be #' used to import spectrum data from the provided files. See section @@ -180,8 +180,8 @@ NULL #' - `...`: optional additional arguments passed to the [backendInitialize()] #' method of the new `backend`. #' -#' - `BPPARAM`: setup for the parallel processing. See [bpparam()] for -#' details. +#' - `BPPARAM`: setup for the parallel processing. See +#' [BiocParallel::bpparam()] for details. #' #' #' @section Exporting data from a `Spectra` object: @@ -608,9 +608,9 @@ setReplaceMethod("dataStorageBasePath", "Spectra", function(object, value) { #' replaced (again, using dedicated functions or using `$<-`). #' #' -#' @param BPPARAM Parallel setup configuration. See [bpparam()] for more -#' information. See also [processingChunkSize()] for more information -#' on parallel processing. +#' @param BPPARAM Parallel setup configuration. See [BiocParallel::bpparam()] +#' for more information. See also [processingChunkSize()] for more +#' information on parallel processing. #' #' @param columns For `spectraData()` accessor: optional `character` with #' column names (spectra variables) that should be included in the @@ -779,7 +779,7 @@ setReplaceMethod("dataStorageBasePath", "Spectra", function(object, value) { #' with the data storage location of each spectrum. #' #' - `intensity()`: gets the intensity values from the spectra. Returns -#' a [NumericList()] of `numeric` vectors (intensity values for each +#' a [IRanges::NumericList()] of `numeric` vectors (intensity values for each #' spectrum). The length of the list is equal to the number of #' `spectra` in `object`. #' @@ -818,19 +818,19 @@ setReplaceMethod("dataStorageBasePath", "Spectra", function(object, value) { #' level for each spectrum. #' #' - `mz()`: gets the mass-to-charge ratios (m/z) from the -#' spectra. Returns a [NumericList()] or length equal to the number of -#' spectra, each element a `numeric` vector with the m/z values of +#' spectra. Returns a [IRanges::NumericList()] or length equal to the number +#' of spectra, each element a `numeric` vector with the m/z values of #' one spectrum. #' #' - `peaksData()`: gets the *peaks* data for all spectra in `object`. Peaks #' data consist of the m/z and intensity values as well as possible additional #' annotations (variables) of all peaks of each spectrum. The function -#' returns a [SimpleList()] of two dimensional arrays (either `matrix` or -#' `data.frame`), with each array providing the values for the requested -#' *peak variables* (by default `"mz"` and `"intensity"`). Optional parameter -#' `columns` is passed to the backend's `peaksData()` function to allow -#' the selection of specific (or additional) peaks variables (columns) that -#' should be extracted (if available). Importantly, +#' returns a [S4Vectors::SimpleList()] of two dimensional arrays (either +#' `matrix` or `data.frame`), with each array providing the values for the +#' requested *peak variables* (by default `"mz"` and `"intensity"`). +#' Optional parameter `columns` is passed to the backend's `peaksData()` +#' function to allow the selection of specific (or additional) peaks +#' variables (columns) that should be extracted (if available). Importantly, #' it is **not** guaranteed that each backend supports this parameter (while #' each backend must support extraction of `"mz"` and `"intensity"` columns). #' Parameter `columns` defaults to `c("mz", "intensity")` but any value @@ -1522,9 +1522,9 @@ setReplaceMethod("[[", "Spectra", function(x, i, j, ..., value) { #' - `split()`: splits the `Spectra` object based on parameter `f` into a `list` #' of `Spectra` objects. #' -#' @param BPPARAM Parallel setup configuration. See [bpparam()] for more -#' information. This is passed directly to the [backendInitialize()] method -#' of the [MsBackend-class]. +#' @param BPPARAM Parallel setup configuration. See [BiocParallel::bpparam()] +#' for more information. This is passed directly to the +#' [backendInitialize()] method of the [MsBackend-class]. #' #' @param by.x A `character(1)` specifying the spectra variable used #' for merging. Default is `"spectrumId"`. @@ -2028,12 +2028,13 @@ setMethod("combinePeaks", "Spectra", function(object, tolerance = 0, ppm = 20, #' #' - `deisotopeSpectra()`: *deisotopes* each spectrum keeping only the #' monoisotopic peak for groups of isotopologues. Isotopologues are -#' estimated using the [isotopologues()] function from the +#' estimated using the [MetaboCoreUtils::isotopologues()] function from the #' *MetaboCoreUtils* package. Note that #' the default parameters for isotope prediction/detection have been #' determined using data from the Human Metabolome Database (HMDB) and #' isotopes for elements other than CHNOPS might not be detected. See -#' parameter `substDefinition` in the documentation of [isotopologues()] for +#' parameter `substDefinition` in the documentation of +#' [MetaboCoreUtils::isotopologues()] for #' more information. The approach and code to define the parameters for #' isotope prediction is described #' [here](https://github.com/EuracBiomedicalResearch/isotopologues). @@ -2105,7 +2106,7 @@ setMethod("combinePeaks", "Spectra", function(object, tolerance = 0, ppm = 20, #' subsetted. #' #' @param charge For `deisotopeSpectra()`: expected charge of the ionized -#' compounds. See [isotopologues()] for details. +#' compounds. See [MetaboCoreUtils::isotopologues()] for details. #' #' @param dataOrigin For `filterDataOrigin()`: `character` to define which #' spectra to keep. @@ -2187,7 +2188,7 @@ setMethod("combinePeaks", "Spectra", function(object, tolerance = 0, ppm = 20, #' For `filterPrecursorMaxIntensity()`: `numeric(1)` defining the relative #' maximal accepted difference of precursor m/z values of spectra for #' grouping them into *precursor groups*. For `filterPrecursorIsotopes()`: -#' passed directly to the [isotopologues()] function. +#' passed directly to the [MetaboCoreUtils::isotopologues()] function. #' For `filterValues()`: `numeric` of any length allowing to define #' a maximal accepted difference between user input `values` and the #' `spectraVariables` values. If it is not equal to the length of the @@ -2213,7 +2214,8 @@ setMethod("combinePeaks", "Spectra", function(object, tolerance = 0, ppm = 20, #' `filterPrecursorIsotopes()`: `matrix` or `data.frame` with definitions #' of isotopic substitutions. Uses by default isotopic substitutions #' defined from all compounds in the Human Metabolome Database (HMDB). See -#' [isotopologues()] or [isotopicSubstitutionMatrix()] in the +#' [MetaboCoreUtils::isotopologues()] or +#' [MetaboCoreUtils::isotopicSubstitutionMatrix()] in the #' *MetaboCoreUtils* for details. #' #' @param threshold For `filterFourierTransformArtefacts()`: the relative @@ -2230,7 +2232,8 @@ setMethod("combinePeaks", "Spectra", function(object, tolerance = 0, ppm = 20, #' For `filterPrecursorMaxIntensity()`: `numeric(1)` defining the #' (constant) maximal accepted difference of precursor m/z values of #' spectra for grouping them into *precursor groups*. For -#' `filterPrecursorIsotopes()`: passed directly to the [isotopologues()] +#' `filterPrecursorIsotopes()`: passed directly to the +#' [MetaboCoreUtils::isotopologues()] #' function. For `filterValues()`: `numeric` of any length allowing to #' define a maximal accepted difference between user input `values` and the #' `spectraVariables` values. If it is not equal to the length of the @@ -2906,7 +2909,8 @@ setMethod("filterValues", "Spectra", #' #' - `containsMz()`: checks for each of the spectra whether they contain mass #' peaks with an m/z equal to `mz` (given acceptable difference as defined by -#' parameters `tolerance` and `ppm` - see [common()] for details). Parameter +#' parameters `tolerance` and `ppm` - see [MsCoreUtils::common()] for +#' details). Parameter #' `which` allows to define whether any (`which = "any"`, the default) or #' all (`which = "all"`) of the `mz` have to match. The function returns #' `NA` if `mz` is of length 0 or is `NA`. @@ -2918,7 +2922,8 @@ setMethod("filterValues", "Spectra", #' #' - `entropy()`: calculates the entropy of each spectra based on the metrics #' suggested by Li et al. (https://doi.org/10.1038/s41592-021-01331-z). -#' See also [nentropy()] in the *MsCoreUtils* package for details. +#' See also [MsCoreUtils::nentropy()] in the *MsCoreUtils* package for +#' details. #' #' - `estimatePrecursorIntensity()`: defines the precursor intensities for MS2 #' spectra using the intensity of the matching MS1 peak from the @@ -2992,10 +2997,11 @@ setMethod("filterValues", "Spectra", #' @param binSize For `bin()`: `numeric(1)` defining the size for the m/z bins. #' Defaults to `binSize = 1`. #' -#' @param BPPARAM Parallel setup configuration. See [bpparam()] for more -#' information. This is passed directly to the [backendInitialize()] method -#' of the [MsBackend-class]. See also [processingChunkSize()] for -#' additional information on parallel processing. +#' @param BPPARAM Parallel setup configuration. See [BiocParallel::bpparam()] +#' for more information. This is passed directly to the +#' [backendInitialize()] method of the [MsBackend-class]. See also +#' [processingChunkSize()] for additional information on parallel +#' processing. #' #' @param breaks For `bin()`: `numeric` defining the m/z breakpoints between #' bins. @@ -3055,8 +3061,8 @@ setMethod("filterValues", "Spectra", #' value which should be subtracted from the spectrum's precursor m/z. #' #' @param normalized for `entropy()`: `logical(1)` whether the normalized -#' entropy should be calculated (default). See also [nentropy()] for -#' details. +#' entropy should be calculated (default). See also +#' [MsCoreUtils::nentropy()] for details. #' #' @param object A `Spectra` object. #' @@ -3530,9 +3536,9 @@ setMethod("spectrapply", "Spectra", function(object, FUN, ..., #' spectra belong to the same original data file (sample). #' Defaults to `f = dataOrigin(x)`. #' -#' @param BPPARAM Parallel setup configuration. See [bpparam()] for more -#' information. This is passed directly to the [backendInitialize()] method -#' of the [MsBackend-class]. +#' @param BPPARAM Parallel setup configuration. See [BiocParallel::bpparam()] +#' for more information. This is passed directly to the +#' [backendInitialize()] method of the [MsBackend-class]. #' #' @author Johannes Rainer with feedback and suggestions from Corey Broeckling #' @@ -3591,9 +3597,9 @@ setMethod( #' @description #' #' `compareSpectra()` compares each spectrum in `x` with each spectrum in `y` -#' using the function provided with `FUN` (defaults to [ndotproduct()]). If -#' `y` is missing, each spectrum in `x` is compared with each other spectrum -#' in `x`. +#' using the function provided with `FUN` (defaults to +#' [MsCoreUtils::ndotproduct()]). If `y` is missing, each spectrum in `x` is +#' compared with each other spectrum in `x`. #' The matching/mapping of peaks between the compared spectra is done with the #' `MAPFUN` function. The default [joinPeaks()] matches peaks of both spectra #' and allows to keep all peaks from the first spectrum (`type = "left"`), @@ -3628,7 +3634,7 @@ setMethod( #' similarity in the scoring. #' #' @param FUN function to compare intensities of peaks between two spectra. -#' Defaults to [ndotproduct()]. +#' Defaults to [MsCoreUtils::ndotproduct()]. #' #' @param MAPFUN For `compareSpectra()`: function to map/match peaks between #' the two compared spectra. See [joinPeaks()] for more information and diff --git a/R/peaks-functions.R b/R/peaks-functions.R index dc19e353..4b239719 100644 --- a/R/peaks-functions.R +++ b/R/peaks-functions.R @@ -255,9 +255,9 @@ NULL #' matrices might be reported multiple times. Note that if one of #' `xPrecursorMz` or `yPrecursorMz` are `NA` or if both are the same, the #' results are the same as with [joinPeaks()]. To calculate GNPS similarity -#' scores, [gnps()] should be called on the aligned peak matrices (i.e. -#' `compareSpectra` should be called with `MAPFUN = joinPeaksGnps` and -#' `FUN = MsCoreUtils::gnps`). +#' scores, [MsCoreUtils::gnps()] should be called on the aligned peak +#' matrices (i.e. `compareSpectra` should be called with +#' `MAPFUN = joinPeaksGnps` and `FUN = MsCoreUtils::gnps`). #' #' - `joinPeaksNone()`: does not perform any peak matching but simply returns #' the peak matrices in a `list`. This function should be used with the @@ -313,8 +313,8 @@ NULL #' - [compareSpectra()] for the function to calculate similarities between #' spectra. #' -#' - [gnps()] in the *MsCoreUtils* package for more information on the GNPS -#' similarity score. +#' - [MsCoreUtils::gnps()] in the *MsCoreUtils* package for more information +#' on the GNPS similarity score. #' #' @importFrom MsCoreUtils join ppm #' diff --git a/R/plotting-functions.R b/R/plotting-functions.R index 285a02a6..c75687f9 100644 --- a/R/plotting-functions.R +++ b/R/plotting-functions.R @@ -14,10 +14,10 @@ #' #' - `plotSpectraMirror()`: plots a pair of spectra as a *mirror plot*. #' Parameters `x` and `y` both have to be a `Spectra` of length 1. Matching -#' peaks (considering `ppm` and `tolerance`) are highlighted. See [common()] -#' for details on peak matching. Parameters `matchCol`, `matchLty`, -#' `matchLwd` and `matchPch` allow to customize how matching peaks are -#' indicated. +#' peaks (considering `ppm` and `tolerance`) are highlighted. See +#' [MsCoreUtils::common()] for details on peak matching. Parameters +#' `matchCol`, `matchLty`, `matchLwd` and `matchPch` allow to customize +#' how matching peaks are indicated. #' #' @param x a [Spectra()] object. For `plotSpectraMirror()` it has to be an #' object of length 2. @@ -70,12 +70,12 @@ #' plotting area. #' #' @param ppm for `plotSpectraMirror()`: m/z relative acceptable difference (in -#' ppm) for peaks to be considered matching (see [common()] for more -#' details). +#' ppm) for peaks to be considered matching (see [MsCoreUtils::common()] +#' for more details). #' #' @param tolerance for `plotSpectraMirror()`: absolute acceptable difference of -#' m/z values for peaks to be considered matching (see [common()] for more -#' details). +#' m/z values for peaks to be considered matching (see +#' [MsCoreUtils::common()] for more details). #' #' @param matchCol for `plotSpectraMirror()`: color for matching peaks. #' diff --git a/inst/test_backends/test_MsBackend/test_spectra_subsetting.R b/inst/test_backends/test_MsBackend/test_spectra_subsetting.R index 76d676a4..e1beb93e 100644 --- a/inst/test_backends/test_MsBackend/test_spectra_subsetting.R +++ b/inst/test_backends/test_MsBackend/test_spectra_subsetting.R @@ -68,7 +68,7 @@ test_that("cbind2 works", { expect_equal(res$cola, seq_len(seql)) expect_equal(res$colb, rep("b", seql)) expect_equal(res$colz, rep("z", seql)) - df2 <- data.frame(cola = 3:6, colb = "b", colz = "z") + df2 <- data.frame(cola = seq_len(length(be) / 2), colb = "b", colz = "z") expect_error(cbind2(be, df2), "does not match") ## with matrix m <- matrix(1:seql, ncol = 1, dimnames = list(NULL, "m")) diff --git a/man/MsBackend.Rd b/man/MsBackend.Rd index 8842343d..b920d692 100644 --- a/man/MsBackend.Rd +++ b/man/MsBackend.Rd @@ -15,6 +15,7 @@ \alias{supportsSetBackend} \alias{backendBpparam} \alias{backendInitialize} +\alias{backendParallelFactor} \alias{backendParallelFactor,MsBackendMzR-method} \alias{backendParallelFactor,MsBackendHdf5Peaks-method} \alias{dataStorageBasePath} @@ -315,8 +316,8 @@ MsBackendMzR() \item{BPPARAM}{for \code{backendBpparam()}: parameter object from the \code{BiocParallel} package defining the parallel processing setup. -Defaults to \code{BPPARAM = bpparam()}. See \code{\link[=bpparam]{bpparam()}} for more -information.} +Defaults to \code{BPPARAM = bpparam()}. See \code{\link[BiocParallel:register]{BiocParallel::bpparam()}} +for more information.} \item{...}{Additional arguments.} @@ -371,7 +372,7 @@ to subset \code{object}.} \item{ppm}{For \code{filterPrecursorMzValues()}: \code{numeric(1)} with the m/z-relative maximal acceptable difference for a m/z to be considered -matching. See \code{\link[=closest]{closest()}} for details. +matching. See \code{\link[MsCoreUtils:matching]{MsCoreUtils::closest()}} for details. For \code{filterValues()}: \code{numeric} of any length allowing to define a maximal accepted difference between user input \code{values} and the \code{spectraVariables} values. If it is not equal to the length of the @@ -380,7 +381,8 @@ recycled.} \item{tolerance}{For \code{filterPrecursorMzValues()}: \code{numeric(1)} with the maximal absolute acceptable difference for a m/z value to be considered -matching. See \code{\link[=closest]{closest()}} for details. For \code{filterValues()}: \code{numeric} +matching. See \code{\link[MsCoreUtils:matching]{MsCoreUtils::closest()}} for details. +For \code{filterValues()}: \code{numeric} accepted tolerance between the \code{values} and the spectra variables. Defaults to \code{tolerance = 0}. If it is not equal to the length of the value provided with parameter \code{spectraVariables}, \code{tolerance[1]} will @@ -644,9 +646,9 @@ however, \code{i} is expected to be an \code{integer} (while \code{[} should als support \code{logical} and eventually \code{character}). While being apparently redundant to \code{[}, this methods avoids package namespace errors/problems that can result in implementations of \code{[} being not found by R (which -can happen sometimes in parallel processing using the \code{\link[=SnowParam]{SnowParam()}}). This -method is used internally by \code{Spectra} to extract/subset its backend. -Implementation of this method is mandatory. +can happen sometimes in parallel processing using the +\code{\link[BiocParallel:SnowParam-class]{BiocParallel::SnowParam()}}). This method is used internally by \code{Spectra} +to extract/subset its backend. Implementation of this method is mandatory. \item \code{filterAcquisitionNum()}: filters the object keeping only spectra matching the provided acquisition numbers (argument \code{n}). If \code{dataOrigin} or \code{dataStorage} is also provided, \code{object} is subsetted to the spectra with @@ -732,13 +734,13 @@ values are within any of the provided ranges are retained). Implementation of this method is optional since a default implementation for \code{MsBackend} is available. \item \code{intensity()}: gets the intensity values from the spectra. Returns -a \code{\link[=NumericList]{NumericList()}} of \code{numeric} vectors (intensity values for each +a \code{\link[IRanges:AtomicList-class]{IRanges::NumericList()}} of \code{numeric} vectors (intensity values for each spectrum). The length of the \code{list} is equal to the number of \code{spectra} in \code{object}. \item \verb{intensity<-}: replaces the intensity values. \code{value} has to be a \code{list} -(or \code{\link[=NumericList]{NumericList()}}) of length equal to the number of spectra and the -number of values within each list element identical to the number of -peaks in each spectrum (i.e. the \code{lengths(x)}). Note that just +(or \code{\link[IRanges:AtomicList-class]{IRanges::NumericList()}}) of length equal to the number of spectra +and the number of values within each list element identical to the +number of peaks in each spectrum (i.e. the \code{lengths(x)}). Note that just writeable backends support this method. \item \code{ionCount()}: returns a \code{numeric} with the sum of intensities for each spectrum. If the spectrum is empty (see \code{isEmpty()}), @@ -769,8 +771,8 @@ vector (of length equal to the number of spectra) with the MS level for each spectrum (or \code{NA_integer_} if not available). \item \verb{msLevel<-}: replaces the spectra's MS level. \item \code{mz()}: gets the mass-to-charge ratios (m/z) from the -spectra. Returns a \code{\link[=NumericList]{NumericList()}} or length equal to the number of -spectra, each element a \code{numeric} vector with the m/z values of +spectra. Returns a \code{\link[IRanges:AtomicList-class]{IRanges::NumericList()}} or length equal to the +number of spectra, each element a \code{numeric} vector with the m/z values of one spectrum. \item \verb{mz<-}: replaces the m/z values. \code{value} has to be a \code{list} of length equal to the number of spectra and the number of values within each list element @@ -945,10 +947,10 @@ containing the precursor of a (MS2) spectrum. precursor. \item \code{"precursorCharge"}: \code{integer} with the charge of the precursor. \item \code{"collisionEnergy"}: \code{numeric} with the collision energy. -\item \code{"mz"}: \code{\link[=NumericList]{NumericList()}} of \code{numeric} vectors representing the m/z values -for each spectrum. -\item \code{"intensity"}: \code{\link[=NumericList]{NumericList()}} of \code{numeric} vectors representing the -intensity values for each spectrum. +\item \code{"mz"}: \code{\link[IRanges:AtomicList-class]{IRanges::NumericList()}} of \code{numeric} vectors representing the +m/z values for each spectrum. +\item \code{"intensity"}: \code{\link[IRanges:AtomicList-class]{IRanges::NumericList()}} of \code{numeric} vectors +representing the intensity values for each spectrum. } Additional columns are allowed too. diff --git a/man/MsBackendCached.Rd b/man/MsBackendCached.Rd index ae8c6687..1cc219a9 100644 --- a/man/MsBackendCached.Rd +++ b/man/MsBackendCached.Rd @@ -269,7 +269,7 @@ returns a \code{numeric} with length equal to the number of spectra in \code{object} with the \emph{data origin} of each spectrum. This could e.g. be the mzML file from which the data was read. \item \code{intensity()}: gets the intensity values from the spectra. Returns -a \code{\link[=NumericList]{NumericList()}} of \code{numeric} vectors (intensity values for each +a \code{\link[IRanges:AtomicList-class]{IRanges::NumericList()}} of \code{numeric} vectors (intensity values for each spectrum). The length of the \code{list} is equal to the number of \code{spectra} in \code{object}. \item \code{ionCount()}: returns a \code{numeric} with the sum of intensities for @@ -292,8 +292,8 @@ number of spectra). For empty spectra, \code{0} is returned. vector (of length equal to the number of spectra) with the MS level for each spectrum (or \code{NA_integer_} if not available). \item \code{mz()}: gets the mass-to-charge ratios (m/z) from the -spectra. Returns a \code{\link[=NumericList]{NumericList()}} or length equal to the number of -spectra, each element a \code{numeric} vector with the m/z values of +spectra. Returns a \code{\link[IRanges:AtomicList-class]{IRanges::NumericList()}} or length equal to the +number of spectra, each element a \code{numeric} vector with the m/z values of one spectrum. \item \code{polarity()}, \verb{polarity<-}: gets or sets the polarity for each spectrum. \code{polarity} returns an \code{integer} vector (length equal diff --git a/man/Spectra.Rd b/man/Spectra.Rd index 1116f60c..1d7efdf0 100644 --- a/man/Spectra.Rd +++ b/man/Spectra.Rd @@ -72,7 +72,7 @@ object and initialize the with data.. See section on creation of \code{Spectra} objects for details. For all other methods a \code{Spectra} object.} \item{processingQueue}{For \code{Spectra()}: optional \code{list} of -\linkS4class{ProcessingStep} objects.} +\link[ProtGenerics:ProcessingStep]{ProtGenerics::ProcessingStep} objects.} \item{metadata}{For \code{Spectra()}: optional \code{list} with metadata information.} @@ -87,9 +87,9 @@ passing the full spectra data to the initialize method. See section on creation of \code{Spectra} objects for details. For \code{export()}: \linkS4class{MsBackend} to be used to export the data.} -\item{BPPARAM}{Parallel setup configuration. See \code{\link[=bpparam]{bpparam()}} for more -information. This is passed directly to the \code{\link[=backendInitialize]{backendInitialize()}} method -of the \linkS4class{MsBackend}.} +\item{BPPARAM}{Parallel setup configuration. See \code{\link[BiocParallel:register]{BiocParallel::bpparam()}} +for more information. This is passed directly to the +\code{\link[=backendInitialize]{backendInitialize()}} method of the \linkS4class{MsBackend}.} \item{source}{For \code{Spectra()}: instance of \linkS4class{MsBackend} that can be used to import spectrum data from the provided files. See section @@ -254,8 +254,8 @@ new backend is performed separately (and in parallel) for each file. Users are advised to use the default setting. \item \code{...}: optional additional arguments passed to the \code{\link[=backendInitialize]{backendInitialize()}} method of the new \code{backend}. -\item \code{BPPARAM}: setup for the parallel processing. See \code{\link[=bpparam]{bpparam()}} for -details. +\item \code{BPPARAM}: setup for the parallel processing. See +\code{\link[BiocParallel:register]{BiocParallel::bpparam()}} for details. } } diff --git a/man/addProcessing.Rd b/man/addProcessing.Rd index 787aeabe..e431bb21 100644 --- a/man/addProcessing.Rd +++ b/man/addProcessing.Rd @@ -118,10 +118,11 @@ splitted while it defaults to \code{f = processingChunkSize(object)} for \code{applyProcessing()} splitting thus the object by default into chunks depending on \code{\link[=processingChunkSize]{processingChunkSize()}}.} -\item{BPPARAM}{Parallel setup configuration. See \code{\link[=bpparam]{bpparam()}} for more -information. This is passed directly to the \code{\link[=backendInitialize]{backendInitialize()}} method -of the \linkS4class{MsBackend}. See also \code{\link[=processingChunkSize]{processingChunkSize()}} for -additional information on parallel processing.} +\item{BPPARAM}{Parallel setup configuration. See \code{\link[BiocParallel:register]{BiocParallel::bpparam()}} +for more information. This is passed directly to the +\code{\link[=backendInitialize]{backendInitialize()}} method of the \linkS4class{MsBackend}. See also +\code{\link[=processingChunkSize]{processingChunkSize()}} for additional information on parallel +processing.} \item{...}{Additional arguments passed to internal and downstream functions.} @@ -177,8 +178,8 @@ spectrum.} value which should be subtracted from the spectrum's precursor m/z.} \item{normalized}{for \code{entropy()}: \code{logical(1)} whether the normalized -entropy should be calculated (default). See also \code{\link[=nentropy]{nentropy()}} for -details.} +entropy should be calculated (default). See also +\code{\link[MsCoreUtils:entropy]{MsCoreUtils::nentropy()}} for details.} \item{halfWindowSize}{For \code{pickPeaks()}: \code{integer(1)}, used in the identification of the mass peaks: a local maximum has to be the @@ -330,7 +331,8 @@ calculations a chunk-wise processing is generally performed. \code{\link[=chunkapply]{chunkapply()}} for details and examples. \item \code{containsMz()}: checks for each of the spectra whether they contain mass peaks with an m/z equal to \code{mz} (given acceptable difference as defined by -parameters \code{tolerance} and \code{ppm} - see \code{\link[=common]{common()}} for details). Parameter +parameters \code{tolerance} and \code{ppm} - see \code{\link[MsCoreUtils:matching]{MsCoreUtils::common()}} for +details). Parameter \code{which} allows to define whether any (\code{which = "any"}, the default) or all (\code{which = "all"}) of the \code{mz} have to match. The function returns \code{NA} if \code{mz} is of length 0 or is \code{NA}. @@ -340,7 +342,8 @@ acceptable difference as defined by parameters \code{tolerance} and \code{ppm}). Returns \code{NA} for MS1 spectra (or spectra without a precursor m/z). \item \code{entropy()}: calculates the entropy of each spectra based on the metrics suggested by Li et al. (https://doi.org/10.1038/s41592-021-01331-z). -See also \code{\link[=nentropy]{nentropy()}} in the \emph{MsCoreUtils} package for details. +See also \code{\link[MsCoreUtils:entropy]{MsCoreUtils::nentropy()}} in the \emph{MsCoreUtils} package for +details. \item \code{estimatePrecursorIntensity()}: defines the precursor intensities for MS2 spectra using the intensity of the matching MS1 peak from the closest MS1 spectrum (i.e. the last MS1 spectrum measured before the diff --git a/man/combineSpectra.Rd b/man/combineSpectra.Rd index 87cbed0d..921dfcdc 100644 --- a/man/combineSpectra.Rd +++ b/man/combineSpectra.Rd @@ -48,9 +48,9 @@ performed.} \item{FUN}{For \code{combineSpectra()}: function to combine the (peak matrices) of the spectra. Defaults to \code{\link[=combinePeaksData]{combinePeaksData()}}.} -\item{BPPARAM}{Parallel setup configuration. See \code{\link[=bpparam]{bpparam()}} for more -information. This is passed directly to the \code{\link[=backendInitialize]{backendInitialize()}} method -of the \linkS4class{MsBackend}.} +\item{BPPARAM}{Parallel setup configuration. See \code{\link[BiocParallel:register]{BiocParallel::bpparam()}} +for more information. This is passed directly to the +\code{\link[=backendInitialize]{backendInitialize()}} method of the \linkS4class{MsBackend}.} \item{y}{For \code{joinSpectraData()}: \code{DataFrame} with the spectra variables to join/add. For \code{cbind2()}: a \code{data.frame}, \code{DataFrame} or diff --git a/man/compareSpectra.Rd b/man/compareSpectra.Rd index 375671c4..e621af58 100644 --- a/man/compareSpectra.Rd +++ b/man/compareSpectra.Rd @@ -46,7 +46,7 @@ accepted difference between m/z values for peaks to be matched. This parameter is directly passed to \code{MAPFUN}.} \item{FUN}{function to compare intensities of peaks between two spectra. -Defaults to \code{\link[=ndotproduct]{ndotproduct()}}.} +Defaults to \code{\link[MsCoreUtils:distance]{MsCoreUtils::ndotproduct()}}.} \item{...}{Additional arguments passed to the internal functions.} @@ -56,9 +56,9 @@ of length 1).} } \description{ \code{compareSpectra()} compares each spectrum in \code{x} with each spectrum in \code{y} -using the function provided with \code{FUN} (defaults to \code{\link[=ndotproduct]{ndotproduct()}}). If -\code{y} is missing, each spectrum in \code{x} is compared with each other spectrum -in \code{x}. +using the function provided with \code{FUN} (defaults to +\code{\link[MsCoreUtils:distance]{MsCoreUtils::ndotproduct()}}). If \code{y} is missing, each spectrum in \code{x} is +compared with each other spectrum in \code{x}. The matching/mapping of peaks between the compared spectra is done with the \code{MAPFUN} function. The default \code{\link[=joinPeaks]{joinPeaks()}} matches peaks of both spectra and allows to keep all peaks from the first spectrum (\code{type = "left"}), diff --git a/man/estimatePrecursorIntensity.Rd b/man/estimatePrecursorIntensity.Rd index 8780aab4..672989a5 100644 --- a/man/estimatePrecursorIntensity.Rd +++ b/man/estimatePrecursorIntensity.Rd @@ -38,9 +38,9 @@ should be estimated. Defaults to \code{2L}.} spectra belong to the same original data file (sample). Defaults to \code{f = dataOrigin(x)}.} -\item{BPPARAM}{Parallel setup configuration. See \code{\link[=bpparam]{bpparam()}} for more -information. This is passed directly to the \code{\link[=backendInitialize]{backendInitialize()}} method -of the \linkS4class{MsBackend}.} +\item{BPPARAM}{Parallel setup configuration. See \code{\link[BiocParallel:register]{BiocParallel::bpparam()}} +for more information. This is passed directly to the +\code{\link[=backendInitialize]{backendInitialize()}} method of the \linkS4class{MsBackend}.} } \description{ Some MS instrument manufacturers don't provide precursor intensities for diff --git a/man/estimatePrecursorMz.Rd b/man/estimatePrecursorMz.Rd index 7bc9e6cd..48400317 100644 --- a/man/estimatePrecursorMz.Rd +++ b/man/estimatePrecursorMz.Rd @@ -19,7 +19,8 @@ precursorMz +/- (tolerance + ppm(precursorMz, ppm)) are considered.} m/z. See documentation of parameter \code{tolerance} for more information.} \item{BPPARAM}{parallel processing setup. Defaults to -\code{BPPARAM = SerialParam()}. See \code{\link[=SerialParam]{SerialParam()}} for more information.} +\code{BPPARAM = SerialParam()}. See \code{\link[BiocParallel:SerialParam-class]{BiocParallel::SerialParam()}} for +more information.} } \value{ \code{numeric} of length equal to the number of spectra in \code{object} with diff --git a/man/filterMsLevel.Rd b/man/filterMsLevel.Rd index 0ea3698b..be29771d 100644 --- a/man/filterMsLevel.Rd +++ b/man/filterMsLevel.Rd @@ -171,7 +171,8 @@ filterPrecursorPeaks( \code{filterPrecursorIsotopes()}: \code{matrix} or \code{data.frame} with definitions of isotopic substitutions. Uses by default isotopic substitutions defined from all compounds in the Human Metabolome Database (HMDB). See -\code{\link[=isotopologues]{isotopologues()}} or \code{\link[=isotopicSubstitutionMatrix]{isotopicSubstitutionMatrix()}} in the +\code{\link[MetaboCoreUtils:isotopologues]{MetaboCoreUtils::isotopologues()}} or +\code{\link[MetaboCoreUtils:isotopicSubstitutionMatrix]{MetaboCoreUtils::isotopicSubstitutionMatrix()}} in the \emph{MetaboCoreUtils} for details.} \item{tolerance}{For \code{filterMzValues()} and \code{reduceSpectra()}: @@ -182,7 +183,8 @@ tolerance for each m/z value. For \code{filterPrecursorMaxIntensity()}: \code{numeric(1)} defining the (constant) maximal accepted difference of precursor m/z values of spectra for grouping them into \emph{precursor groups}. For -\code{filterPrecursorIsotopes()}: passed directly to the \code{\link[=isotopologues]{isotopologues()}} +\code{filterPrecursorIsotopes()}: passed directly to the +\code{\link[MetaboCoreUtils:isotopologues]{MetaboCoreUtils::isotopologues()}} function. For \code{filterValues()}: \code{numeric} of any length allowing to define a maximal accepted difference between user input \code{values} and the \code{spectraVariables} values. If it is not equal to the length of the @@ -195,7 +197,7 @@ m/z values for peaks to be matched (or grouped). For \code{filterPrecursorMaxIntensity()}: \code{numeric(1)} defining the relative maximal accepted difference of precursor m/z values of spectra for grouping them into \emph{precursor groups}. For \code{filterPrecursorIsotopes()}: -passed directly to the \code{\link[=isotopologues]{isotopologues()}} function. +passed directly to the \code{\link[MetaboCoreUtils:isotopologues]{MetaboCoreUtils::isotopologues()}} function. For \code{filterValues()}: \code{numeric} of any length allowing to define a maximal accepted difference between user input \code{values} and the \code{spectraVariables} values. If it is not equal to the length of the @@ -203,7 +205,7 @@ value provided with parameter \code{spectraVariables}, \code{ppm[1]} will be recycled.} \item{charge}{For \code{deisotopeSpectra()}: expected charge of the ionized -compounds. See \code{\link[=isotopologues]{isotopologues()}} for details.} +compounds. See \code{\link[MetaboCoreUtils:isotopologues]{MetaboCoreUtils::isotopologues()}} for details.} \item{object}{\code{Spectra} object.} @@ -453,12 +455,13 @@ These operations don't affect the number of spectra in the \code{Spectra} object \itemize{ \item \code{deisotopeSpectra()}: \emph{deisotopes} each spectrum keeping only the monoisotopic peak for groups of isotopologues. Isotopologues are -estimated using the \code{\link[=isotopologues]{isotopologues()}} function from the +estimated using the \code{\link[MetaboCoreUtils:isotopologues]{MetaboCoreUtils::isotopologues()}} function from the \emph{MetaboCoreUtils} package. Note that the default parameters for isotope prediction/detection have been determined using data from the Human Metabolome Database (HMDB) and isotopes for elements other than CHNOPS might not be detected. See -parameter \code{substDefinition} in the documentation of \code{\link[=isotopologues]{isotopologues()}} for +parameter \code{substDefinition} in the documentation of +\code{\link[MetaboCoreUtils:isotopologues]{MetaboCoreUtils::isotopologues()}} for more information. The approach and code to define the parameters for isotope prediction is described \href{https://github.com/EuracBiomedicalResearch/isotopologues}{here}. diff --git a/man/joinPeaks.Rd b/man/joinPeaks.Rd index bc1fa688..f420808d 100644 --- a/man/joinPeaks.Rd +++ b/man/joinPeaks.Rd @@ -79,9 +79,9 @@ peaks in \code{x} can match up to two peaks in \code{y} hence peaks in the retur matrices might be reported multiple times. Note that if one of \code{xPrecursorMz} or \code{yPrecursorMz} are \code{NA} or if both are the same, the results are the same as with \code{\link[=joinPeaks]{joinPeaks()}}. To calculate GNPS similarity -scores, \code{\link[=gnps]{gnps()}} should be called on the aligned peak matrices (i.e. -\code{compareSpectra} should be called with \code{MAPFUN = joinPeaksGnps} and -\code{FUN = MsCoreUtils::gnps}). +scores, \code{\link[MsCoreUtils:gnps]{MsCoreUtils::gnps()}} should be called on the aligned peak +matrices (i.e. \code{compareSpectra} should be called with +\code{MAPFUN = joinPeaksGnps} and \code{FUN = MsCoreUtils::gnps}). \item \code{joinPeaksNone()}: does not perform any peak matching but simply returns the peak matrices in a \code{list}. This function should be used with the \code{MAPFUN} parameter of \code{\link[=compareSpectra]{compareSpectra()}} if the spectra similarity @@ -145,8 +145,8 @@ joinPeaksGnps(x, y, pmz_x, yPrecursorMz = NA) \itemize{ \item \code{\link[=compareSpectra]{compareSpectra()}} for the function to calculate similarities between spectra. -\item \code{\link[=gnps]{gnps()}} in the \emph{MsCoreUtils} package for more information on the GNPS -similarity score. +\item \code{\link[MsCoreUtils:gnps]{MsCoreUtils::gnps()}} in the \emph{MsCoreUtils} package for more information +on the GNPS similarity score. } } \author{ diff --git a/man/processingChunkSize.Rd b/man/processingChunkSize.Rd index a9382611..ce32edb0 100644 --- a/man/processingChunkSize.Rd +++ b/man/processingChunkSize.Rd @@ -22,8 +22,8 @@ processingChunkFactor(x) \item{object}{\code{Spectra} object.} -\item{BPPARAM}{Parallel setup configuration. See \code{\link[=bpparam]{bpparam()}} for more -information.} +\item{BPPARAM}{Parallel setup configuration. See \code{\link[BiocParallel:register]{BiocParallel::bpparam()}} +for more information.} } \value{ \code{processingChunkSize()} returns the currently defined processing diff --git a/man/spectra-plotting.Rd b/man/spectra-plotting.Rd index 6d2ec22f..50c4865a 100644 --- a/man/spectra-plotting.Rd +++ b/man/spectra-plotting.Rd @@ -140,12 +140,12 @@ plotting area.} which \code{x} should be plotted against.} \item{ppm}{for \code{plotSpectraMirror()}: m/z relative acceptable difference (in -ppm) for peaks to be considered matching (see \code{\link[=common]{common()}} for more -details).} +ppm) for peaks to be considered matching (see \code{\link[MsCoreUtils:matching]{MsCoreUtils::common()}} +for more details).} \item{tolerance}{for \code{plotSpectraMirror()}: absolute acceptable difference of -m/z values for peaks to be considered matching (see \code{\link[=common]{common()}} for more -details).} +m/z values for peaks to be considered matching (see +\code{\link[MsCoreUtils:matching]{MsCoreUtils::common()}} for more details).} \item{matchCol}{for \code{plotSpectraMirror()}: color for matching peaks.} @@ -171,10 +171,10 @@ the plot area into as many panels as there are spectra. an overlay). \item \code{plotSpectraMirror()}: plots a pair of spectra as a \emph{mirror plot}. Parameters \code{x} and \code{y} both have to be a \code{Spectra} of length 1. Matching -peaks (considering \code{ppm} and \code{tolerance}) are highlighted. See \code{\link[=common]{common()}} -for details on peak matching. Parameters \code{matchCol}, \code{matchLty}, -\code{matchLwd} and \code{matchPch} allow to customize how matching peaks are -indicated. +peaks (considering \code{ppm} and \code{tolerance}) are highlighted. See +\code{\link[MsCoreUtils:matching]{MsCoreUtils::common()}} for details on peak matching. Parameters +\code{matchCol}, \code{matchLty}, \code{matchLwd} and \code{matchPch} allow to customize +how matching peaks are indicated. } } \examples{ diff --git a/man/spectraData.Rd b/man/spectraData.Rd index 2aad735f..0f64f913 100644 --- a/man/spectraData.Rd +++ b/man/spectraData.Rd @@ -220,9 +220,9 @@ in the individual \code{matrix} of the returned \code{list}. Defaults to \code{c("mz", "value")} but any values returned by \code{peaksVariables(object)} with \code{object} being the \code{Spectra} object are supported.} -\item{BPPARAM}{Parallel setup configuration. See \code{\link[=bpparam]{bpparam()}} for more -information. See also \code{\link[=processingChunkSize]{processingChunkSize()}} for more information -on parallel processing.} +\item{BPPARAM}{Parallel setup configuration. See \code{\link[BiocParallel:register]{BiocParallel::bpparam()}} +for more information. See also \code{\link[=processingChunkSize]{processingChunkSize()}} for more +information on parallel processing.} \item{initial}{For \code{tic()}: \code{logical(1)} whether the initially reported total ion current should be reported, or whether the @@ -370,7 +370,7 @@ values for the data origin of each spectrum. \item \code{dataStorage()}: returns a \code{character} vector (same length than \code{object}) with the data storage location of each spectrum. \item \code{intensity()}: gets the intensity values from the spectra. Returns -a \code{\link[=NumericList]{NumericList()}} of \code{numeric} vectors (intensity values for each +a \code{\link[IRanges:AtomicList-class]{IRanges::NumericList()}} of \code{numeric} vectors (intensity values for each spectrum). The length of the list is equal to the number of \code{spectra} in \code{object}. \item \code{ionCount()}: returns a \code{numeric} with the sum of intensities for @@ -399,18 +399,18 @@ number of spectra). For empty spectra, \code{0} is returned. being spectrum names, length equal to the number of spectra) with the MS level for each spectrum. \item \code{mz()}: gets the mass-to-charge ratios (m/z) from the -spectra. Returns a \code{\link[=NumericList]{NumericList()}} or length equal to the number of -spectra, each element a \code{numeric} vector with the m/z values of +spectra. Returns a \code{\link[IRanges:AtomicList-class]{IRanges::NumericList()}} or length equal to the number +of spectra, each element a \code{numeric} vector with the m/z values of one spectrum. \item \code{peaksData()}: gets the \emph{peaks} data for all spectra in \code{object}. Peaks data consist of the m/z and intensity values as well as possible additional annotations (variables) of all peaks of each spectrum. The function -returns a \code{\link[=SimpleList]{SimpleList()}} of two dimensional arrays (either \code{matrix} or -\code{data.frame}), with each array providing the values for the requested -\emph{peak variables} (by default \code{"mz"} and \code{"intensity"}). Optional parameter -\code{columns} is passed to the backend's \code{peaksData()} function to allow -the selection of specific (or additional) peaks variables (columns) that -should be extracted (if available). Importantly, +returns a \code{\link[S4Vectors:SimpleList-class]{S4Vectors::SimpleList()}} of two dimensional arrays (either +\code{matrix} or \code{data.frame}), with each array providing the values for the +requested \emph{peak variables} (by default \code{"mz"} and \code{"intensity"}). +Optional parameter \code{columns} is passed to the backend's \code{peaksData()} +function to allow the selection of specific (or additional) peaks +variables (columns) that should be extracted (if available). Importantly, it is \strong{not} guaranteed that each backend supports this parameter (while each backend must support extraction of \code{"mz"} and \code{"intensity"} columns). Parameter \code{columns} defaults to \code{c("mz", "intensity")} but any value