+[ctb], Mar Garcia-Aloy [ctb] (ORCID: https://orcid.org/0000-0002-1330-6610) Last modified: 2024-12-16 09:14:28.747512 Compiled: Mon Dec 16 09:27:57 2024
Introduction
@@ -178,12 +178,12 @@
Notes on parallel processingbackendParallelFactor() function the backend
can also suggest a factor that should/could be
used for splitting and parallel processing. The default implementation
-for backendParallelFactor() is to return an empty
+for backendParallelFactor() is to return an empty
factor (factor()) hence not suggesting any
-preferred splitting. backendParallelFactor() for
+preferred splitting. backendParallelFactor() for
MsBackendMzR on the other hand returns a
factor based on the data files the data is stored in
(i.e. based on the dataStorage of the MS data).
@@ -1911,7 +1911,7 @@
backendParallelFactor()
-
The backendParallelFactor() allows a backend to suggest
+
The backendParallelFactor() allows a backend to suggest
a preferred way how the backend could be split for parallel processing.
See also the notes on parallel processing above for more information.
The default implementation returns factor() (i.e. a
@@ -2421,7 +2421,7 @@
Examples and use cases for
## file(s):## 20171016_POOL_POS_3_105-134.mzML## Processing:
-## Filter: select data origin(s) /__w/_temp/Library/msdata/sciex/20171016_POOL_POS_3_105-134.mzML [Mon Dec 9 10:48:01 2024]
-## Filter: select retention time [175..189] on MS level(s) 1 [Mon Dec 9 10:48:01 2024]
+## Filter: select data origin(s) /__w/_temp/Library/msdata/sciex/20171016_POOL_POS_3_105-134.mzML [Mon Dec 16 09:28:27 2024]
+## Filter: select retention time [175..189] on MS level(s) 1 [Mon Dec 16 09:28:27 2024]
Note that the use of the filter functions might be more efficient for
some backends, depending on their implementation, (e.g. database-based
backends could translate the filter function into a SQL
@@ -832,7 +832,7 @@
Examples and use cases for
## 4 2 NA NA## ... 20 more variables/columns.## Processing:
-## Merge 2 Spectra into one [Mon Dec 9 10:48:01 2024]
+## Merge 2 Spectra into one [Mon Dec 16 09:28:27 2024]
The resulting object contains now the data for all 4 MS2 spectra and
an union of all spectra variables from both objects.
+## Merge 2 Spectra into one [Mon Dec 16 09:28:27 2024]
+## Signal <= 10 in MS level(s) 2 set to 0 [Mon Dec 16 09:28:27 2024]
+## Remove peaks with intensities outside [0.1, Inf] in spectra of MS level(s) 2. [Mon Dec 16 09:28:27 2024]
It is possible to add also custom functions to the processing queue
of a Spectra object. Such a function must take a peaks
matrix as its first argument, have ... in the function
@@ -958,9 +958,9 @@
To evaluate which of the spectra variables were exported, we load the
exported data again and identify spectra variables in the original file
which could not be exported (because they are not defined variables in
@@ -1582,8 +1582,8 @@
A more realistic use case for mzML export would be to export MS data
after processing, such as smoothing (using the smooth()
function) and centroiding (using the pickPeaks() function)
@@ -1624,7 +1624,7 @@
+## Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 16 09:28:33 2024]
With the call the full peak data was imported from the original mzML
files into the object. This has obviously an impact on the object’s
size, which is now much larger than before.
for backendBpparam(): parameter object from the
BiocParallel package defining the parallel processing setup.
-Defaults to BPPARAM = bpparam(). See bpparam() for more
-information.
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
@@ -513,7 +513,8 @@
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
@@ -764,9 +765,9 @@
Backend functionsBiocParallel::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
dataStorage is also provided, object is subsetted to the spectra with
@@ -852,13 +853,13 @@
Backend functionsintensity(): 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
each spectrum. If the spectrum is empty (see isEmpty()),
@@ -889,8 +890,8 @@
Backend functionsmz(): 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
to the number of spectra and the number of values within each list element
@@ -1055,10 +1056,10 @@
In-memory data backends
"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.
The peaksData() function for MsBackendMemory and MsBackendDataFrame
returns a list of numericmatrix by default (with parameter
diff --git a/reference/MsBackendCached.html b/reference/MsBackendCached.html
index 710e8a65..3add8ed9 100644
--- a/reference/MsBackendCached.html
+++ b/reference/MsBackendCached.html
@@ -45,7 +45,7 @@
Spectra
- 1.17.2
+ 1.17.3
@@ -366,7 +366,7 @@
Available methodsintensity(): 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.
ionCount(): returns a numeric with the sum of intensities for
@@ -389,8 +389,8 @@
Available methodsmz(): 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
spectrum. polarity returns an integer vector (length equal
diff --git a/reference/Spectra.html b/reference/Spectra.html
index a688e7cb..c8896415 100644
--- a/reference/Spectra.html
+++ b/reference/Spectra.html
@@ -47,7 +47,7 @@
Spectra
- 1.17.2
+ 1.17.3
@@ -173,7 +173,7 @@
Parallel setup configuration. See bpparam() for more
-information. This is passed directly to the backendInitialize() method
-of the MsBackend. See also processingChunkSize() for
-additional information on parallel processing.
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.
@@ -437,7 +439,8 @@
Data an
Returns NA for MS1 spectra (or spectra without a precursor m/z).
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.
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
@@ -568,7 +571,7 @@
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"),
@@ -200,7 +200,7 @@
ArgumentsMetaboCoreUtils::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
@@ -256,7 +258,7 @@
ArgumentsMetaboCoreUtils::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
@@ -266,7 +268,7 @@
Filter content of mz() or intensity()) or applyProcessing() is called.
These operations don't affect the number of spectra in the Spectra object.
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.
Examples#> ... 16 more variables/columns.
#> Lazy evaluation queue: 1 processing step(s)#> Processing:
-#> Filter: select peaks based on user-provided ranges for 2 variables [Mon Dec 9 10:47:17 2024]
+#> Filter: select peaks based on user-provided ranges for 2 variables [Mon Dec 16 09:27:43 2024] length(res)#> [1] 2
diff --git a/reference/hidden_aliases.html b/reference/hidden_aliases.html
index efaf9793..feecdd97 100644
--- a/reference/hidden_aliases.html
+++ b/reference/hidden_aliases.html
@@ -7,7 +7,7 @@
Spectra
- 1.17.2
+ 1.17.3
diff --git a/reference/index.html b/reference/index.html
index aa0d3477..a31e6d92 100644
--- a/reference/index.html
+++ b/reference/index.html
@@ -7,7 +7,7 @@
Spectra
- 1.17.2
+ 1.17.3
diff --git a/reference/joinPeaks.html b/reference/joinPeaks.html
index 0d519303..86dffd5c 100644
--- a/reference/joinPeaks.html
+++ b/reference/joinPeaks.html
@@ -21,9 +21,9 @@
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
MAPFUN parameter of compareSpectra() if the spectra similarity
@@ -52,9 +52,9 @@
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
MAPFUN parameter of compareSpectra() if the spectra similarity
@@ -69,7 +69,7 @@
Spectra
- 1.17.2
+ 1.17.3
@@ -122,9 +122,9 @@
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
MAPFUN parameter of compareSpectra() if the spectra similarity
@@ -219,8 +219,8 @@
See also
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.
For some backends a certain type of splitting and chunk-wise processing
might be preferable. The MsBackendMzR backend for example needs to load
the MS data from the original (mzML) files, hence chunk-wise processing
-on a per-file basis would be ideal. The backendParallelFactor() function
+on a per-file basis would be ideal. The backendParallelFactor() function
for MsBackend allows backends to suggest a preferred splitting of the
data by returning a factor defining the respective data chunks. The
MsBackendMzR returns for example a factor based on the dataStorage
@@ -191,8 +191,8 @@
diff --git a/reference/spectra-plotting.html b/reference/spectra-plotting.html
index 587762d7..1d44a7d0 100644
--- a/reference/spectra-plotting.html
+++ b/reference/spectra-plotting.html
@@ -6,10 +6,10 @@
an overlay).
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.
">
Skip to contents
@@ -31,7 +31,7 @@
Spectra
- 1.17.2
+ 1.17.3
@@ -69,10 +69,10 @@
an overlay).
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.
Functions to access MS dataIRanges::NumericList() of numeric vectors (intensity values for each
spectrum). The length of the list is equal to the number of
spectra in object.
ionCount(): returns a numeric with the sum of intensities for
@@ -447,18 +447,18 @@
Functions to access MS dataIRanges::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
diff --git a/reference/spectraVariableMapping.html b/reference/spectraVariableMapping.html
index d075f2e5..d7648ce5 100644
--- a/reference/spectraVariableMapping.html
+++ b/reference/spectraVariableMapping.html
@@ -21,7 +21,7 @@
Spectra
- 1.17.2
+ 1.17.3
diff --git a/search.json b/search.json
index cf8c24b7..90fcf6e4 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Creating new `MsBackend` classes","text":"vignette briefly describes MsBackend class used Spectra package represent provide Mass Spectrometry (MS) data illustrates new backend class can created tested validity. Contributions vignette (content correction typos) requests additional details information highly welcome (ideally via pull requests github issues).","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"what-is-a-msbackend","dir":"Articles","previous_headings":"","what":"What is a MsBackend?","title":"Creating new `MsBackend` classes","text":"Spectra package separates code analysis MS data code needed import, represent provide data. former implemented Spectra class main object users use analyses. Spectra object relies -called backend provide MS data. MsBackend virtual class defines API new backend classes need implement order used Spectra object. Spectra object contains implementation MsBackend within @backend slot provides MS data Spectra object. data management thus hidden user. addition separation allows define new, alternative, data representations integrate seamlessly Spectra-based data analysis workflow. concept extension -memory -disk data representations MSnbase package (Gatto, Gibb, Rainer 2020).","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"conventions-and-definitions","dir":"Articles","previous_headings":"What is a MsBackend?","what":"Conventions and definitions","title":"Creating new `MsBackend` classes","text":"General conventions MS data Spectra : One Spectra object supposed contain MS (spectral) data multiple MS spectra. m/z values within spectrum expected sorted increasingly. Missing values (NA) m/z values supported. Properties spectrum called spectra variables. backends can define properties, minimum required set spectra variables must provided backend (even values empty). core spectra variables listed (along expected data type) coreSpectraVariables() function. dataStorage dataOrigin two special spectra variables define spectrum data stored data derived (loaded, data origin). expected typecharacter need defined backend (.e., can empty missing). MsBackend implementations can also represent purely read-data resources. case data accessor methods need implemented data replacement methods. Whether backend read-can set @readonly slot virtual MsBackend class (isReadOnly() function can used retrieve value slot). default @readonly = FALSE thus data replacement method listed section Data replacement methods implemented. read-backends (@readonly = TRUE) methods section Required methods need implemented. Backends can also partially read-, MsBackendMzR. backend allows example change spectra variables, peaks data (.e. m/z intensity values). Also, backends purely read-resources extend MsBackendCached Spectra package enable support modifying (adding) spectra variables. changes spectra variables internally cached MsBackendCached without need propagating underlying data resource (see example MsBackendMassbankSql MsBackendMassbank package).","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"notes-on-parallel-processing","dir":"Articles","previous_headings":"What is a MsBackend?","what":"Notes on parallel processing","title":"Creating new `MsBackend` classes","text":"parallel processing, Spectra splits backend based defined factor processes parallel (serial SerialParam used). splitting factor can defined Spectra setting parameter processingChunkSize. Alternatively, backendParallelFactor() function backend can also suggest factor /used splitting parallel processing. default implementation backendParallelFactor() return empty factor (factor()) hence suggesting preferred splitting. backendParallelFactor() MsBackendMzR hand returns factor based data files data stored (.e. based dataStorage MS data). Besides parallel processing, chunk-wise processing can also reduce memory demand operations, peak data current chunk needs realized memory.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"api","dir":"Articles","previous_headings":"","what":"API","title":"Creating new `MsBackend` classes","text":"MsBackend class defines core methods implemented MS backend well optional methods default implementations might implemented new backend don’t necessarily . functions described sections Required methods Optional methods, respectively. create new backend class extending virtual MsBackend needs implemented. example create thus simple class data.frame contain general spectral properties (spectra variables) two slots m/z intensity values. stored NumericList objects since m/z intensity values expected type numeric allow store data multiple spectra single backend object. also define simple constructor function returns empty instance new class. 3 slots spectraVars, mz intensity used store MS data, row spectraVars data one spectrum columns different spectra variables (.e. additional properties spectrum retention time MS level) element mz intensity numeric m/z intensity values respective spectrum. ideally also add basic validity function ensures data OK. function simply checks number rows spectraVars slot matches length mz intensity slot. can now create instance new class MsBackendTest() function. Note backend class necessarily need contain data like one example. Backends MsBackendMzR example retrieve data fly raw MS data files MsBackendSql MsBackendSql SQL database.","code":"library(Spectra) library(IRanges) setClass(\"MsBackendTest\", contains = \"MsBackend\", slots = c( spectraVars = \"data.frame\", mz = \"NumericList\", intensity = \"NumericList\" ), prototype = prototype( spectraVars = data.frame(), mz = NumericList(compress = FALSE), intensity = NumericList(compress = FALSE) )) MsBackendTest <- function() { new(\"MsBackendTest\") } setValidity(\"MsBackendTest\", function(object) { if (length(object@mz) != length(object@intensity) || length(object@mz) != nrow(object@spectraVars)) return(\"length of 'mz' and 'intensity' has to match the number of \", \"rows of 'spectraVars'\") NULL }) ## Class \"MsBackendTest\" [in \".GlobalEnv\"] ## ## Slots: ## ## Name: spectraVars mz intensity readonly version ## Class: data.frame NumericList NumericList logical character ## ## Extends: \"MsBackend\" MsBackendTest() ## An object of class \"MsBackendTest\" ## Slot \"spectraVars\": ## data frame with 0 columns and 0 rows ## ## Slot \"mz\": ## NumericList of length 0 ## ## Slot \"intensity\": ## NumericList of length 0 ## ## Slot \"readonly\": ## [1] FALSE ## ## Slot \"version\": ## [1] \"0.1\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"required-methods","dir":"Articles","previous_headings":"API","what":"Required methods","title":"Creating new `MsBackend` classes","text":"Methods listed section must implemented new class extending MsBackend. Methods ideally also implemented order listed . Also, strongly advised write dedicated unit tests newly implemented method function already development.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"datastorage","dir":"Articles","previous_headings":"API > Required methods","what":"dataStorage()","title":"Creating new `MsBackend` classes","text":"dataStorage spectra variable spectrum provides information data stored. dataStorage() method therefor return character vector length equal number spectra backend object information. backends data storage information can simple string \"memory\" \"database\" specify data spectrum stored within object database, respectively. Backend classes keep subset MS data memory need load data data files upon request use spectra variable store keep track original data file spectrum. example MsBackendMzR backend retrieves MS data --fly original data file(s) whenever m/z intensity values requested backend. Calling dataStorage() MsBackendMzR returns thus names originating files. example backend define simple dataStorage() method simply returns column \"dataStorage\" @svars (character).","code":"setMethod(\"dataStorage\", \"MsBackendTest\", function(object) { as.character(object@spectraVars$dataStorage) })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"length","dir":"Articles","previous_headings":"API > Required methods","what":"length()","title":"Creating new `MsBackend` classes","text":"length() expected return single integer total number spectra available backend class. example backend simply return number rows data.frame stored @spectraVars slot.","code":"setMethod(\"length\", \"MsBackendTest\", function(x) { nrow(x@spectraVars) })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"backendinitialize","dir":"Articles","previous_headings":"API > Required methods","what":"backendInitialize()","title":"Creating new `MsBackend` classes","text":"backendInitialize() method expected called creating instance backend class prepare (initialize) backend cases means MS data loaded. method can take parameters needed backend get loaded/initialized data (can file names load data, database connection object(s) containing data). backendInitialize() usually also special spectra variables dataStorage dataOrigin set. define backendInitialize() method takes arguments data.frame spectra variables two lists m/z intensity values spectrum. addition adding data object, function also defined dataStorage dataOrigin spectra variables. purpose two variables provide information data stored (memory example) data originating. dataOrigin example allow specify original data files individual spectra derive. can now create instance backend class fill data. thus first define MS data pass backendInitialize() method. method works compliant MsBackend API (requirement input parameters backendInitialize() method), good practice backends supposed support replacing data, add optional additional parameter data allow passing complete MS data (including m/z intensity values) function DataFrame. simplify implementation replacement methods addition also allow change backend Spectra using setBackend() new backend. thus re-implement backendInitialize() method supporting also initialize backend data frame also implement helper function checks spectra variables correct data type. function used check input data new backendInitialize() method. create backend updated backendInitialize(). backendInitialize() method implemented backend class expects user provide full MS data. however always case. backendInitialize() method MsBackendMzR backend takes example file names raw mzML, mzXML CDF files input initializes backend importing part data . Also backends defined MsBackendMgf r Biocpkg(\"MsBackendMsp\") packages work way thus allow import MS data specific file formats. backendInitialize() method backend defined MsBackendSql hand takes connection database containing data input performs sanity checks data load data backend. subsequent data access handled methods backend class SQL calls database. purpose backendInitialize() method initialize prepare data way can accessed Spectra object (initialized backend class). Whether data loaded backendInitialize() method memory simply referenced within backend class matter long backend able provide data accessor methods. Note also backendInitialize() function ideally also perform data sanity checks (e.g. whether spectra variables correct data type etc).","code":"setMethod( \"backendInitialize\", \"MsBackendTest\", function(object, svars, mz, intensity) { if (!is.data.frame(svars)) stop(\"'svars' needs to be a 'data.frame' with spectra variables\") if (is.null(svars$dataStorage)) svars$dataStorage <- \"\" if (is.null(svars$dataOrigin)) svars$dataOrigin <- \"\" object@spectraVars <- svars object@mz <- NumericList(mz, compress = FALSE) object@intensity <- NumericList(intensity, compress = FALSE) validObject(object) object }) ## A data.frame with spectra variables. svars <- data.frame(msLevel = c(1L, 2L, 2L), rtime = c(1.2, 1.3, 1.4)) ## m/z values for each spectrum. mzs <- list(c(12.3, 13.5, 16.5, 17.5), c(45.1, 45.2), c(64.4, 123.1, 124.1)) ## intensity values for each spectrum. ints <- list(c(123.3, 153.6, 2354.3, 243.4), c(100, 80.1), c(12.3, 35.2, 100)) ## Create and initialize the backend be <- backendInitialize(MsBackendTest(), svars = svars, mz = mzs, intensity = ints) be ## An object of class \"MsBackendTest\" ## Slot \"spectraVars\": ## msLevel rtime dataStorage dataOrigin ## 1 1 1.2 ## 2 2 1.3 ## 3 2 1.4 ## ## Slot \"mz\": ## NumericList of length 3 ## [[1]] 12.3 13.5 16.5 17.5 ## [[2]] 45.1 45.2 ## [[3]] 64.4 123.1 124.1 ## ## Slot \"intensity\": ## NumericList of length 3 ## [[1]] 123.3 153.6 2354.3 243.4 ## [[2]] 100 80.1 ## [[3]] 12.3 35.2 100 ## ## Slot \"readonly\": ## [1] FALSE ## ## Slot \"version\": ## [1] \"0.1\" #' Helper function to check if core spectra variables have the correct #' data type. #' #' @param x `data.frame` with the data for spectra variables. #' #' @param name `character` defining the column names (spectra variables) of `x` #' for which the correct data type should be evaluated. .sv_valid_data_type <- function(x, name = colnames(x)) { sv <- coreSpectraVariables()[names(coreSpectraVariables()) %in% name] for (i in seq_along(sv)) { if (!is(x[, names(sv[i])], sv[i])) stop(\"Spectra variabe \\\"\", names(sv[i]), \"\\\" is not of type \", sv[i], call. = FALSE) } TRUE } setMethod( \"backendInitialize\", \"MsBackendTest\", function(object, svars, mz, intensity, data) { if (!missing(data)) { svars <- as.data.frame( data[, !colnames(data) %in% c(\"mz\", \"intensity\")]) if (any(colnames(data) == \"mz\")) mz <- data$mz if (any(colnames(data) == \"intensity\")) intensity <- data$intensity } if (!is.data.frame(svars)) stop(\"'svars' needs to be a 'data.frame' with spectra variables\") if (is.null(svars$dataStorage)) svars$dataStorage <- \"\" if (is.null(svars$dataOrigin)) svars$dataOrigin <- \"\" .sv_valid_data_type(svars) object@spectraVars <- svars object@mz <- NumericList(mz, compress = FALSE) object@intensity <- NumericList(intensity, compress = FALSE) validObject(object) object }) ## Create and initialize the backend be <- backendInitialize(MsBackendTest(), svars = svars, mz = mzs, intensity = ints) be ## An object of class \"MsBackendTest\" ## Slot \"spectraVars\": ## msLevel rtime dataStorage dataOrigin ## 1 1 1.2 ## 2 2 1.3 ## 3 2 1.4 ## ## Slot \"mz\": ## NumericList of length 3 ## [[1]] 12.3 13.5 16.5 17.5 ## [[2]] 45.1 45.2 ## [[3]] 64.4 123.1 124.1 ## ## Slot \"intensity\": ## NumericList of length 3 ## [[1]] 123.3 153.6 2354.3 243.4 ## [[2]] 100 80.1 ## [[3]] 12.3 35.2 100 ## ## Slot \"readonly\": ## [1] FALSE ## ## Slot \"version\": ## [1] \"0.1\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"spectravariables","dir":"Articles","previous_headings":"API > Required methods","what":"spectraVariables()","title":"Creating new `MsBackend` classes","text":"spectraVariables() method return character vector names available spectra variables backend. backend class support defining providing spectra variables, MsBackend class must provide also core spectra variables (correct data type). Since data file formats provide values spectra variables can however also NA (exception spectra variable \"dataStorage\"). coreSpectraVariables() function returns full list mandatory spectra variables along expected data type. typical spectraVariables() method MsBackend class thus implemented similarly one MsBackendTest test backend: return union core spectra variables names available spectra variables within backend object.","code":"coreSpectraVariables() ## msLevel rtime acquisitionNum ## \"integer\" \"numeric\" \"integer\" ## scanIndex mz intensity ## \"integer\" \"NumericList\" \"NumericList\" ## dataStorage dataOrigin centroided ## \"character\" \"character\" \"logical\" ## smoothed polarity precScanNum ## \"logical\" \"integer\" \"integer\" ## precursorMz precursorIntensity precursorCharge ## \"numeric\" \"numeric\" \"integer\" ## collisionEnergy isolationWindowLowerMz isolationWindowTargetMz ## \"numeric\" \"numeric\" \"numeric\" ## isolationWindowUpperMz ## \"numeric\" setMethod(\"spectraVariables\", \"MsBackendTest\", function(object) { union(names(coreSpectraVariables()), colnames(object@spectraVars)) }) spectraVariables(be) ## [1] \"msLevel\" \"rtime\" ## [3] \"acquisitionNum\" \"scanIndex\" ## [5] \"mz\" \"intensity\" ## [7] \"dataStorage\" \"dataOrigin\" ## [9] \"centroided\" \"smoothed\" ## [11] \"polarity\" \"precScanNum\" ## [13] \"precursorMz\" \"precursorIntensity\" ## [15] \"precursorCharge\" \"collisionEnergy\" ## [17] \"isolationWindowLowerMz\" \"isolationWindowTargetMz\" ## [19] \"isolationWindowUpperMz\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"spectradata","dir":"Articles","previous_headings":"API > Required methods","what":"spectraData()","title":"Creating new `MsBackend` classes","text":"spectraData() method return full spectra data within backend DataFrame object (defined S4Vectors package). second parameter columns allows define names spectra variables returned DataFrame. row data frame represent one spectrum, column spectra variable. Columns \"mz\" \"intensity\" (requested) contain NumericList m/z intensity values spectra. DataFrame must provide values (even NA) requested spectra variables backend (including core spectra variables). now first problem toy backend class, since keep spectra variable data simple data.frame without constraints required columns etc. simple solution (also used backend classes Spectra package) fill missing spectra variables --fly returned DataFrame. thus define simple helper function adds columns missing values (correct data type) core spectra variables available within backend result. next implement spectraData() method uses helper function fill eventually missing core spectra variables. Note also function return DataFrame even single column. alternative, also initialize @spectraVars data frame within backendInitialize() method adding columns spectra variables provided user require data frame always contains core spectra variables. Extracting spectra data (single spectra variables full data) might thus efficient --fly initialization eventual missing spectra variables, backend class also larger memory footprint even spectra variables missing values spectra need stored within object. can now use spectraData() either extract full spectra data backend, data selected spectra variables.","code":"#' @description Add columns with missing core spectra variables. #' #' @param x `data.frame` or `DataFrame` with some spectra variables. #' #' @param core_vars `character` with core spectra variable names that should #' be added to `x` if not already present. #' .fill_core_variables <- function(x, core_vars = names(coreSpectraVariables())) { fill_vars <- setdiff(core_vars, colnames(x)) core_type <- coreSpectraVariables() n <- nrow(x) if (length(fill_vars)) { fill <- lapply(fill_vars, function(z) { rep(as(NA, core_type[z]), n) }) names(fill) <- fill_vars x <- cbind(x, as.data.frame(fill)) } x } setMethod( \"spectraData\", \"MsBackendTest\", function(object, columns = spectraVariables(object)) { if (!all(columns %in% spectraVariables(object))) stop(\"Some of the requested spectra variables are not available\") ## Add m/z and intensity values to the result res <- DataFrame(object@spectraVars) res$mz <- object@mz res$intensity <- object@intensity ## Fill with eventually missing core variables res <- .fill_core_variables( res, intersect(columns, names(coreSpectraVariables()))) res[, columns, drop = FALSE] }) ## Full data spectraData(be) ## DataFrame with 3 rows and 19 columns ## msLevel rtime acquisitionNum scanIndex mz ## ## 1 1 1.2 NA NA 12.3,13.5,16.5,... ## 2 2 1.3 NA NA 45.1,45.2 ## 3 2 1.4 NA NA 64.4,123.1,124.1 ## intensity dataStorage dataOrigin centroided smoothed ## ## 1 123.3, 153.6,2354.3,... NA NA ## 2 100.0, 80.1 NA NA ## 3 12.3, 35.2,100.0 NA NA ## polarity precScanNum precursorMz precursorIntensity precursorCharge ## ## 1 NA NA NA NA NA ## 2 NA NA NA NA NA ## 3 NA NA NA NA NA ## collisionEnergy isolationWindowLowerMz isolationWindowTargetMz ## ## 1 NA NA NA ## 2 NA NA NA ## 3 NA NA NA ## isolationWindowUpperMz ## ## 1 NA ## 2 NA ## 3 NA ## Selected variables spectraData(be, c(\"rtime\", \"mz\", \"centroided\")) ## DataFrame with 3 rows and 3 columns ## rtime mz centroided ## ## 1 1.2 12.3,13.5,16.5,... NA ## 2 1.3 45.1,45.2 NA ## 3 1.4 64.4,123.1,124.1 NA ## Only missing core spectra variables spectraData(be, c(\"centroided\", \"polarity\")) ## DataFrame with 3 rows and 2 columns ## centroided polarity ## ## 1 NA NA ## 2 NA NA ## 3 NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"peaksdata","dir":"Articles","previous_headings":"API > Required methods","what":"peaksData()","title":"Creating new `MsBackend` classes","text":"peaksData() method extracts MS peaks data backend, includes m/z intensity values MS peak spectrum. expected returned List numerical matrices columns matrix requested peaks variables (default \"mz\" \"intensity\") one spectrum. Backends must provide least two peaks variables. implement peaksData() method backend. need loop @mz @intensity slots merge m/z intensity spectrum matrix. Also, simplicity reasons, accept c(\"mz\", \"intensity\") columns parameter. expected default behavior MsBackend, general columns parameter thought allow user specify peaks variables returned matrix. method can now extract peaks data backend. peaksData() method used many data analysis functions Spectra object extract MS data, thus ideally method implemented efficient way. backend need loop lists m/z intensity values obviously ideal. Thus, storing m/z intensity values separate slots done backend might ideal. MsBackendMemory backend example stores MS data already list matrices results efficient peaksData() method (comes also larger overhead adding, replacing checking MS data). Note also backend needs provide m/z intensity values, additional peak variables also supported. MsBackendMemory class example allows store provide additional peak variables can added additional columns returned matrix. case default peaksVariables() method also overwritten list additionally available variables columns parameter peaksData() method allow selection additional peaks variables (addition required \"mz\" \"intensity\" variables).","code":"setMethod( \"peaksData\", \"MsBackendTest\", function(object, columns = c(\"mz\", \"intensity\")) { if (length(columns) != 2 && columns != c(\"mz\", \"intensity\")) stop(\"'columns' supports only \\\"mz\\\" and \\\"intensity\\\"\") mapply(mz = object@mz, intensity = object@intensity, FUN = cbind, SIMPLIFY = FALSE, USE.NAMES = FALSE) }) peaksData(be) ## [[1]] ## mz intensity ## [1,] 12.3 123.3 ## [2,] 13.5 153.6 ## [3,] 16.5 2354.3 ## [4,] 17.5 243.4 ## ## [[2]] ## mz intensity ## [1,] 45.1 100.0 ## [2,] 45.2 80.1 ## ## [[3]] ## mz intensity ## [1,] 64.4 12.3 ## [2,] 123.1 35.2 ## [3,] 124.1 100.0"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"extractbyindex-and","dir":"Articles","previous_headings":"API > Required methods","what":"extractByIndex() and [","title":"Creating new `MsBackend` classes","text":"extractByIndex() [ methods allows subset MsBackend objects. operation expected reduce MsBackend object selected spectra. methods must also support duplication (e.g. [c(1, 1, 1)] extraction arbitrary order (e.g. [c(3, 1, 5, 3)]). methods subset object, extractByIndex() supports subset integer index, [, compliant base R implementation, support subset indices logical vectors. error thrown indices bounds, method also support returning empty backend [integer()]. Note MsCoreUtils::i2index function can used check correct input (convert input integer index). extractByIndex() method used data operation analysis methods Spectra objects, [ intended used end user (needed). implement extractByIndex() backend: [ need defined default implementation base MsBackend exists. can now subset backend last two spectra. extracting second spectrum multiple times.","code":"setMethod(\"extractByIndex\", c(\"MsBackendTest\", \"ANY\"), function(object, i) { object@spectraVars <- object@spectraVars[i, ] object@mz <- object@mz[i] object@intensity <- object@intensity[i] object }) a <- extractByIndex(be, 2:3) spectraData(a) ## DataFrame with 2 rows and 19 columns ## msLevel rtime acquisitionNum scanIndex mz ## ## 1 2 1.3 NA NA 45.1,45.2 ## 2 2 1.4 NA NA 64.4,123.1,124.1 ## intensity dataStorage dataOrigin centroided smoothed polarity ## ## 1 100.0, 80.1 NA NA NA ## 2 12.3, 35.2,100.0 NA NA NA ## precScanNum precursorMz precursorIntensity precursorCharge collisionEnergy ## ## 1 NA NA NA NA NA ## 2 NA NA NA NA NA ## isolationWindowLowerMz isolationWindowTargetMz isolationWindowUpperMz ## ## 1 NA NA NA ## 2 NA NA NA a <- be[c(2, 2, 2)] spectraData(a) ## DataFrame with 3 rows and 19 columns ## msLevel rtime acquisitionNum scanIndex mz intensity ## ## 2 2 1.3 NA NA 45.1,45.2 100.0, 80.1 ## 2.1 2 1.3 NA NA 45.1,45.2 100.0, 80.1 ## 2.2 2 1.3 NA NA 45.1,45.2 100.0, 80.1 ## dataStorage dataOrigin centroided smoothed polarity precScanNum ## ## 2 NA NA NA NA ## 2.1 NA NA NA NA ## 2.2 NA NA NA NA ## precursorMz precursorIntensity precursorCharge collisionEnergy ## ## 2 NA NA NA NA ## 2.1 NA NA NA NA ## 2.2 NA NA NA NA ## isolationWindowLowerMz isolationWindowTargetMz isolationWindowUpperMz ## ## 2 NA NA NA ## 2.1 NA NA NA ## 2.2 NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"backendmerge","dir":"Articles","previous_headings":"API > Required methods","what":"backendMerge()","title":"Creating new `MsBackend` classes","text":"backendMerge() method merges (combines) MsBackend objects (type!) single instance. test backend thus need combine values @spectraVars, @mz @intensity slots. support also merging data.frames different set columns use MsCoreUtils::rbindFill() function instead simple rbind() (function joins data frames making union available columns). , implementation requires 3 loops might efficient - allows merge backends type MsBackendTest.","code":"setMethod(\"backendMerge\", \"MsBackendTest\", function(object, ...) { res <- object object <- unname(c(object, ...)) res@mz <- do.call(c, lapply(object, function(z) z@mz)) res@intensity <- do.call(c, lapply(object, function(z) z@intensity)) res@spectraVars <- do.call(MsCoreUtils::rbindFill, lapply(object, function(z) z@spectraVars)) validObject(res) res }) a <- backendMerge(be, be[2], be) a ## An object of class \"MsBackendTest\" ## Slot \"spectraVars\": ## msLevel rtime dataStorage dataOrigin ## 1 1 1.2 ## 2 2 1.3 ## 3 2 1.4 ## 21 2 1.3 ## 11 1 1.2 ## 22 2 1.3 ## 31 2 1.4 ## ## Slot \"mz\": ## NumericList of length 7 ## [[1]] 12.3 13.5 16.5 17.5 ## [[2]] 45.1 45.2 ## [[3]] 64.4 123.1 124.1 ## [[4]] 45.1 45.2 ## [[5]] 12.3 13.5 16.5 17.5 ## [[6]] 45.1 45.2 ## [[7]] 64.4 123.1 124.1 ## ## Slot \"intensity\": ## NumericList of length 7 ## [[1]] 123.3 153.6 2354.3 243.4 ## [[2]] 100 80.1 ## [[3]] 12.3 35.2 100 ## [[4]] 100 80.1 ## [[5]] 123.3 153.6 2354.3 243.4 ## [[6]] 100 80.1 ## [[7]] 12.3 35.2 100 ## ## Slot \"readonly\": ## [1] FALSE ## ## Slot \"version\": ## [1] \"0.1\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"section","dir":"Articles","previous_headings":"API > Required methods","what":"$","title":"Creating new `MsBackend` classes","text":"$ method expected extract single spectra variable backend. Parameter name allow name spectra variable return. MsBackend must support extracting core spectra variables method (even data might available variable). example implementation make use spectraData() method, efficient implementations might available well (require first subset/create DataFrame full data subset ). Also, $ method check requested spectra variable available throw error otherwise. can now extract MS levels core spectra variable available within backend. also m/z values","code":"setMethod(\"$\", \"MsBackendTest\", function(x, name) { spectraData(x, columns = name)[, 1L] }) be$msLevel ## [1] 1 2 2 be$precursorMz ## [1] NA NA NA be$mz ## NumericList of length 3 ## [[1]] 12.3 13.5 16.5 17.5 ## [[2]] 45.1 45.2 ## [[3]] 64.4 123.1 124.1"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"lengths","dir":"Articles","previous_headings":"API > Required methods","what":"lengths()","title":"Creating new `MsBackend` classes","text":"lengths() method expected return integer vector (length number spectra backend) total number peaks per spectrum. MsBackendTest can simply use lengths() method m/z intensity values . can now get peaks count per spectrum:","code":"setMethod(\"lengths\", \"MsBackendTest\", function(x, use.names = FALSE) { lengths(x@mz, use.names = use.names) }) lengths(be) ## [1] 4 2 3"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"isempty","dir":"Articles","previous_headings":"API > Required methods","what":"isEmpty()","title":"Creating new `MsBackend` classes","text":"isEmpty() method expected return spectrum information whether empty, .e. contain MS peaks (hence m/z intensity values). result method logical length equal number spectra represented backend TRUE indicating whether spectrum empty FALSE otherwise. implementation isEmpty() method use lenghts() method defined returns number MS peaks per spectrum.","code":"setMethod(\"isEmpty\", \"MsBackendTest\", function(x) { lengths(x) == 0L }) isEmpty(be) ## [1] FALSE FALSE FALSE"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"acquisitionnum","dir":"Articles","previous_headings":"API > Required methods","what":"acquisitionNum()","title":"Creating new `MsBackend` classes","text":"Extract acquisitionNum core spectra variable. method expected return integer vector length spectra represented backend. backend simply re-use spectraData() method.","code":"setMethod(\"acquisitionNum\", \"MsBackendTest\", function(object) { spectraData(object, \"acquisitionNum\")[, 1L] }) acquisitionNum(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"centroided","dir":"Articles","previous_headings":"API > Required methods","what":"centroided()","title":"Creating new `MsBackend` classes","text":"Extract spectrum information whether contains centroided data. method expected return logical vector length spectra represented backend.","code":"setMethod(\"centroided\", \"MsBackendTest\", function(object) { spectraData(object, \"centroided\")[, 1L] }) centroided(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"collisionenergy","dir":"Articles","previous_headings":"API > Required methods","what":"collisionEnergy()","title":"Creating new `MsBackend` classes","text":"Extract spectrum collision energy applied generate fragment spectrum. method expected return numeric vector length spectra represented backend (NA_real_ spectra information available, MS1 spectra).","code":"setMethod(\"collisionEnergy\", \"MsBackendTest\", function(object) { spectraData(object, \"collisionEnergy\")[, 1L] }) collisionEnergy(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"dataorigin","dir":"Articles","previous_headings":"API > Required methods","what":"dataOrigin()","title":"Creating new `MsBackend` classes","text":"Extract data origin spectra variable spectrum. spectra variable can used store origin spectra. method expected return character vector length equal number spectra represented backend.","code":"setMethod(\"dataOrigin\", \"MsBackendTest\", function(object) { spectraData(object, \"dataOrigin\")[, 1L] }) dataOrigin(be) ## [1] \"\" \"\" \"\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"intensity","dir":"Articles","previous_headings":"API > Required methods","what":"intensity()","title":"Creating new `MsBackend` classes","text":"Extract intensity values spectrum backend. result expected NumericList length equal number spectra represented backend. test backend can simply return @intensity slot since data already stored within NumericList.","code":"setMethod(\"intensity\", \"MsBackendTest\", function(object) { object@intensity }) intensity(be) ## NumericList of length 3 ## [[1]] 123.3 153.6 2354.3 243.4 ## [[2]] 100 80.1 ## [[3]] 12.3 35.2 100"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"isolationwindowlowermz","dir":"Articles","previous_headings":"API > Required methods","what":"isolationWindowLowerMz()","title":"Creating new `MsBackend` classes","text":"Extract core spectra variable isolationWindowLowerMz backend. information usually provided spectrum raw mzML files. method expected return numeric vector length equal number spectra represented backend.","code":"setMethod(\"isolationWindowLowerMz\", \"MsBackendTest\", function(object) { spectraData(object, \"isolationWindowLowerMz\")[, 1L] }) isolationWindowLowerMz(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"isolationwindowtargetmz","dir":"Articles","previous_headings":"API > Required methods","what":"isolationWindowTargetMz()","title":"Creating new `MsBackend` classes","text":"Extract core spectra variable isolationWindowTargetMz backend. information usually provided spectrum raw mzML files. method expected return numeric vector length equal number spectra represented backend.","code":"setMethod(\"isolationWindowTargetMz\", \"MsBackendTest\", function(object) { spectraData(object, \"isolationWindowTargetMz\")[, 1L] }) isolationWindowTargetMz(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"isolationwindowuppermz","dir":"Articles","previous_headings":"API > Required methods","what":"isolationWindowUpperMz()","title":"Creating new `MsBackend` classes","text":"Extract core spectra variable isolationWindowUpperMz backend. information usually provided spectrum raw mzML files. method expected return numeric vector length equal number spectra represented backend.","code":"setMethod(\"isolationWindowUpperMz\", \"MsBackendTest\", function(object) { spectraData(object, \"isolationWindowUpperMz\")[, 1L] }) isolationWindowUpperMz(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"mslevel","dir":"Articles","previous_headings":"API > Required methods","what":"msLevel()","title":"Creating new `MsBackend` classes","text":"Extract MS level spectrum backend. method expected return integer length equal number spectra represented backend.","code":"setMethod(\"msLevel\", \"MsBackendTest\", function(object) { spectraData(object, \"msLevel\")[, 1L] }) msLevel(be) ## [1] 1 2 2"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"mz","dir":"Articles","previous_headings":"API > Required methods","what":"mz()","title":"Creating new `MsBackend` classes","text":"Extract m/z values spectrum backend. result expected NumericList length equal number spectra represented backend. Also, m/z values expected ordered increasingly element (spectrum).","code":"setMethod(\"mz\", \"MsBackendTest\", function(object) { object@mz }) mz(be) ## NumericList of length 3 ## [[1]] 12.3 13.5 16.5 17.5 ## [[2]] 45.1 45.2 ## [[3]] 64.4 123.1 124.1"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"polarity","dir":"Articles","previous_headings":"API > Required methods","what":"polarity()","title":"Creating new `MsBackend` classes","text":"Extract polarity core spectra variable spectrum backend. method expected return integer length equal number spectra represented backend. Negative positive polarity expected encoded 0L 1L, respectively.","code":"setMethod(\"polarity\", \"MsBackendTest\", function(object) { spectraData(object, \"polarity\")[, 1L] }) polarity(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"precscannum","dir":"Articles","previous_headings":"API > Required methods","what":"precScanNum()","title":"Creating new `MsBackend` classes","text":"Extract acquisition number precursor spectrum. method expected return integer length equal number spectra represented backend. MS1 spectra (acquisition number precursor provided) NA_integer_ returned.","code":"setMethod(\"precScanNum\", \"MsBackendTest\", function(object) { spectraData(object, \"precScanNum\")[, 1L] }) precScanNum(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"precursorcharge","dir":"Articles","previous_headings":"API > Required methods","what":"precursorCharge()","title":"Creating new `MsBackend` classes","text":"Extract charge precursor spectrum. method expected return integer length equal number spectra represented backend. MS1 spectra (charge precursor provided) NA_integer_ returned.","code":"setMethod(\"precursorCharge\", \"MsBackendTest\", function(object) { spectraData(object, \"precursorCharge\")[, 1L] }) precursorCharge(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"precursorintensity","dir":"Articles","previous_headings":"API > Required methods","what":"precursorIntensity()","title":"Creating new `MsBackend` classes","text":"Extract intensity precursor spectrum. method expected return numeric length equal number spectra represented backend. MS1 spectra (precursor intensity fragment spectrum provided) NA_real_ returned.","code":"setMethod(\"precursorIntensity\", \"MsBackendTest\", function(object) { spectraData(object, \"precursorIntensity\")[, 1L] }) precursorIntensity(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"precursormz","dir":"Articles","previous_headings":"API > Required methods","what":"precursorMz()","title":"Creating new `MsBackend` classes","text":"Extract precursor m/z spectrum. method expected return numeric length equal number spectra represented backend. MS1 spectra (precursor m/z fragment spectrum provided) NA_real_ returned.","code":"setMethod(\"precursorMz\", \"MsBackendTest\", function(object) { spectraData(object, \"precursorMz\")[, 1L] }) precursorMz(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"rtime","dir":"Articles","previous_headings":"API > Required methods","what":"rtime()","title":"Creating new `MsBackend` classes","text":"Extract retention time spectrum. method expected return numeric length equal number spectra represented backend.","code":"setMethod(\"rtime\", \"MsBackendTest\", function(object) { spectraData(object, \"rtime\")[, 1L] }) rtime(be) ## [1] 1.2 1.3 1.4"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"scanindex","dir":"Articles","previous_headings":"API > Required methods","what":"scanIndex()","title":"Creating new `MsBackend` classes","text":"Extract scan index core spectra variable. scan index represents relative index spectrum within respective raw data file can different acquisitionNum (index spectrum recorded MS instrument). method expected return integer length equal number spectra represented backend.","code":"setMethod(\"scanIndex\", \"MsBackendTest\", function(object) { spectraData(object, \"scanIndex\")[, 1L] }) scanIndex(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"smoothed","dir":"Articles","previous_headings":"API > Required methods","what":"smoothed()","title":"Creating new `MsBackend` classes","text":"Extract smoothed core spectra variable indicates whether spectrum smoothed. variable supported backward compatibility seldomly used. method expected return logical length equal number spectra represented backend.","code":"setMethod(\"smoothed\", \"MsBackendTest\", function(object) { spectraData(object, \"smoothed\")[, 1L] }) smoothed(be) ## [1] NA NA NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"spectranames","dir":"Articles","previous_headings":"API > Required methods","what":"spectraNames()","title":"Creating new `MsBackend` classes","text":"spectraNames() can used extract (optional) names (IDs) individual spectra backend, NULL set. test backend can use rownames @spectraVars slot store spectra names. methods need implemented valid read-MsBackend class running test object described section Testing validity backend produce errors. backends support also data replacement also methods listed next section need implemented.","code":"setMethod(\"spectraNames\", \"MsBackendTest\", function(object) { rownames(object@spectraVars) }) spectraNames(be) ## [1] \"1\" \"2\" \"3\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"tic","dir":"Articles","previous_headings":"API > Required methods","what":"tic()","title":"Creating new `MsBackend` classes","text":"tic() method return total ion count (.e. sum intensities) spectrum. information usually also provided raw MS data files, can also calculated fly data. parameter initial (default TRUE) allows define whether provided original tic returned (initial = TRUE) whether tic calculated actual data (initial = FALSE). original tic values usually provided spectra variable \"totIonCurrent\". Thus, initial = TRUE, implementation return value spectra variable avaialble NA . can now either return original (initial) TIC (available). calculate TIC based actual intensity values.","code":"setMethod(\"tic\", \"MsBackendTest\", function(object, initial = TRUE) { if (initial) { if (any(spectraVariables(object) == \"totIonCurrent\")) spectraData(object, \"totIonCurrent\")[, 1L] else rep(NA_real_, length(object)) } else vapply(intensity(object), sum, numeric(1), na.rm = TRUE) }) tic(be) ## [1] NA NA NA tic(be, initial = FALSE) ## [1] 2874.6 180.1 147.5"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"data-replacement-methods","dir":"Articles","previous_headings":"API","what":"Data replacement methods","title":"Creating new `MsBackend` classes","text":"stated general description, MsBackend implementations can also purely read-resources allowing just access data, replace data. Thus, strictly required implement methods, fully functional backend suggested (much possible). backend purely read-MS data resource might even extend MsBackendCached backend defined Spectra package provides mechanism cache (spectra variable) data data.frame within object. MsBackendMassbankSql implemented MsBackendMassbank package extends example backend thus allows modifying spectra variables without changing original data MassBank SQL database.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"spectradata-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"spectraData<-","title":"Creating new `MsBackend` classes","text":"spectraData<- method allow replace data within backend. method take DataFrame full data input value expected replace full data within backend, .e. spectra variables well peak data. Also, importantly, number spectra calling spectraData<- method object . implementation can make use optional parameter data added backendInitialize() method allows fill MsBackendTest object full data. test new method extract full spectra data, add additional column (spectra variable) replace data .","code":"setReplaceMethod(\"spectraData\", \"MsBackendTest\", function(object, value) { if (!inherits(value, \"DataFrame\")) stop(\"'value' is expected to be a 'DataFrame'\") if (length(object) && length(object) != nrow(value)) stop(\"'value' has to be a 'DataFrame' with \", length(object), \" rows\") object <- backendInitialize(MsBackendTest(), data = value) object }) d <- spectraData(be) d$new_col <- c(\"a\", \"b\", \"c\") spectraData(be) <- d be$new_col ## [1] \"a\" \"b\" \"c\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"intensity-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"intensity<-","title":"Creating new `MsBackend` classes","text":"intensity<- method allow replace intensity values spectra backend. method expected replace values intensities, must change number intensities (hence peaks) spectrum (done peaksData<- method allows replace intensity m/z values time). value method ideally NumericList ensure intensity values indeed numeric. addition method implement also simple helper function checks correct length value. data replacement method needs check function thus reduces code duplication. now use method replace intensities backend modified intensities.","code":".match_length <- function(x, y) { if (length(x) != length(y)) stop(\"Length of 'value' has to match the length of 'object'\") } setReplaceMethod(\"intensity\", \"MsBackendTest\", function(object, value) { .match_length(object, value) if (!(is.list(value) || inherits(value, \"NumericList\"))) stop(\"'value' has to be a list or NumericList\") if (!all(lengths(value) == lengths(mz(object)))) stop(\"lengths of 'value' has to match the number of peaks per spectrum\") if (!inherits(value, \"NumericList\")) value <- NumericList(value, compress = FALSE) object@intensity <- value object }) intensity(be) ## NumericList of length 3 ## [[1]] 123.3 153.6 2354.3 243.4 ## [[2]] 100 80.1 ## [[3]] 12.3 35.2 100 intensity(be) <- intensity(be) - 10 intensity(be) ## NumericList of length 3 ## [[1]] 113.3 143.6 2344.3 233.4 ## [[2]] 90 70.1 ## [[3]] 2.3 25.2 90"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"mz-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"mz<-","title":"Creating new `MsBackend` classes","text":"mz<- method allow replace m/z values spectra backend. implementation can intensity<- method. m/z values within spectrum need increasingly ordered. thus also check case provided m/z values. take advantage efficient .unsorted() implementation NumericList already available, faster e.g. calling vapply(mz(), .unsorted, logical(1)).","code":"setReplaceMethod(\"mz\", \"MsBackendTest\", function(object, value) { .match_length(object, value) if (!(is.list(value) || inherits(value, \"NumericList\"))) stop(\"'value' has to be a list or NumericList\") if (!all(lengths(value) == lengths(mz(object)))) stop(\"lengths of 'value' has to match the number of peaks per spectrum\") if (!inherits(value, \"NumericList\")) value <- NumericList(value, compress = FALSE) if (any(is.unsorted(value))) stop(\"m/z values need to be increasingly sorted within each spectrum\") object@mz <- value object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"peaksdata-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"peaksData<-","title":"Creating new `MsBackend` classes","text":"peaksData<- allow replace peaks data (m/z intensity values) spectra backend. contrast mz<- intensity<- methods method also support changing number peaks per spectrum (e.g. due filtering). Parameter value list matrix objects columns \"mz\" \"intensity\". length list match number spectra backend. implementation backend class need loop list extract m/z intensity values assign @mz @intensity slots. Using peaksData<- method can now also example remove peaks.","code":"setReplaceMethod(\"peaksData\", \"MsBackendTest\", function(object, value) { if (!(is.list(value) || inherits(value, \"SimpleList\"))) stop(\"'value' has to be a list-like object\") .match_length(object, value) object@mz <- NumericList(lapply(value, \"[\", , \"mz\"), compress = FALSE) object@intensity <- NumericList(lapply(value, \"[\", , \"intensity\"), compress = FALSE) validObject(object) object }) pd <- peaksData(be) ## Remove the first peak from the first spectrum pd[[1L]] <- pd[[1L]][-1L, ] lengths(be) ## [1] 4 2 3 peaksData(be) <- pd lengths(be) ## [1] 3 2 3"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"section-1","dir":"Articles","previous_headings":"API > Data replacement methods","what":"$<-","title":"Creating new `MsBackend` classes","text":"$<- method allow replace values spectra variables also add additional spectra variables backend. replacement methods, length() value match number spectra represented backend. can now replace example existing spectra variables: even add new spectra variables. Replacement methods core spectra variables can implemented similarly.","code":"setReplaceMethod(\"$\", \"MsBackendTest\", function(x, name, value) { .match_length(x, value) if (name == \"mz\") { mz(x) <- value } else if (name == \"intensity\") { intensity(x) <- value } else { x@spectraVars[[name]] <- value } .sv_valid_data_type(x@spectraVars, name) x }) msLevel(be) ## [1] 1 2 2 be$msLevel <- c(2L, 1L, 2L) msLevel(be) ## [1] 2 1 2 be$new_var <- c(\"a\", \"b\", \"c\") be$new_var ## [1] \"a\" \"b\" \"c\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"selectspectravariables","dir":"Articles","previous_headings":"API > Data replacement methods","what":"selectSpectraVariables()","title":"Creating new `MsBackend` classes","text":"selectSpectraVariables() function allow reduce information within backend (parameter object) selected spectra variables (parameter spectraVariables). equivalent subset columns/variables. core spectra variables, specified parameter spectraVariables, values expected removed (since core spectra variables expected available even defined within backend). implementation backend remove columns @spectraVars data frame defined spectraVariables parameter. Special care given \"mz\" \"intensity\" spectra variables: selected, @mz @intensity slots initialized empty NumericList (length matching number spectra). Note also backends might throw error spectra variable required backend removed (\"dataStorage\" MsBackendMzR backend, required backend allow retrieval m/z intensity values). can now use selectSpectraVariables() remove example spectra variable \"new_var\" added . spectra variable \"new_var\" now longer available. Note however still core spectra variables listed, even selected spectraVariables parameter. variables (\"dataOrigin\") still listed spectraVariables(be2), actual values removed: \"mz\" \"intensitity\" selected, m/z intensity values get removed.","code":"setMethod( \"selectSpectraVariables\", \"MsBackendTest\", function(object, spectraVariables = spectraVariables(object)) { keep <- colnames(object@spectraVars) %in% spectraVariables object@spectraVars <- object@spectraVars[, keep, drop = FALSE] if (!any(spectraVariables == \"mz\")) object@mz <- NumericList(vector(\"list\", length(object)), compress = FALSE) if (!any(spectraVariables == \"intensity\")) object@intensity <- NumericList(vector(\"list\", length(object)), compress = FALSE) validObject(object) object }) be2 <- be be2 <- selectSpectraVariables(be2, c(\"msLevel\", \"rtime\", \"mz\", \"intensity\", \"dataStorage\")) spectraVariables(be2) ## [1] \"msLevel\" \"rtime\" ## [3] \"acquisitionNum\" \"scanIndex\" ## [5] \"mz\" \"intensity\" ## [7] \"dataStorage\" \"dataOrigin\" ## [9] \"centroided\" \"smoothed\" ## [11] \"polarity\" \"precScanNum\" ## [13] \"precursorMz\" \"precursorIntensity\" ## [15] \"precursorCharge\" \"collisionEnergy\" ## [17] \"isolationWindowLowerMz\" \"isolationWindowTargetMz\" ## [19] \"isolationWindowUpperMz\" dataOrigin(be) ## [1] \"\" \"\" \"\" dataOrigin(be2) ## [1] NA NA NA be2 <- selectSpectraVariables(be2, c(\"msLevel\", \"rtime\", \"dataStorage\")) mz(be2) ## NumericList of length 3 ## [[1]] numeric(0) ## [[2]] numeric(0) ## [[3]] numeric(0) intensity(be2) ## NumericList of length 3 ## [[1]] numeric(0) ## [[2]] numeric(0) ## [[3]] numeric(0)"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"centroided-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"centroided<-","title":"Creating new `MsBackend` classes","text":"Replace value centroided core spectra variable. provided data type must logical. re-use function .sv_valid_data_type defined backendInitialize() check correct data type core spectra variables. Alternatively, also simply re-use $<- replacement method . make whole code base backend cleaner replacing adding spectra variables handled single central function.","code":"setReplaceMethod(\"centroided\", \"MsBackendTest\", function(object, value) { object@spectraVars[[\"centroided\"]] <- value .sv_valid_data_type(object@spectraVars, \"centroided\") object }) setReplaceMethod(\"centroided\", \"MsBackendTest\", function(object, value) { object$centroided <- value object }) centroided(be) <- c(TRUE, FALSE, TRUE) centroided(be) ## [1] TRUE FALSE TRUE"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"collisionenergy-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"collisionEnergy<-","title":"Creating new `MsBackend` classes","text":"Replace values collision energy. Parameter value type numeric.","code":"setReplaceMethod(\"collisionEnergy\", \"MsBackendTest\", function(object, value) { object$collisionEnergy <- value object }) collisionEnergy(be) <- c(NA_real_, 20.0, 20.0) collisionEnergy(be) ## [1] NA 20 20"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"dataorigin-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"dataOrigin<-","title":"Creating new `MsBackend` classes","text":"Replace values data origin spectra variable. Parameter value type character.","code":"setReplaceMethod(\"dataOrigin\", \"MsBackendTest\", function(object, value) { object$dataOrigin <- value object }) dataOrigin(be) ## [1] \"\" \"\" \"\" dataOrigin(be) <- c(\"unknown\", \"file a\", \"file b\") dataOrigin(be) ## [1] \"unknown\" \"file a\" \"file b\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"datastorage-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"dataStorage<-","title":"Creating new `MsBackend` classes","text":"Replace values data storage spectra variable. Parameter value type character. Since backend really make use spectra variable, can accept character value. backends, example need load data --fly data files, spectra variable used store name data files hence need perform additional checks within replacement function.","code":"setReplaceMethod(\"dataStorage\", \"MsBackendTest\", function(object, value) { object$dataStorage <- value object }) dataStorage(be) ## [1] \"\" \"\" \"\" dataStorage(be) <- c(\"\", \"\", \"\") dataStorage(be) ## [1] \"\" \"\" \"\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"isolationwindowlowermz-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"isolationWindowLowerMz<-","title":"Creating new `MsBackend` classes","text":"Replace values isolation window lower m/z spectra variable. Parameter value type numeric (NA_real_ missing values supported, e.g. MS1 spectra).","code":"setReplaceMethod( \"isolationWindowLowerMz\", \"MsBackendTest\", function(object, value) { object$isolationWindowLowerMz <- value object }) isolationWindowLowerMz(be) <- c(NA_real_, 245.3, NA_real_) isolationWindowLowerMz(be) ## [1] NA 245.3 NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"isolationwindowtargetmz-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"isolationWindowTargetMz<-","title":"Creating new `MsBackend` classes","text":"Replace values isolation window target m/z spectra variable. Parameter value type numeric (NA_real_ missing values supported, e.g. MS1 spectra).","code":"setReplaceMethod( \"isolationWindowTargetMz\", \"MsBackendTest\", function(object, value) { object$isolationWindowTargetMz <- value object }) isolationWindowTargetMz(be) <- c(NA_real_, 245.4, NA_real_) isolationWindowTargetMz(be) ## [1] NA 245.4 NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"isolationwindowuppermz-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"isolationWindowUpperMz<-","title":"Creating new `MsBackend` classes","text":"Replace values isolation window upper m/z spectra variable. Parameter value type numeric (NA_real_ missing values supported, e.g. MS1 spectra).","code":"setReplaceMethod( \"isolationWindowUpperMz\", \"MsBackendTest\", function(object, value) { object$isolationWindowUpperMz <- value object }) isolationWindowUpperMz(be) <- c(NA_real_, 245.5, NA_real_) isolationWindowUpperMz(be) ## [1] NA 245.5 NA"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"mslevel-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"msLevel<-","title":"Creating new `MsBackend` classes","text":"Replace MS level spectra backend. Parameter value type integer. Missing values (NA_integer_) supported.","code":"setReplaceMethod(\"msLevel\", \"MsBackendTest\", function(object, value) { object$msLevel <- value object }) msLevel(be) ## [1] 2 1 2 msLevel(be) <- c(1L, 1L, 2L) msLevel(be) ## [1] 1 1 2"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"polarity-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"polarity<-","title":"Creating new `MsBackend` classes","text":"Replace values polarity spectra variables. Parameter value type integer ideally also use standard encoding 0L 1L negative positive polarity (NA_integer missing). Thus, implementation also make sure input parameter contains expected values (although strictly required).","code":"setReplaceMethod(\"polarity\", \"MsBackendTest\", function(object, value) { if (!all(value %in% c(0, 1, NA))) stop(\"'polarity' should be encoded as 0L (negative), 1L (positive) \", \"with missing values being NA_integer_\") object$polarity <- value object }) polarity(be) <- c(0L, 0L, 0L) polarity(be) ## [1] 0 0 0"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"rtime-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"rtime<-","title":"Creating new `MsBackend` classes","text":"Replace retention times spectra represented backend. Parameter value must type numeric. Also, although strict requirement, retention times ideally ordered increasingly per sample unit seconds.","code":"setReplaceMethod(\"rtime\", \"MsBackendTest\", function(object, value) { object$rtime <- value object }) rtime(be) ## [1] 1.2 1.3 1.4 rtime(be) <- rtime(be) + 2 rtime(be) ## [1] 3.2 3.3 3.4"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"smoothed-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"smoothed<-","title":"Creating new `MsBackend` classes","text":"Replace spectra variable smoothed indicates whether data smoothing operation performed spectra. Parameter value must type logical.","code":"setReplaceMethod(\"smoothed\", \"MsBackendTest\", function(object, value) { object$smoothed <- value object }) smoothed(be) <- rep(TRUE, 3) smoothed(be) ## [1] TRUE TRUE TRUE"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"spectranames-","dir":"Articles","previous_headings":"API > Data replacement methods","what":"spectraNames<-","title":"Creating new `MsBackend` classes","text":"Replace names individual spectras within backend. names, colnames rownames, spectraNames expected type character. backend implementation store spectra names rownames @spectraVars data frame.","code":"setReplaceMethod(\"spectraNames\", \"MsBackendTest\", function(object, value) { rownames(object@spectraVars) <- value object }) spectraNames(be) <- c(\"a\", \"b\", \"c\") spectraNames(be) ## [1] \"a\" \"b\" \"c\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"optional-methods","dir":"Articles","previous_headings":"API","what":"Optional methods","title":"Creating new `MsBackend` classes","text":"Default implementations methods available MsBackend classes, thus methods don’t implemented new backend. backends, depending data represented accessed within , different implementations might however efficient.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"backendbpparam","dir":"Articles","previous_headings":"API > Optional methods","what":"backendBpparam()","title":"Creating new `MsBackend` classes","text":"backendBpparam() method supposed evaluate whether provided (default) parallel processing setup supported backend. Backends support parallel processing return SerialParam() instead. default implementation shown .","code":"setMethod(\"backendBpparam\", signature = \"MsBackend\", function(object, BPPARAM = bpparam()) { ## Return SerialParam() instead to disable parallel processing BPPARAM })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"backendparallelfactor","dir":"Articles","previous_headings":"API > Optional methods","what":"backendParallelFactor()","title":"Creating new `MsBackend` classes","text":"backendParallelFactor() allows backend suggest preferred way backend split parallel processing. See also notes parallel processing information. default implementation returns factor() (.e. factor length 0) hence suggesting splitting:","code":"setMethod(\"backendParallelFactor\", \"MsBackend\", function(object, ...) { factor() })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"backendrequiredspectravariables","dir":"Articles","previous_headings":"API > Optional methods","what":"backendRequiredSpectraVariables()","title":"Creating new `MsBackend` classes","text":"backendRequiredSpectraVariables() method can implemented backend needs specific spectra variables work. default implementation : implementation MsBackendMzR returns c(\"dataStorage\", \"scanIndex\") backend needs two spectra variables load MS data --fly original data files.","code":"setMethod(\"backendRequiredSpectraVariables\", \"MsBackend\", function(object, ...) { character() })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"dropnaspectravariables","dir":"Articles","previous_headings":"API > Optional methods","what":"dropNaSpectraVariables()","title":"Creating new `MsBackend` classes","text":"dropNaSpectraVariables() supposed allow removing spectra variables data set (storage) contain missing values (.e. value spectra variable spectrum NA). function intended reduce memory requirements backends MsBackendMzR load values core spectra variables original data files, even values NA. Removing missing values backend can hence reduce size memory backend without data loss (methods extracting core spectra variables supposed always return NA values even data available - cases NA values supposed created --fly. default implementation shown .","code":"setMethod(\"dropNaSpectraVariables\", \"MsBackend\", function(object) { svs <- spectraVariables(object) svs <- svs[!(svs %in% c(\"mz\", \"intensity\"))] spd <- spectraData(object, columns = svs) keep <- !vapply1l(spd, function(z) all(is.na(z))) selectSpectraVariables(object, c(svs[keep], \"mz\", \"intensity\")) })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"isreadonly","dir":"Articles","previous_headings":"API > Optional methods","what":"isReadOnly()","title":"Creating new `MsBackend` classes","text":"isReadOnly() expected return logical(1) either TRUE FALSE indicating whether backend supports replacing data . default implementation shown .","code":"setMethod(\"isReadOnly\", \"MsBackend\", function(object) { object@readonly })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"peaksvariables","dir":"Articles","previous_headings":"API > Optional methods","what":"peaksVariables()","title":"Creating new `MsBackend` classes","text":"peaksVariables() expected return character vector names peaks variables (.e. information properties individual mass peaks) available backend. default implementation MsBackend returns default c(\"mz\", \"intensity\"). method implemented backends (eventually) also provide additional peaks variables. default implementation shown .","code":"setMethod(\"peaksVariables\", \"MsBackend\", function(object) { c(\"mz\", \"intensity\") })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"uniquemslevels","dir":"Articles","previous_headings":"API > Optional methods","what":"uniqueMsLevels()","title":"Creating new `MsBackend` classes","text":"method return unique MS level(s) spectra within backend. default implementation shown . method thus retrieves first MS levels spectra calls unique() . Database-based backends might avoid eventually heavy operation selecting unique MS levels directly using SQL call.","code":"setMethod(\"uniqueMsLevels\", \"MsBackend\", function(object, ...) { unique(msLevel(object)) })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"precursormz-","dir":"Articles","previous_headings":"API > Optional methods","what":"precursorMz<-","title":"Creating new `MsBackend` classes","text":"Replace values precursor m/z spectra variable. Parameter value type numeric (NA_real_ missing values supported, e.g. MS1 spectra). default implementation uses $<- method:","code":"setReplaceMethod(\"precursorMz\", \"MsBackend\", function(object, ..., value) { object$precursorMz <- value object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"ioncount","dir":"Articles","previous_headings":"API > Optional methods","what":"ionCount()","title":"Creating new `MsBackend` classes","text":"ionCount() method return numeric (length equal number spectra represented backend) sum intensities within spectrum. empty spectra NA_real_ returned. method default implementation method.","code":"setMethod(\"ionCount\", \"MsBackend\", function(object) { vapply1d(intensity(object), sum, na.rm = TRUE) })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"iscentroided","dir":"Articles","previous_headings":"API > Optional methods","what":"isCentroided()","title":"Creating new `MsBackend` classes","text":"method return information spectrum whether centroided. contrast centroided() method heuristic approach used. default implementation shown .","code":"setMethod(\"isCentroided\", \"MsBackend\", function(object, ...) { vapply1l(peaksData(object), .peaks_is_centroided) })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"reset","dir":"Articles","previous_headings":"API > Optional methods","what":"reset()","title":"Creating new `MsBackend` classes","text":"special method backends may implement support, don’t necessary . method called reset,Spectra method supposed restore data original state. default implementation MsBackend shown simply returns backend -. MsBackendSql backend MsBackendSql package contrast re-initializes data using data database.","code":"setMethod(\"reset\", \"MsBackend\", function(object) { object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"export","dir":"Articles","previous_headings":"API > Optional methods","what":"export()","title":"Creating new `MsBackend` classes","text":"method export data MsBackend. method called export,Spectra method passes second argument function. export,MsBackend implementation thus expected take Spectra object second argument data taken exported. Implementation method optional. implementation method MsBackendMzR backend shown . See alternatively also MsBackendMgf package implementation MsBackendMgf backend.","code":"setMethod(\"export\", \"MsBackendMzR\", function(object, x, file = tempfile(), format = c(\"mzML\", \"mzXML\"), copy = FALSE, BPPARAM = bpparam()) { l <- length(x) file <- sanitize_file_name(file) if (length(file) == 1) file <- rep_len(file, l) if (length(file) != l) stop(\"Parameter 'file' has to be either of length 1 or \", length(x), \", i.e. 'length(x)'.\", call. = FALSE) f <- factor(file, levels = unique(file)) tmp <- bpmapply(.write_ms_data_mzR, split(x, f), levels(f), MoreArgs = list(format = format, copy = copy), BPPARAM = BPPARAM) })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"split","dir":"Articles","previous_headings":"API > Optional methods","what":"split()","title":"Creating new `MsBackend` classes","text":"split() method allow split MsBackend list MsBackend objects. default implementation shown .","code":"setMethod(\"split\", \"MsBackend\", function(x, f, drop = FALSE, ...) { split.default(x, f, drop = drop, ...) })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"supportssetbackend","dir":"Articles","previous_headings":"API > Optional methods","what":"supportsSetBackend()","title":"Creating new `MsBackend` classes","text":"Whether MsBackend supports setBackend() method allows change backend Spectra object one another backend. support setBackend() backend needs parameter data backendInitialize() method allows initialized DataFrame containing full spectra data. default implementation shown .","code":"setMethod(\"supportsSetBackend\", \"MsBackend\", function(object, ...) { !isReadOnly(object) })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filterdataorigin","dir":"Articles","previous_headings":"API > Optional methods","what":"filterDataOrigin()","title":"Creating new `MsBackend` classes","text":"filter* methods expected take MsBackend subset based criteria. also [ method used perform subset operation, methods might allow efficient ways subset data e.g. performing operation within database dedicated SQL call. default implementation available every filter function thus method needs implemented data storage/representation within backend allow efficient operation. filter methods expected return subset backend (.e. instance backend class , less spectra). filterDataOrigin() subset backend spectra dataOrigin spectra variable matching values provided dataOrigin parameter. default implementation MsBackend shown .","code":"setMethod(\"filterDataOrigin\", \"MsBackend\", function(object, dataOrigin = character()) { if (length(dataOrigin)) { object <- object[dataOrigin(object) %in% dataOrigin] if (is.unsorted(dataOrigin)) object[order(match(dataOrigin(object), dataOrigin))] else object } else object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filterdatastorage","dir":"Articles","previous_headings":"API > Optional methods","what":"filterDataStorage()","title":"Creating new `MsBackend` classes","text":"Similar filterDataOrigin(), filterDataStorage() subset backend spectra dataStorage spectra variable matching values provided dataStorage parameter.","code":"setMethod(\"filterDataStorage\", \"MsBackend\", function(object, dataStorage = character()) { if (length(dataStorage)) { object <- object[dataStorage(object) %in% dataStorage] if (is.unsorted(dataStorage)) object[order(match(dataStorage(object), dataStorage))] else object } else object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filteremptyspectra","dir":"Articles","previous_headings":"API > Optional methods","what":"filterEmptySpectra()","title":"Creating new `MsBackend` classes","text":"filterEmptySpectra() remove empty spectra (.e. spectra without mass peaks) backend. method expected return subset backend. default implementation MsBackend shown .","code":"setMethod(\"filterEmptySpectra\", \"MsBackend\", function(object, ...) { if (!length(object)) return(object) object[as.logical(lengths(object))] })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filterisolationwindow","dir":"Articles","previous_headings":"API > Optional methods","what":"filterIsolationWindow()","title":"Creating new `MsBackend` classes","text":"filterIsolationWindow() filters backend spectra provided mz value within isolationWindowLowerMz() isolationWindowUpperMz(). parameter mz defining target m/z expected numeric length 1. default implementation MsBackend shown .","code":"setMethod(\"filterIsolationWindow\", \"MsBackend\", function(object, mz = numeric(), ...) { if (length(mz)) { if (length(mz) > 1) stop(\"'mz' is expected to be a single m/z value\") keep <- which(isolationWindowLowerMz(object) <= mz & isolationWindowUpperMz(object) >= mz) object[keep] } else object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filtermslevel","dir":"Articles","previous_headings":"API > Optional methods","what":"filterMsLevel()","title":"Creating new `MsBackend` classes","text":"filterMsLevel() method expected reduce backend spectra provided MS level(s). Parameter msLevel integer (length). default implementation MsBackend shown .","code":"setMethod(\"filterMsLevel\", \"MsBackend\", function(object, msLevel = integer()) { if (length(msLevel)) { object[msLevel(object) %in% msLevel] } else object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filterpolarity","dir":"Articles","previous_headings":"API > Optional methods","what":"filterPolarity()","title":"Creating new `MsBackend` classes","text":"filterPolarity() method expected subset backend spectra matching provided polarity (polarities). Parameter polarity integer (length). default implementation MsBackend shown .","code":"setMethod(\"filterPolarity\", \"MsBackend\", function(object, polarity = integer()) { if (length(polarity)) object[polarity(object) %in% polarity] else object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filterprecursormzrange","dir":"Articles","previous_headings":"API > Optional methods","what":"filterPrecursorMzRange()","title":"Creating new `MsBackend` classes","text":"filterPrecursorMzRange() method filters backend spectra precursorMz provided m/z range (parameter mz). method previously named filterPrecursorMz(). Parameter mz expected numeric length 2 defining lower upper limit precursor m/z range. default implementation MsBackend shown .","code":"library(MsCoreUtils) ## ## Attaching package: 'MsCoreUtils' ## The following objects are masked from 'package:Spectra': ## ## bin, entropy, smooth ## The following object is masked from 'package:stats': ## ## smooth setMethod(\"filterPrecursorMzRange\", \"MsBackend\", function(object, mz = numeric()) { if (length(mz)) { mz <- range(mz) keep <- which(between(precursorMz(object), mz)) object[keep] } else object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filterprecursormzvalues","dir":"Articles","previous_headings":"API > Optional methods","what":"filterPrecursorMzValues()","title":"Creating new `MsBackend` classes","text":"filterPrecursorMzValues() method filters backend spectra m/z values matching provided m/z value(s). Parameters ppm tolerance (expected numeric length 1) allow define conditions relaxed matching. Parameter mz numeric (length). default implementation MsBackend shown . .values_match_mz function used function defined :","code":"setMethod(\"filterPrecursorMzValues\", \"MsBackend\", function(object, mz = numeric(), ppm = 20, tolerance = 0) { if (length(mz)) { object[.values_match_mz(precursorMz(object), mz = mz, ppm = ppm, tolerance = tolerance)] } else object }) .values_match_mz <- function(x, mz, ppm = 20, tolerance = 0) { o <- order(x, na.last = NA) cmn <- common(x[o], sort(mz), tolerance = tolerance, ppm = ppm, duplicates = \"keep\", .check = FALSE) sort(o[cmn]) }"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filterprecursorcharge","dir":"Articles","previous_headings":"API > Optional methods","what":"filterPrecursorCharge()","title":"Creating new `MsBackend` classes","text":"filterPrecursorCharge() method filters backend spectra matching precursor charge. Parameter z defining requested precursor charge integer (length). default implementation MsBackend shown .","code":"setMethod(\"filterPrecursorCharge\", \"MsBackend\", function(object, z = integer()) { if (length(z)) { keep <- which(precursorCharge(object) %in% z) object[keep] } else object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filterprecursorscan","dir":"Articles","previous_headings":"API > Optional methods","what":"filterPrecursorScan()","title":"Creating new `MsBackend` classes","text":"filterPrecursorScan() method filters backend parent (e.g. MS1) children scans (e.g. MS2) acquisition number acquisitionNum. Parameter f defines backend split (default original data file) avoid selecting spectra different samples/files. default implementation MsBackend shown .","code":"setMethod(\"filterPrecursorScan\", \"MsBackend\", function(object, acquisitionNum = integer(), f = dataOrigin(object)) { if (length(acquisitionNum) && length(f)) { if (!is.factor(f)) f <- factor(f, exclude = character()) keep <- unsplit(lapply(split(object, f = f), function(z, an) { .filterSpectraHierarchy(acquisitionNum(z), precScanNum(z), an) }, an = acquisitionNum), f = f) object[keep] } else object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"filterrt","dir":"Articles","previous_headings":"API > Optional methods","what":"filterRt()","title":"Creating new `MsBackend` classes","text":"filterRt() method filters backend spectra retention time provided rt range. Parameter rt expected numeric length 2 defining lower upper bound range. Parameter msLevel. (note . name parameter!) can optionally used restrict filtering selected MS levels (.e. RT filter applied spectra selected MS levels spectra different MS level returned well). default implementation MsBackend shown .","code":"setMethod(\"filterRt\", \"MsBackend\", function(object, rt = numeric(), msLevel. = uniqueMsLevels(object)) { if (length(rt)) { rt <- range(rt) sel_ms <- msLevel(object) %in% msLevel. sel_rt <- between(rtime(object), rt) & sel_ms object[sel_rt | !sel_ms] } else object })"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"implementation-notes","dir":"Articles","previous_headings":"API","what":"Implementation notes","title":"Creating new `MsBackend` classes","text":"tutorial implemented simple -memory MsBackend scratch. many real-life situation might however better extend pre-defined backend classes Spectra package avoid duplicating functionality. good starting point might MsBackendMemory backend -memory data representation, MsBackendCached backends retrieve data inherently read-resources (database connection raw data files) still need support adding spectra variables changing values spectra variables. Similarly, purpose backend import export data specific format, MsBackendMemory might extended single method (backendInitialize()) need implemented new class: new backendInitialize() call code import data new file format store within available slots MsBackendMemory object. Examples backends provided MsBackendMgf MsBackendMsp classes.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"testing-the-validity-of-the-backend","dir":"Articles","previous_headings":"","what":"Testing the validity of the backend","title":"Creating new `MsBackend` classes","text":"Spectra package provides set unit tests allow check backend compliance MsBackend. load test suite call tests. tests performed variable current workspace (case instance MsBackendTest class).","code":"library(testthat) test_suite <- system.file(\"test_backends\", \"test_MsBackend\", package = \"Spectra\") test_dir(test_suite, stop_on_failure = TRUE)"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/MsBackend.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"Creating new `MsBackend` classes","text":"","code":"sessionInfo() ## R Under development (unstable) (2024-12-04 r87420) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 24.04.1 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] MsCoreUtils_1.19.0 IRanges_2.41.2 Spectra_1.17.2 ## [4] BiocParallel_1.41.0 S4Vectors_0.45.2 BiocGenerics_0.53.3 ## [7] generics_0.1.3 BiocStyle_2.35.0 ## ## loaded via a namespace (and not attached): ## [1] cli_3.6.3 knitr_1.49 rlang_1.1.4 ## [4] xfun_0.49 ProtGenerics_1.39.0 textshaping_0.4.1 ## [7] clue_0.3-66 jsonlite_1.8.9 htmltools_0.5.8.1 ## [10] ragg_1.3.3 sass_0.4.9 rmarkdown_2.29 ## [13] evaluate_1.0.1 jquerylib_0.1.4 MASS_7.3-61 ## [16] fastmap_1.2.0 yaml_2.3.10 lifecycle_1.0.4 ## [19] bookdown_0.41 BiocManager_1.30.25 cluster_2.1.7 ## [22] compiler_4.5.0 codetools_0.2-20 fs_1.6.5 ## [25] htmlwidgets_1.6.4 MetaboCoreUtils_1.15.0 systemfonts_1.1.0 ## [28] digest_0.6.37 R6_2.5.1 parallel_4.5.0 ## [31] bslib_0.8.0 tools_4.5.0 pkgdown_2.1.1.9000 ## [34] cachem_1.1.0 desc_1.4.3"},{"path":[]},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra-large-scale.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Large-scale data handling and processing with Spectra","text":"Spectra package supports handling processing also large mass spectrometry (MS) data sets. dedicated backends, load MS data requested/needed, memory demand can minimized. Examples backends MsBackendMzR MsBackendOfflineSql (defined MsBackendSql package). addition, Spectra supports chunk-wise data processing, hence parts data loaded memory processed time. document provide information large scale data can best processed Spectra package.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra-large-scale.html","id":"memory-requirements-of-different-data-representations","dir":"Articles","previous_headings":"","what":"Memory requirements of different data representations","title":"Large-scale data handling and processing with Spectra","text":"Spectra package separates functionality process analyze MS data (implemented Spectra class) code defines MS data stored. latter, different implementations MsBackend class available, either optimized performance (MsBackendMemory MsBackendDataFrame) low memory requirement (MsBackendMzR, MsBackendOfflineSql implemented MsBackendSql package, smallest possible memory footprint enables also analysis large data sets). load MS data 4 test files Spectra using MsBackendMzR backend. resulting Spectra uses MsBackendMzR data representation. backend load general spectra data memory full MS data (.e., m/z intensity values individual mass peaks) loaded requested needed. contrast -memory backend, memory footprint backend thus lower. create Spectra keeps full data memory changing backend MsBackendMemory backend compare sizes objects. Keeping full data memory requires thus considerably memory. next disable parallel processing Spectra allow unbiased estimation memory usage.","code":"library(Spectra) #' Define the file names from which to import the data fls <- c( system.file(\"TripleTOF-SWATH\", \"PestMix1_DDA.mzML\", package = \"msdata\"), system.file(\"TripleTOF-SWATH\", \"PestMix1_SWATH.mzML\", package = \"msdata\"), system.file(\"sciex\", \"20171016_POOL_POS_1_105-134.mzML\", package = \"msdata\"), system.file(\"sciex\", \"20171016_POOL_POS_3_105-134.mzML\", package = \"msdata\")) #' Creating a Spectra object representing the MS data sps_mzr <- Spectra(fls, source = MsBackendMzR()) sps_mzr ## MSn data (Spectra) with 18463 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 1 0.231 1 ## 2 1 0.351 2 ## 3 1 0.471 3 ## 4 1 0.591 4 ## 5 1 0.711 5 ## ... ... ... ... ## 18459 1 258.636 927 ## 18460 1 258.915 928 ## 18461 1 259.194 929 ## 18462 1 259.473 930 ## 18463 1 259.752 931 ## ... 33 more variables/columns. ## ## file(s): ## PestMix1_DDA.mzML ## PestMix1_SWATH.mzML ## 20171016_POOL_POS_1_105-134.mzML ## ... 1 more files sps_mem <- setBackend(sps_mzr, MsBackendMemory()) print(object.size(sps_mzr), units = \"MB\") ## 5.2 Mb print(object.size(sps_mem), units = \"MB\") ## 140.1 Mb #' Disable parallel processing globally register(SerialParam())"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra-large-scale.html","id":"chunk-wise-and-parallel-processing","dir":"Articles","previous_headings":"","what":"Chunk-wise and parallel processing","title":"Large-scale data handling and processing with Spectra","text":"Operations peaks data time memory demanding tasks. generally apply function , modify m/z /intensity values. Among functions example functions filter, remove combine mass peaks (filterMzRange(), filterIntensity() combinePeaks()) functions perform calculations peaks data (bin() pickPeaks()) also functions provide information , summarize spectra (lengths() ionCount()). functions, peaks data needs present memory -disk backends, MsBackendMzR, need thus first import data data storage. However, loading full peaks data memory might possible large data sets. Loading processing data smaller chunks however reduce memory demand hence allow process also data sets. MsBackendMzR MsBackendHdf5Peaks backends data automatically split processed data storage files. backends chunk-wise processing can enabled defining processingChunkSize Spectra, .e. number spectra peaks data loaded processed iteration. processingChunkFactor() function can used evaluate data split. use function evaluate chunk-wise processing performed two Spectra objects. Spectra -memory backend empty factor() returned, thus, chunk-wise processing performed. next evaluate whether Spectra MsBackendMzR -disk backend use chunk-wise processing. data thus split processed original file, data imported. next specifically define chunk-size Spectra processingChunkSize() function. setting chunk size, also Spectra -memory backend use chunk-wise processing. repeat Spectra object: Spectra MsBackendMzR backend now split data equally sized arbitrary chunks longer original data file. Setting processingChunkSize thus overrides splitting suggested backend. set processingChunkSize, operation involving peaks data default performed chunk-wise manner. Thus, calling ionCount() Spectra now split data chunks 3000 spectra sum intensities (per spectrum) chunk chunk. chunk-wise processing reduces memory demand operations, splitting merging data results can negatively impact performance. Thus, small data sets Spectra -memory backends generally benefit type processing. computationally intense operation hand, chunk-wise processing advantage, chunks can () processed parallel (depending parallel processing setup). Note chunk-wise processing affects functions involve actual peak data. Subset operations reduce number spectra (filterRt() [) bypass mechanism applied immediately data. evaluation chunk-wise processing see also issue Spectra github repository.","code":"processingChunkFactor(sps_mem) ## factor() ## Levels: processingChunkFactor(sps_mzr) |> table() ## ## /__w/_temp/Library/msdata/TripleTOF-SWATH/PestMix1_DDA.mzML ## 7602 ## /__w/_temp/Library/msdata/TripleTOF-SWATH/PestMix1_SWATH.mzML ## 8999 ## /__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML ## 931 ## /__w/_temp/Library/msdata/sciex/20171016_POOL_POS_3_105-134.mzML ## 931 processingChunkSize(sps_mem) <- 3000 processingChunkFactor(sps_mem) |> table() ## ## 1 2 3 4 5 6 7 ## 3000 3000 3000 3000 3000 3000 463 processingChunkSize(sps_mzr) <- 3000 processingChunkFactor(sps_mzr) |> table() ## ## 1 2 3 4 5 6 7 ## 3000 3000 3000 3000 3000 3000 463 tic <- ionCount(sps_mem)"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra-large-scale.html","id":"notes-and-suggestions-for-parallel-or-chunk-wise-processing","dir":"Articles","previous_headings":"","what":"Notes and suggestions for parallel or chunk-wise processing","title":"Large-scale data handling and processing with Spectra","text":"Estimating memory usage R tends difficult, MS data sets 100 samples whenever processing tends take longer expected suggested enable chunk-wise processing (already used, MsBackendMzR). Spectra uses BiocParallel package parallel processing. parallel processing setup can configured globally registering preferred setup using register() function (e.g. register(SnowParam(4)) use socket-based parallel processing Windows using 4 different R processes). Parallel processing can disabled setting register(SerialParam()). Chunk-wise processing default run parallel, depending configured parallel processing setup. Parallel processing (also chunk-wise processing) computational overhead, data needs split merged. Thus, operations data sets avoiding mechanism can efficient (e.g. -memory backends small data sets).","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra-large-scale.html","id":"spectra-functions-supporting-or-using-parallel-processing","dir":"Articles","previous_headings":"","what":"Spectra functions supporting or using parallel processing","title":"Large-scale data handling and processing with Spectra","text":"functions allow configure parallel processing using dedicated parameter allows define split data parallel (chunk-wise) processing. functions : applyProcessing(): parameter f (defaults processingChunkFactor(object)) can used define split process data parallel. combineSpectra(): parameter p (defaults x$dataStorage) defines data split processed parallel. estimatePrecursorIntensity(): parameter f (defaults dataOrigin(x)) defines splitting processing. represent original data files spectra data derives . intensity(): parameter f (defaults processingChunkFactor(object)) defines data split parallel processing. mz(): parameter f (defaults processingChunkFactor(object)) defines data split parallel processing. peaksData(): parameter f (defaults processingChunkFactor(object)) defines data split parallel processing. setBackend(): parameter f (defaults processingChunkFactor(object)) defines data split parallel processing. Functions perform chunk-wise (parallel) processing natively, .e., based processingChunkFactor: containsMz(). containsNeutralLoss(). ionCount(). isCentroided(). isEmpty().","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra-large-scale.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"Large-scale data handling and processing with Spectra","text":"","code":"sessionInfo() ## R Under development (unstable) (2024-12-04 r87420) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 24.04.1 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] Spectra_1.17.2 BiocParallel_1.41.0 S4Vectors_0.45.2 ## [4] BiocGenerics_0.53.3 generics_0.1.3 BiocStyle_2.35.0 ## ## loaded via a namespace (and not attached): ## [1] jsonlite_1.8.9 compiler_4.5.0 BiocManager_1.30.25 ## [4] Rcpp_1.0.13-1 Biobase_2.67.0 parallel_4.5.0 ## [7] cluster_2.1.7 jquerylib_0.1.4 systemfonts_1.1.0 ## [10] IRanges_2.41.2 textshaping_0.4.1 yaml_2.3.10 ## [13] fastmap_1.2.0 R6_2.5.1 ProtGenerics_1.39.0 ## [16] knitr_1.49 htmlwidgets_1.6.4 MASS_7.3-61 ## [19] bookdown_0.41 desc_1.4.3 bslib_0.8.0 ## [22] rlang_1.1.4 cachem_1.1.0 xfun_0.49 ## [25] fs_1.6.5 MsCoreUtils_1.19.0 sass_0.4.9 ## [28] cli_3.6.3 pkgdown_2.1.1.9000 ncdf4_1.23 ## [31] digest_0.6.37 mzR_2.41.1 MetaboCoreUtils_1.15.0 ## [34] lifecycle_1.0.4 clue_0.3-66 evaluate_1.0.1 ## [37] codetools_0.2-20 ragg_1.3.3 rmarkdown_2.29 ## [40] tools_4.5.0 htmltools_0.5.8.1"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Description and usage of Spectra objects","text":"Spectra package provides scalable flexible infrastructure represent, retrieve handle mass spectrometry (MS) data. Spectra object provides user single standardized interface access manipulate MS data supporting, concept exchangeable backends, large variety different ways store retrieve mass spectrometry data. backends range mzML/mzXML/CDF files, simple flat files, database systems. vignette provides general examples descriptions Spectra package. Additional information tutorials available, SpectraTutorials, MetaboAnnotationTutorials, also (Rainer et al. 2022). information handle (parallel) process large-scale data sets see Large-scale data handling processing Spectra vignette.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"Description and usage of Spectra objects","text":"package can installed BiocManager package. install BiocManager use install.packages(\"BiocManager\") , , BiocManager::install(\"Spectra\") install Spectra.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"general-usage","dir":"Articles","previous_headings":"","what":"General usage","title":"Description and usage of Spectra objects","text":"Mass spectrometry data Spectra objects can thought list individual spectra, spectrum set variables associated . Besides core spectra variables (MS level retention time) arbitrary number optional variables can assigned spectrum. core spectra variables accessor method guaranteed value returned (NA information available). core variables data type (alphabetically ordered): acquisitionNum integer(1): index acquisition spectrum MS run. centroided logical(1): whether spectrum profile centroid mode. collisionEnergy numeric(1): collision energy used create MSn spectrum. dataOrigin character(1): origin spectrum’s data, e.g. mzML file read. dataStorage character(1): (current) storage location spectrum data. value depends backend used handle provide data. -memory backend like MsBackendDataFrame \"\", -disk backend MsBackendHdf5Peaks name HDF5 file spectrum’s peak data stored. intensity numeric: intensity values spectrum’s peaks. isolationWindowLowerMz numeric(1): lower m/z isolation window (MSn) spectrum measured. isolationWindowTargetMz numeric(1): target m/z isolation window (MSn) spectrum measured. isolationWindowUpperMz numeric(1): upper m/z isolation window (MSn) spectrum measured. msLevel integer(1): MS level spectrum. mz numeric: m/z values spectrum’s peaks. polarity integer(1): polarity spectrum (0 1 representing negative positive polarity, respectively). precScanNum integer(1): scan (acquisition) number precursor MSn spectrum. precursorCharge integer(1): charge precursor MSn spectrum. precursorIntensity numeric(1): intensity precursor MSn spectrum. precursorMz numeric(1): m/z precursor MSn spectrum. rtime numeric(1): retention time spectrum. scanIndex integer(1): index spectrum within (raw) file. smoothed logical(1): whether spectrum smoothed. details individual variables getter/setter function see help Spectra (?Spectra). Also note variables suggested, required characterize spectrum. Also, make sense MSn, MS1 spectra.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"creating-spectra-objects","dir":"Articles","previous_headings":"General usage","what":"Creating Spectra objects","title":"Description and usage of Spectra objects","text":"simplest way create Spectra object defining DataFrame corresponding spectra data (using corresponding spectra variable names column names) passing Spectra constructor function. create object set 3 spectra providing MS level, olarity also additional annotations ID HMDB (human metabolome database) name. m/z intensity values spectrum provided list numeric values. Alternatively, possible import spectra data mass spectrometry raw files mzML/mzXML CDF format. create Spectra object two mzML files define use MsBackendMzR backend store data (note requires mzR package installed). backend, specifically designed raw MS data, keeps subset spectra variables memory reading m/z intensity values original data files demand. See section Backends details backends properties. Spectra object sps_sciex allows now access spectra data 1862 MS1 spectra uses MsBackendMzR backend (Spectra object sps created previous code block uses default MsBackendMemory).","code":"library(Spectra) spd <- DataFrame( msLevel = c(2L, 2L, 2L), polarity = c(1L, 1L, 1L), id = c(\"HMDB0000001\", \"HMDB0000001\", \"HMDB0001847\"), name = c(\"1-Methylhistidine\", \"1-Methylhistidine\", \"Caffeine\")) ## Assign m/z and intensity values. spd$mz <- list( c(109.2, 124.2, 124.5, 170.16, 170.52), c(83.1, 96.12, 97.14, 109.14, 124.08, 125.1, 170.16), c(56.0494, 69.0447, 83.0603, 109.0395, 110.0712, 111.0551, 123.0429, 138.0662, 195.0876)) spd$intensity <- list( c(3.407, 47.494, 3.094, 100.0, 13.240), c(6.685, 4.381, 3.022, 16.708, 100.0, 4.565, 40.643), c(0.459, 2.585, 2.446, 0.508, 8.968, 0.524, 0.974, 100.0, 40.994)) sps <- Spectra(spd) sps ## MSn data (Spectra) with 3 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## 1 2 NA NA ## 2 2 NA NA ## 3 2 NA NA ## ... 18 more variables/columns. fls <- dir(system.file(\"sciex\", package = \"msdata\"), full.names = TRUE) sps_sciex <- Spectra(fls, source = MsBackendMzR()) sps_sciex ## MSn data (Spectra) with 1862 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 1 0.280 1 ## 2 1 0.559 2 ## 3 1 0.838 3 ## 4 1 1.117 4 ## 5 1 1.396 5 ## ... ... ... ... ## 1858 1 258.636 927 ## 1859 1 258.915 928 ## 1860 1 259.194 929 ## 1861 1 259.473 930 ## 1862 1 259.752 931 ## ... 33 more variables/columns. ## ## file(s): ## 20171016_POOL_POS_1_105-134.mzML ## 20171016_POOL_POS_3_105-134.mzML"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"accessing-spectrum-data","dir":"Articles","previous_headings":"General usage","what":"Accessing spectrum data","title":"Description and usage of Spectra objects","text":"detailed Spectra objects can contain arbitrary number properties spectrum (called spectra variables). available variables can listed spectraVariables() method: two Spectra contain different set variables: besides \"msLevel\", \"polarity\", \"id\" \"name\", specified Spectra object sps, contains variables \"rtime\", \"acquisitionNum\" \"scanIndex\". part core variables defining spectrum accessor methods exist. use msLevel() rtime() access MS levels retention times spectra sps. specify retention times spectra sps thus NA returned . Spectra object sps_sciex contains many variables, extracted mzML files. extract retention times first spectra object. Note addition accessor functions also possible use $ extract specific spectra variable. extract name compounds sps can use sps$name, , extract MS levels sps$msLevel. also replace specific spectra variables using either dedicated method $. specify spectra sps represent centroided data. $ operator can also used add arbitrary new spectra variables Spectra object. add SPLASH key spectra. new spectra variable now listed additional variable result spectraVariables() function can directly access content sps$splash. spectrum can different number mass peaks, consisting mass--charge (m/z) associated intensity value. can extracted mz() intensity() functions, return list numeric values. Peak data can also extracted peaksData() function returns list numerical matrices peak variables m/z intensity values. peak variables available Spectra object can determined peaksVariables() function. can passed peaksData() function parameter columns extract peak variables interest. default peaksData() extracts m/z intensity values. Note get result using () method coerce Spectra object list SimpleList: spectraData() function returns DataFrame full data spectrum (except m/z intensity values), selected spectra variables (can specified columns parameter). extract spectra data variables \"msLevel\", \"id\" \"name\". Spectra one-dimensional objects storing spectra, even different files samples, single list. Specific variables thus used define originating file extracted sample measured. data origin spectrum can extracted dataOrigin() function. sps, Spectra created DataFrame, NA specify data origin: dataOrigin sps_sciex, Spectra initialized data mzML files, contrast, returns originating file names: current data storage location spectrum can retrieved dataStorage variable, return arbitrary string Spectra use -memory backend file data stored -disk backends: Certain backends (MsBackendMemory MsBackendDataFrame) support also additional peaks variables. present, must already present backend gets initialized. future dedicated function allowing add peaks variables available. thus first extract full data (including peaks variables) sps spectra object add column \"peak_anno\" peak annotations individual peak. Importantly, peak variables, value needs assigned individual peak, even NA (lengths() new peak variable must match lengths() mz intensity, .e. number peaks per spectrum). parameter peaksVariables() (currently available backendInitialize() method MsBackendMemory MsBackendDataFrame) allows define columns input data contain peaks variables (case \"mz\", \"intensity\" additional \"peak_anno\" column). Full peak data can extracted peaksData() function second parameter columns allowing define peak variables return. extract peak data second spectrum. can also use peaksData() function extract values individual peak variables. Peak variables can also extracted using $ method: Similar spectra variables also possible replace values existing peaks variables using $<- function.","code":"spectraVariables(sps) ## [1] \"msLevel\" \"rtime\" ## [3] \"acquisitionNum\" \"scanIndex\" ## [5] \"dataStorage\" \"dataOrigin\" ## [7] \"centroided\" \"smoothed\" ## [9] \"polarity\" \"precScanNum\" ## [11] \"precursorMz\" \"precursorIntensity\" ## [13] \"precursorCharge\" \"collisionEnergy\" ## [15] \"isolationWindowLowerMz\" \"isolationWindowTargetMz\" ## [17] \"isolationWindowUpperMz\" \"id\" ## [19] \"name\" spectraVariables(sps_sciex) ## [1] \"msLevel\" \"rtime\" ## [3] \"acquisitionNum\" \"scanIndex\" ## [5] \"dataStorage\" \"dataOrigin\" ## [7] \"centroided\" \"smoothed\" ## [9] \"polarity\" \"precScanNum\" ## [11] \"precursorMz\" \"precursorIntensity\" ## [13] \"precursorCharge\" \"collisionEnergy\" ## [15] \"isolationWindowLowerMz\" \"isolationWindowTargetMz\" ## [17] \"isolationWindowUpperMz\" \"peaksCount\" ## [19] \"totIonCurrent\" \"basePeakMZ\" ## [21] \"basePeakIntensity\" \"ionisationEnergy\" ## [23] \"lowMZ\" \"highMZ\" ## [25] \"mergedScan\" \"mergedResultScanNum\" ## [27] \"mergedResultStartScanNum\" \"mergedResultEndScanNum\" ## [29] \"injectionTime\" \"filterString\" ## [31] \"spectrumId\" \"ionMobilityDriftTime\" ## [33] \"scanWindowLowerLimit\" \"scanWindowUpperLimit\" msLevel(sps) ## [1] 2 2 2 rtime(sps) ## [1] NA NA NA head(rtime(sps_sciex)) ## [1] 0.280 0.559 0.838 1.117 1.396 1.675 sps$name ## [1] \"1-Methylhistidine\" \"1-Methylhistidine\" \"Caffeine\" sps$msLevel ## [1] 2 2 2 sps$centroided <- TRUE centroided(sps) ## [1] TRUE TRUE TRUE sps$splash <- c( \"splash10-00di-0900000000-037d24a7d65676b7e356\", \"splash10-00di-0900000000-03e99316bd6c098f5d11\", \"splash10-000i-0900000000-9af60e39c843cb715435\") mz(sps) ## NumericList of length 3 ## [[1]] 109.2 124.2 124.5 170.16 170.52 ## [[2]] 83.1 96.12 97.14 109.14 124.08 125.1 170.16 ## [[3]] 56.0494 69.0447 83.0603 109.0395 110.0712 111.0551 123.0429 138.0662 195.0876 intensity(sps) ## NumericList of length 3 ## [[1]] 3.407 47.494 3.094 100 13.24 ## [[2]] 6.685 4.381 3.022 16.708 100 4.565 40.643 ## [[3]] 0.459 2.585 2.446 0.508 8.968 0.524 0.974 100 40.994 peaksVariables(sps) ## [1] \"mz\" \"intensity\" pks <- peaksData(sps) pks[[1]] ## mz intensity ## [1,] 109.20 3.407 ## [2,] 124.20 47.494 ## [3,] 124.50 3.094 ## [4,] 170.16 100.000 ## [5,] 170.52 13.240 as(sps, \"SimpleList\") ## List of length 3 spectraData(sps, columns = c(\"msLevel\", \"id\", \"name\")) ## DataFrame with 3 rows and 3 columns ## msLevel id name ## ## 1 2 HMDB0000001 1-Methylhistidine ## 2 2 HMDB0000001 1-Methylhistidine ## 3 2 HMDB0001847 Caffeine dataOrigin(sps) ## [1] NA NA NA head(basename(dataOrigin(sps_sciex))) ## [1] \"20171016_POOL_POS_1_105-134.mzML\" \"20171016_POOL_POS_1_105-134.mzML\" ## [3] \"20171016_POOL_POS_1_105-134.mzML\" \"20171016_POOL_POS_1_105-134.mzML\" ## [5] \"20171016_POOL_POS_1_105-134.mzML\" \"20171016_POOL_POS_1_105-134.mzML\" dataStorage(sps) ## [1] \"\" \"\" \"\" head(basename(dataStorage(sps_sciex))) ## [1] \"20171016_POOL_POS_1_105-134.mzML\" \"20171016_POOL_POS_1_105-134.mzML\" ## [3] \"20171016_POOL_POS_1_105-134.mzML\" \"20171016_POOL_POS_1_105-134.mzML\" ## [5] \"20171016_POOL_POS_1_105-134.mzML\" \"20171016_POOL_POS_1_105-134.mzML\" ## Extract the full data from a spectrum spd <- spectraData(sps, columns = union(spectraVariables(sps), peaksVariables(sps))) ## Add a new column with a *annotation* for each peak spd$peak_anno <- list(c(\"a\", NA_character_, \"b\", \"c\", \"d\"), c(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\"), c(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\")) ## lengths have to match: lengths(spd$peak_anno) ## [1] 5 7 9 lengths(spd$mz) ## [1] 5 7 9 sps2 <- Spectra(spd, backend = MsBackendMemory(), peaksVariables = c(\"mz\", \"intensity\", \"peak_anno\")) peaksVariables(sps2) ## [1] \"mz\" \"intensity\" \"peak_anno\" peaksData(sps2, columns = peaksVariables(sps2))[[2L]] ## mz intensity peak_anno ## 1 83.10 6.685 a ## 2 96.12 4.381 b ## 3 97.14 3.022 c ## 4 109.14 16.708 d ## 5 124.08 100.000 e ## 6 125.10 4.565 f ## 7 170.16 40.643 g ## Peak annotations for the first spectrum peaksData(sps2, \"peak_anno\")[[1L]] ## peak_anno ## 1 a ## 2 ## 3 b ## 4 c ## 5 d ## Peak annotations for the second spectrum peaksData(sps2, \"peak_anno\")[[2L]] ## peak_anno ## 1 a ## 2 b ## 3 c ## 4 d ## 5 e ## 6 f ## 7 g sps2$peak_anno ## [[1]] ## [1] \"a\" NA \"b\" \"c\" \"d\" ## ## [[2]] ## [1] \"a\" \"b\" \"c\" \"d\" \"e\" \"f\" \"g\" ## ## [[3]] ## [1] \"a\" \"b\" \"c\" \"d\" \"e\" \"f\" \"g\" \"h\" \"i\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"filtering-aggregating-and-merging-spectra-data","dir":"Articles","previous_headings":"General usage","what":"Filtering, aggregating and merging spectra data","title":"Description and usage of Spectra objects","text":"Various functions available filter, subset merge Spectra objects. can generally subdivided functions subset filter spectra data operations filter mass peak data. third category function allows aggregate data within Spectra merge combine multiple Spectra objects one. Functions various categories described following subsections. Please refer function’s documentation details information.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"filter-spectra-data","dir":"Articles","previous_headings":"General usage > Filtering, aggregating and merging spectra data","what":"Filter spectra data","title":"Description and usage of Spectra objects","text":"functions comprise subset operations reduce total number spectra Spectra object well filter functions reduce content Spectra’s spectra data (.e. content spectraVariables()). functions thus don’t change affect mass peaks data Spectra’s individual spectra. [: operation reduce Spectra object selected elements. dropNaSpectraVariables(): drops spectraVariables() contain missing values. function returns Spectra object number elements, eventually fewer spectra variables. filterAcquisitionNum(): retains spectra certain acquisition numbers. filterDataOrigin(): subsets spectra specific origins. filterDataStorage(): subsets spectra certain data storage files. filterEmptySpectra(): removes spectra without mass peaks. filterIsolationWindow(): keeps spectra provided mz isolation window (m/z range). filterMsLevel(): filters MS level. filterPolarity(): filters polarity. filterPrecursorCharge(): retains (MSn) spectra specified precursor charge(s). filterPrecursorIsotopes(): identifies precursor ions (fragment spectra) represent isotopes molecule. spectra groups spectrum monoisotopic precursor ion returned. MS1 spectra returned without filtering. filterPrecursorMaxIntensity(): filters spectra keeping, groups spectra similar precursor m/z, one spectrum highest precursor intensity. MS1 spectra returned without filtering. filterPrecursorMzRange(): retains (MSn) spectra precursor m/z within provided m/z range. filterPrecursorMzValues((): retains (MSn) spectra precursor m/z value matching provided value(s) considering also tolerance ppm. filterPrecursorScan(): retains (parent children) scans acquisition number. filterRanges(): filters Spectra object based (multiple) user defined numeric ranges one available (numeric) spectra variables. filterRt(): filters based retention time range. filterValues(): filters Spectra object based similarities numeric values one available spectra variables. selectSpectraVariables(): reduces (spectra) data within object selected spectra variables.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"filter-or-aggregate-mass-peak-data","dir":"Articles","previous_headings":"General usage > Filtering, aggregating and merging spectra data","what":"Filter or aggregate mass peak data","title":"Description and usage of Spectra objects","text":"function filter aggregate mass peak data (peaksData()) spectrum Spectra without changing total number spectra. combinePeaks(): groups peaks within spectrum based similarity m/z values combines single peak per peak group. deisotopeSpectra(): deisotopes individual spectrum keeping monoisotopic peak peaks groups potential isotopologues. filterFourierTransformArtefacts(): removes (Orbitrap) fast fourier transform artifact peaks spectra. filterIntensity(): filter spectrum keeping peaks intensities meeting certain criteria. filterMzRange(): filters mass peaks keeping (removing) m/z within provided m/z range. filterMzValues(): filters mass peaks within spectrum keeping (removing) m/z matching provided value(s). filterPeaksRanges(): filters mass peaks using set range-based filters numeric spectra peaks variables. filterPrecursorPeaks(): removes peaks either m/z value matching precursor m/z respective spectrum (parameter mz = \"==\") peaks m/z value larger equal precursor m/z (parameter mz = \">=\"). reduceSpectra(): filters individual spectra keeping largest peak groups peaks similar m/z values.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"merging-aggregating-and-splitting","dir":"Articles","previous_headings":"General usage > Filtering, aggregating and merging spectra data","what":"Merging, aggregating and splitting","title":"Description and usage of Spectra objects","text":"c(): combine several Spectra single Spectra object. combineSpectra(): allows combine MS data sets spectra single spectrum per set. Thus, instead filtering data, function aggregates . joinSpectraData(): merge DataFrame existing spectra data. split(): splits Spectra object based provided grouping factor.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"examples-and-use-cases-for-filter-operations","dir":"Articles","previous_headings":"General usage > Filtering, aggregating and merging spectra data","what":"Examples and use cases for filter operations","title":"Description and usage of Spectra objects","text":"example, use filterValues() function retain spectra base peak m/z close 100 (+/- 30 ppm) retention time around 230 (+/- 5 s). , demonstrate usage filterRanges() function filter spectra based ranges values variables base peak m/z, peak count, retention time. one spectrum matches ranges. Another option filterValues() filterRanges() use parameter match = \"\", retains spectra match one conditions instead match . Let’s run code change match parameter time: can see many spectra passed filtering step time. example use specific functions select spectra measured second mzML file subsequently filter retain spectra measured 175 189 seconds measurement run. addition, Spectra support also subsetting [. perform filtering [ -based subsetting. equivalent using filter function shown , added benefit filtering recorded processing slot. Note use filter functions might efficient backends, depending implementation, (e.g. database-based backends translate filter function SQL condition perform subsetting already within database). Multiple Spectra objects can also combined single Spectra c() concatenateSpectra() function. resulting Spectra object contain union spectra variables individual objects. combine Spectra object sps additional object containing another MS2 spectrum Caffeine. Next combine two objects. resulting object contains now data 4 MS2 spectra union spectra variables objects. second object additional spectra variable instrument present sps spectra object thus get value NA variable. Sometimes spectra variables might required (e.g. also many empty). might specifically interesting also Spectra containing data large experiments, can significantly reduce object’s size memory. cases selectSpectraVariables() function can used retain specified spectra variables.","code":"sps_sub <- filterValues(sps_sciex, spectraVariables = c(\"basePeakMZ\", \"rtime\"), values = c(123.089, 230), tolerance = c(0,5), ppm = c(30, 0), match = \"all\") length(sps_sub) ## [1] 72 sps_ranges <- filterRanges(sps_sciex, spectraVariables = c(\"basePeakMZ\",\"peaksCount\", \"rtime\"), ranges = c(123.09,124, 3500, 3520, 259, 260), match = \"all\") length(sps_ranges) ## [1] 1 sps_ranges <- filterRanges(sps_sciex, spectraVariables = c(\"basePeakMZ\", \"peaksCount\", \"rtime\"), ranges = c(123.09, 124, 3500, 3520, 259, 260), match = \"any\") length(sps_ranges) ## [1] 473 fls <- unique(dataOrigin(sps_sciex)) file_2 <- filterDataOrigin(sps_sciex, dataOrigin = fls[2]) length(file_2) ## [1] 931 sps_sub <- filterRt(file_2, rt = c(175, 189)) length(sps_sub) ## [1] 50 sps_sciex[sps_sciex$dataOrigin == fls[2] & sps_sciex$rtime >= 175 & sps_sciex$rtime <= 189] ## MSn data (Spectra) with 50 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 1 175.212 628 ## 2 1 175.491 629 ## 3 1 175.770 630 ## 4 1 176.049 631 ## 5 1 176.328 632 ## ... ... ... ... ## 46 1 187.768 673 ## 47 1 188.047 674 ## 48 1 188.326 675 ## 49 1 188.605 676 ## 50 1 188.884 677 ## ... 33 more variables/columns. ## ## file(s): ## 20171016_POOL_POS_3_105-134.mzML sps_sciex |> filterDataOrigin(fls[2]) |> filterRt(c(175, 189)) ## MSn data (Spectra) with 50 spectra in a MsBackendMzR backend: ## msLevel rtime scanIndex ## ## 1 1 175.212 628 ## 2 1 175.491 629 ## 3 1 175.770 630 ## 4 1 176.049 631 ## 5 1 176.328 632 ## ... ... ... ... ## 46 1 187.768 673 ## 47 1 188.047 674 ## 48 1 188.326 675 ## 49 1 188.605 676 ## 50 1 188.884 677 ## ... 33 more variables/columns. ## ## file(s): ## 20171016_POOL_POS_3_105-134.mzML ## Processing: ## Filter: select data origin(s) /__w/_temp/Library/msdata/sciex/20171016_POOL_POS_3_105-134.mzML [Mon Dec 9 10:48:01 2024] ## Filter: select retention time [175..189] on MS level(s) 1 [Mon Dec 9 10:48:01 2024] caf_df <- DataFrame(msLevel = 2L, name = \"Caffeine\", id = \"HMDB0001847\", instrument = \"Agilent 1200 RRLC; Agilent 6520 QTOF\", splash = \"splash10-0002-0900000000-413259091ba7edc46b87\", centroided = TRUE) caf_df$mz <- list(c(110.0710, 138.0655, 138.1057, 138.1742, 195.9864)) caf_df$intensity <- list(c(3.837, 32.341, 0.84, 0.534, 100)) caf <- Spectra(caf_df) sps <- concatenateSpectra(sps, caf) sps ## MSn data (Spectra) with 4 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## 1 2 NA NA ## 2 2 NA NA ## 3 2 NA NA ## 4 2 NA NA ## ... 20 more variables/columns. ## Processing: ## Merge 2 Spectra into one [Mon Dec 9 10:48:01 2024] spectraVariables(sps) ## [1] \"msLevel\" \"rtime\" ## [3] \"acquisitionNum\" \"scanIndex\" ## [5] \"dataStorage\" \"dataOrigin\" ## [7] \"centroided\" \"smoothed\" ## [9] \"polarity\" \"precScanNum\" ## [11] \"precursorMz\" \"precursorIntensity\" ## [13] \"precursorCharge\" \"collisionEnergy\" ## [15] \"isolationWindowLowerMz\" \"isolationWindowTargetMz\" ## [17] \"isolationWindowUpperMz\" \"id\" ## [19] \"name\" \"splash\" ## [21] \"instrument\" sps$instrument ## [1] NA ## [2] NA ## [3] NA ## [4] \"Agilent 1200 RRLC; Agilent 6520 QTOF\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"data-manipulations","dir":"Articles","previous_headings":"General usage","what":"Data manipulations","title":"Description and usage of Spectra objects","text":"analyses require manipulation mass peak data (.e. m/z /intensity values). One example remove peaks spectrum intensity lower certain threshold. perform operation replaceIntensitiesBelow() function replace peak intensities 10 spectrum sps value 0. result intensities 10 set 0 peaks. Zero-intensity peaks (peaks missing intensities) can removed filterIntensity() function specifying lower required intensity level optionally also upper intensity limit. filterIntensity() supports also user-provided function passed parameter intensity allow e.g. remove peaks smaller median peak intensity spectrum. See examples ?filterIntensity help page details. Note data manipulations Spectra objects immediately applied peak data. added called processing queue applied time peak data accessed (peaksData(), mz() intensity() functions). Thanks processing queue data manipulation operations also possible read-backends (e.g. mzML-file based backends database-based backends). information number processing steps can seen (next Lazy evaluation queue). possible add also custom functions processing queue Spectra object. function must take peaks matrix first argument, ... function definition must return peaks matrix (peaks matrix numeric two-column matrix first column containing peaks’ m/z values second corresponding intensities). define function divides intensities peak value can passed argument y. Object sps_2 now 3 processing steps lazy evaluation queue. Calling intensity() object now return intensities half intensities original objects sps. Alternatively define function returns maximum peak spectrum (note: use unname() function remove names results): spectrum sps_2 thus contains single peak. parameter spectraVariables addProcessing() function allows addition define spectra variables passed (addition peaks matrix) user-provided function. enable example calculate neutral loss spectra Spectra subtracting precursor m/z m/z spectrum (note also dedicated neutralLoss() function perform operation efficiently). tool example precursor m/z values defined, thus first set arbitrary values. define function neutral_loss calculates difference precursor m/z fragment peak’s m/z. addition need ensure peaks resulting spectra ordered (delta) m/z values. Note , order able access precursor m/z spectrum within function, add parameter function name spectrum variable want access (case precursorMz). call addProcessing() spectraVariables = \"precursorMz\" specify spectra variable passed along function. can see, precursor m/z subtracted m/z respective spectrum. better version function, calculates neutral loss spectra MS level 2 spectra neutral_loss function . Since accessing also spectrum’s MS level call addProcessing() adding also spectra variable msLevel spectraVariables parameter. Note however msLevel spectra variable default renamed spectrumMsLevel prior passing function. thus use parameter called spectrumMsLevel neutral_loss function instead msLevel. Using concept also possible provide spectrum-specific user-defined value processing function. variable simply added first new spectra variable Spectra object variable passed along function way passed precursor m/z function . Another example spectra processing potentially helpful spectral matching reference fragment spectra libraries function removes fragment peaks m/z matching precursor m/z spectrum. define function takes peaks matrix precursor m/z input evaluates closest() function MsCoreUtils whether spectrum contains peaks m/z value matching one precursor (given tolerance ppm). returned peaks matrix contains peaks except matching precursor m/z. can now add processing step Spectra object. result, peaks matching precursor m/z (tolerance = 0.1 ppm = 0) removed. reference, original peak matrices shown . Note can also perform relaxed matching m/z values passing different value tolerance function: Since data manipulations change original intensity m/z values, possible restore original data. can done reset() function empty lazy evaluation queue call reset() method storage backend. call reset() sps_2 object hence restore data original state. Finally, Spectra use writeable backend, MsBackendMemory, MsBackendDataFrame MsBackendHdf5Peaks, possible apply processing queue peak data write back data storage applyProcessing() function. use make data manipulations peak data sps_rep object persistent. applyProcessing() lazy evaluation queue contained 2 processing steps, applied peak data written data storage. Note calling reset() applyProcessing() can longer restore data.","code":"sps_rep <- replaceIntensitiesBelow(sps, threshold = 10, value = 0) intensity(sps_rep) ## NumericList of length 4 ## [[1]] 0 47.494 0 100 13.24 ## [[2]] 0 0 0 16.708 100 0 40.643 ## [[3]] 0 0 0 0 0 0 0 100 40.994 ## [[4]] 0 32.341 0 0 100 sps_rep <- filterIntensity(sps_rep, intensity = c(0.1, Inf)) intensity(sps_rep) ## NumericList of length 4 ## [[1]] 47.494 100 13.24 ## [[2]] 16.708 100 40.643 ## [[3]] 100 40.994 ## [[4]] 32.341 100 sps_rep ## MSn data (Spectra) with 4 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## 1 2 NA NA ## 2 2 NA NA ## 3 2 NA NA ## 4 2 NA NA ## ... 20 more variables/columns. ## Lazy evaluation queue: 2 processing step(s) ## Processing: ## Merge 2 Spectra into one [Mon Dec 9 10:48:01 2024] ## Signal <= 10 in MS level(s) 2 set to 0 [Mon Dec 9 10:48:01 2024] ## Remove peaks with intensities outside [0.1, Inf] in spectra of MS level(s) 2. [Mon Dec 9 10:48:02 2024] ## Define a function that takes a matrix as input, divides the second ## column by parameter y and returns it. Note that ... is required in ## the function's definition. divide_intensities <- function(x, y, ...) { x[, 2] <- x[, 2] / y x } ## Add the function to the procesing queue sps_2 <- addProcessing(sps_rep, divide_intensities, y = 2) sps_2 ## MSn data (Spectra) with 4 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## 1 2 NA NA ## 2 2 NA NA ## 3 2 NA NA ## 4 2 NA NA ## ... 20 more variables/columns. ## Lazy evaluation queue: 3 processing step(s) ## Processing: ## Merge 2 Spectra into one [Mon Dec 9 10:48:01 2024] ## Signal <= 10 in MS level(s) 2 set to 0 [Mon Dec 9 10:48:01 2024] ## Remove peaks with intensities outside [0.1, Inf] in spectra of MS level(s) 2. [Mon Dec 9 10:48:02 2024] intensity(sps_2) ## NumericList of length 4 ## [[1]] 23.747 50 6.62 ## [[2]] 8.354 50 20.3215 ## [[3]] 50 20.497 ## [[4]] 16.1705 50 intensity(sps_rep) ## NumericList of length 4 ## [[1]] 47.494 100 13.24 ## [[2]] 16.708 100 40.643 ## [[3]] 100 40.994 ## [[4]] 32.341 100 max_peak <- function(x, ...) { unname(x[which.max(x[, 2]), , drop = FALSE]) } sps_2 <- addProcessing(sps_rep, max_peak) lengths(sps_2) ## [1] 1 1 1 1 intensity(sps_2) ## NumericList of length 4 ## [[1]] 100 ## [[2]] 100 ## [[3]] 100 ## [[4]] 100 sps_rep$precursorMz <- c(170.5, 170.5, 195.1, 195.1) neutral_loss <- function(x, precursorMz, ...) { x[, \"mz\"] <- precursorMz - x[, \"mz\"] x[order(x[, \"mz\"]), , drop = FALSE] } sps_3 <- addProcessing(sps_rep, neutral_loss, spectraVariables = \"precursorMz\") mz(sps_rep) ## NumericList of length 4 ## [[1]] 124.2 170.16 170.52 ## [[2]] 109.14 124.08 170.16 ## [[3]] 138.0662 195.0876 ## [[4]] 138.0655 195.9864 mz(sps_3) ## NumericList of length 4 ## [[1]] -0.0200000000000102 0.340000000000003 46.3 ## [[2]] 0.340000000000003 46.42 61.36 ## [[3]] 0.0123999999999853 57.0338 ## [[4]] -0.886400000000009 57.0345 neutral_loss <- function(x, spectrumMsLevel, precursorMz, ...) { if (spectrumMsLevel == 2L) { x[, \"mz\"] <- precursorMz - x[, \"mz\"] x <- x[order(x[, \"mz\"]), , drop = FALSE] } x } sps_3 <- addProcessing(sps_rep, neutral_loss, spectraVariables = c(\"msLevel\", \"precursorMz\")) mz(sps_3) ## NumericList of length 4 ## [[1]] -0.0200000000000102 0.340000000000003 46.3 ## [[2]] 0.340000000000003 46.42 61.36 ## [[3]] 0.0123999999999853 57.0338 ## [[4]] -0.886400000000009 57.0345 library(MsCoreUtils) ## ## Attaching package: 'MsCoreUtils' ## The following objects are masked from 'package:Spectra': ## ## bin, entropy, smooth ## The following object is masked from 'package:stats': ## ## smooth remove_precursor <- function(x, precursorMz, tolerance = 0.1, ppm = 0, ...) { if (!is.na(precursorMz)) { keep <- is.na(closest(x[, \"mz\"], precursorMz, tolerance = tolerance, ppm = ppm, .check = FALSE)) x[keep, , drop = FALSE] } else x } sps_4 <- addProcessing(sps_rep, remove_precursor, spectraVariables = \"precursorMz\") peaksData(sps_4) |> as.list() ## [[1]] ## mz intensity ## [1,] 124.20 47.494 ## [2,] 170.16 100.000 ## ## [[2]] ## mz intensity ## [1,] 109.14 16.708 ## [2,] 124.08 100.000 ## [3,] 170.16 40.643 ## ## [[3]] ## mz intensity ## [1,] 138.0662 100 ## ## [[4]] ## mz intensity ## [1,] 138.0655 32.341 ## [2,] 195.9864 100.000 peaksData(sps_rep) |> as.list() ## [[1]] ## mz intensity ## [1,] 124.20 47.494 ## [2,] 170.16 100.000 ## [3,] 170.52 13.240 ## ## [[2]] ## mz intensity ## [1,] 109.14 16.708 ## [2,] 124.08 100.000 ## [3,] 170.16 40.643 ## ## [[3]] ## mz intensity ## [1,] 138.0662 100.000 ## [2,] 195.0876 40.994 ## ## [[4]] ## mz intensity ## [1,] 138.0655 32.341 ## [2,] 195.9864 100.000 sps_4 <- addProcessing(sps_rep, remove_precursor, tolerance = 0.6, spectraVariables = \"precursorMz\") peaksData(sps_4) |> as.list() ## [[1]] ## mz intensity ## [1,] 124.2 47.494 ## ## [[2]] ## mz intensity ## [1,] 109.14 16.708 ## [2,] 124.08 100.000 ## ## [[3]] ## mz intensity ## [1,] 138.0662 100 ## ## [[4]] ## mz intensity ## [1,] 138.0655 32.341 ## [2,] 195.9864 100.000 sps_2_rest <- reset(sps_2) intensity(sps_2_rest) ## NumericList of length 4 ## [[1]] 3.407 47.494 3.094 100 13.24 ## [[2]] 6.685 4.381 3.022 16.708 100 4.565 40.643 ## [[3]] 0.459 2.585 2.446 0.508 8.968 0.524 0.974 100 40.994 ## [[4]] 3.837 32.341 0.84 0.534 100 intensity(sps) ## NumericList of length 4 ## [[1]] 3.407 47.494 3.094 100 13.24 ## [[2]] 6.685 4.381 3.022 16.708 100 4.565 40.643 ## [[3]] 0.459 2.585 2.446 0.508 8.968 0.524 0.974 100 40.994 ## [[4]] 3.837 32.341 0.84 0.534 100 length(sps_rep@processingQueue) ## [1] 2 sps_rep <- applyProcessing(sps_rep) length(sps_rep@processingQueue) ## [1] 0 sps_rep ## MSn data (Spectra) with 4 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## 1 2 NA NA ## 2 2 NA NA ## 3 2 NA NA ## 4 2 NA NA ## ... 20 more variables/columns. ## Processing: ## Merge 2 Spectra into one [Mon Dec 9 10:48:01 2024] ## Signal <= 10 in MS level(s) 2 set to 0 [Mon Dec 9 10:48:01 2024] ## Remove peaks with intensities outside [0.1, Inf] in spectra of MS level(s) 2. [Mon Dec 9 10:48:02 2024] ## ...1 more processings. Use 'processingLog' to list all."},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"visualizing-spectra","dir":"Articles","previous_headings":"General usage","what":"Visualizing Spectra","title":"Description and usage of Spectra objects","text":"Spectra package provides following functions visualize spectra data: - plotSpectra(): plot spectrum Spectra panel. - plotSpectraOverlay(): plot multiple spectra plot. use plotSpectra() plot 4 spectra sps object using names (provided spectra variable \"name\") plot titles. also possible label individual peaks plot. use m/z value peak label. example define function accesses information spectrum (z) returns character peak text used label. Parameters labelSrt, labelPos labelOffset define rotation label text position relative x y coordinates peak. plots rather busy peaks m/z values overplotted. define label function indicate m/z peaks intensity higher 30. Sometimes might interest plot multiple spectra plot (e.g. directly compare peaks multiple spectra). can done plotSpectraOverlay() use create overlay-plot 4 example spectra, using different color spectrum. Lastly, plotSpectraMirror() allows plot two spectra mirror plot ideal visualize spectra comparison results. plot spectrum 1-Methylhistidine one Caffeine. upper panel shows spectrum 1-Methylhistidine, lower one Caffeine. None peaks two spectra match. plot two spectra 1-Methylhistidine two Caffeine matching peaks ppm 50. See also ?plotSpectra plotting options examples.","code":"plotSpectra(sps, main = sps$name) plotSpectra(sps, main = sps$name, labels = function(z) format(mz(z)[[1L]], digits = 4), labelSrt = -30, labelPos = 2, labelOffset = 0.1) mzLabel <- function(z) { z <- peaksData(z)[[1L]] lbls <- format(z[, \"mz\"], digits = 4) lbls[z[, \"intensity\"] < 30] <- \"\" lbls } plotSpectra(sps, main = sps$name, labels = mzLabel, labelSrt = -30, labelPos = 2, labelOffset = 0.1) cols <- c(\"#E41A1C80\", \"#377EB880\", \"#4DAF4A80\", \"#984EA380\") plotSpectraOverlay(sps, lwd = 2, col = cols) legend(\"topleft\", col = cols, legend = sps$name, pch = 15) plotSpectraMirror(sps[1], sps[3]) par(mfrow = c(1, 2)) plotSpectraMirror(sps[1], sps[2], main = \"1-Methylhistidine\", ppm = 50) plotSpectraMirror(sps[3], sps[4], main = \"Caffeine\", ppm = 50)"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"aggregating-spectra-data","dir":"Articles","previous_headings":"General usage","what":"Aggregating spectra data","title":"Description and usage of Spectra objects","text":"Spectra package provides combineSpectra() function allows aggregate multiple spectra single one. main parameters function f, defines sets spectra combined, FUN, allows define function performs actual aggregation. default aggregation function combinePeaksData() (see ?combinePeaksData details) combines multiple spectra single spectrum peaks input spectra (additional paramter peaks = \"union\"), peaks present certain proportion input spectra (parameter peaks = \"intersect\"; parameter minProp allows define minimum required proportion spectra peak needs present. important mention , default, function combines mass peaks spectra similar m/z value single, representative mass peak aggregating intensities one. avoid resulting intensity affected potential noise peaks might advised first clean individual mass spectra using e.g. combinePeaks() reduceSpectra() functions first aggregate mass peaks within individual spectrum. example use combineSpectra() combine spectra 1-methylhistidine caffeine single spectrum compound. use spectra variable $name, contains names compounds, define spectra grouped together. result, 4 spectra got aggregated two. default, peaks present spectra reported. alternative, specifying peaks = \"intersect\" minProp = 1, combine spectra keeping peaks present input spectra. results thus single peak 1-methylhistidine none caffeine - ? reason difference peaks’ m/z values larger default tolerance used peak grouping (defaults combinePeaksData() tolerance = 0 ppm = 0). however already see previous section reported peaks’ m/z values larger measurement error (likely fragment spectra measured different instruments different precision). Thus, next increase tolerance ppm parameters group also peaks larger difference m/z values. Whether real analysis OK large tolerance however questionable. Note: m/z intensity reported aggregated spectra can defined parameters intensityFun mzFun combinePeaksData() (see ?combinePeaksData information). combinePeaksData() function indeed helpful combine peaks different spectra, combineSpectra() function addition also allow us provide , custom, peak aggregation function. simple example, instead combining spectra, like select one input spectra representative spectrum grouped input spectra. combineSpectra() supports function takes list peak matrices input returns single peak matrix output. thus define function calculates total signal (TIC) input peak matrix, returns one peak matrix largest TIC. can now use function combineSpectra() select compound spectrum largest TIC.","code":"sps_agg <- combineSpectra(sps, f = sps$name) plotSpectra(sps_agg, main = sps_agg$name) sps_agg <- combineSpectra(sps, f = sps$name, peaks = \"intersect\", minProp = 1) plotSpectra(sps_agg, main = sps_agg$name) sps_agg <- combineSpectra(sps, f = sps$name, peaks = \"intersect\", minProp = 1, tolerance = 0.2) plotSpectra(sps_agg, main = sps_agg$name) #' function to select and return the peak matrix with the largest tic from #' the provided list of peak matrices. maxTic <- function(x, ...) { tic <- vapply(x, function(z) sum(z[, \"intensity\"], na.rm = TRUE), numeric(1)) x[[which.max(tic)]] } sps_agg <- combineSpectra(sps, f = sps$name, FUN = maxTic) plotSpectra(sps_agg, main = sps_agg$name)"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"comparing-spectra","dir":"Articles","previous_headings":"General usage","what":"Comparing spectra","title":"Description and usage of Spectra objects","text":"Spectra can compared compareSpectra() function, allows calculate similarities spectra using variety methods. compareSpectra() implements similarity scoring two-step approach: first peaks pair spectra compared matched (mapped) similarity score calculated . MAPFUN parameter compareSpectra() defines function match (map) peaks spectra parameter FUN specifies function calculate similarity. default, compareSpectra() uses MAPFUN = joinPeaks (see ?joinPeaks description alternative options) FUN = ndotproduct (normalized dot-product spectra similarity score). Parameters configure functions can passed compareSpectra() additional parameter (e.g. ppm define m/z-relative tolerance peak matching joinPeaks()). calculate pairwise similarities spectra sps accepting 50 ppm difference peaks’ m/z values considered matching. resulting matrix provides similarity scores pairwise comparison. expected, first two last two spectra similar, albeit moderately, spectra 1-Methylhistidine don’t share similarity Caffeine. Similarities Spectra objects can calculated calls form compareSpectra(, b) b two Spectra objects compare. result n x m matrix returned n (rows) spectra m (columns) spectra b. similarity calculated default (normalized) dot-product, also similarity scores can used instead. Either one metrics provided MsCoreUtils used (see ?MsCoreUtils::distance list available options) external user-provided similarity scoring function. example, use spectral entropy similarity score introduced (Y et al. 2021) provided msentropy package. Since msentropy_similarity() function performs also mapping peaks compared spectra internally (along spectra cleaning), disable compareSpectra() function using MAPFUN = joinPeaksNone. configure similarity scoring can pass additional parameters msentropy_similarity() (see ?msentropy_similarity) compareSpectra() call. use ms2_tolerance_in_ppm = 50 set tolerance m/z-relative peak matching (equivalent ppm = 50 used ) ms2_tolerance_in_da = -1 disable absolute tolerance matching. Note also GNPS-like scores can calculated MAPFUN = joinPeaksGnps FUN = MsCoreUtils::gnps. additional information examples see also (Rainer et al. 2022) SpectraTutorials tutorial. Another way comparing spectra bin spectra cluster based similar intensity values. Spectra binning ensures binned m/z values comparable across spectra. bin spectra using bin size 0.1 (.e. peaks m/z smaller 0.1 aggregated one binned peak. , explicitly set zero.rm = FALSE retain bins generated function, including intensity zero. spectra now number m/z values. intensity values however 0 (original spectra peak respective m/z bin present). ’re next creating intensity matrix Spectra object, row one spectrum columns representing binned m/z values. can now identify columns (m/z bins) 0s across spectra remove . associated m/z values bins can extracted mz() binned Spectra object. use column names intensity matrix. intensity matrix now example used cluster spectra based peak intensities. expected, first 2 last 2 spectra similar clustered together.","code":"compareSpectra(sps, ppm = 50) ## 1 2 3 4 ## 1 1.0000000 0.1380817 0.0000000 0.0000000 ## 2 0.1380817 1.0000000 0.0000000 0.0000000 ## 3 0.0000000 0.0000000 1.0000000 0.1817149 ## 4 0.0000000 0.0000000 0.1817149 1.0000000 library(msentropy) ## Loading required package: Rcpp compareSpectra(sps, MAPFUN = joinPeaksNone, FUN = msentropy_similarity, ms2_tolerance_in_ppm = 50, ms2_tolerance_in_da = -1) ## 1 2 3 4 ## 1 1.0000000 0.3002225 0.0000000 0.0000000 ## 2 0.3002225 1.0000000 0.0000000 0.0000000 ## 3 0.0000000 0.0000000 1.0000000 0.5144764 ## 4 0.0000000 0.0000000 0.5144764 1.0000000 sps_bin <- Spectra::bin(sps, binSize = 0.1, zero.rm = FALSE) lengths(sps_bin) ## [1] 1400 1400 1400 1400 intensity(sps_bin) ## NumericList of length 4 ## [[1]] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## [[2]] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## [[3]] 0.459 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 40.994 0 0 0 0 0 0 0 0 0 ## [[4]] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 intmat <- do.call(rbind, intensity(sps_bin)) zeros <- colSums(intmat) == 0 intmat <- intmat[, !zeros] intmat ## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] ## [1,] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 3.407 0.000 0.000 0.000 ## [2,] 0.000 0.000 0.000 6.685 4.381 3.022 0.000 16.708 0.000 0.000 0.000 0.000 ## [3,] 0.459 2.585 2.446 0.000 0.000 0.000 0.508 0.000 0.000 8.968 0.524 0.974 ## [4,] 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 3.837 0.000 0.000 ## [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] ## [1,] 0 47.494 3.094 0.000 0.000 0.000 100.000 13.24 0.000 0 ## [2,] 100 0.000 0.000 4.565 0.000 0.000 40.643 0.00 0.000 0 ## [3,] 0 0.000 0.000 0.000 100.000 0.000 0.000 0.00 40.994 0 ## [4,] 0 0.000 0.000 0.000 32.341 1.374 0.000 0.00 0.000 100 colnames(intmat) <- mz(sps_bin)[[1L]][!zeros] heatmap(intmat)"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"exporting-spectra","dir":"Articles","previous_headings":"General usage","what":"Exporting spectra","title":"Description and usage of Spectra objects","text":"Spectra data can exported export() method. method takes Spectra supposed exported backend (parameter backend) used export data additional parameters export function backend. backend thus defines format exported file. Note however MsBackend classes might support data export. backend classes currently supporting data export format : - MsBackendMzR (Spectra package): export data mzML mzXML format. Can export custom, user specified spectra variables. - MsBackendMgf (MsBackendMgf package): exports data Mascot Generic Format (mgf). Exports spectra variables individual spectrum fields mgf file. - MsBackendMsp (MsBackendMsp): exports data NIST MSP format. - MsBackendMassbank (MsBackendMassbank) exports data Massbank text file format. example use MsBackendMzR export spectra variable sps mzML file. thus pass data, backend used export file name result file (temporary file) export() function (see also help page export,MsBackendMzR function additional supported parameters). evaluate spectra variables exported, load exported data identify spectra variables original file exported (defined variables mzML standard). additional variables thus exported. data export performed handled depends also used backend. MsBackendMzR example exports spectra default single file (specified file parameter), allows also specify individual spectrum Spectra file exported (parameter file thus length equal number spectra). example export spectrum 1 3 one file spectra 2 4 another. realistic use case mzML export export MS data processing, smoothing (using smooth() function) centroiding (using pickPeaks() function) raw profile-mode MS data.","code":"fl <- tempfile() export(sps, MsBackendMzR(), file = fl) ## Writing file file899721aa5a12...OK sps_im <- Spectra(backendInitialize(MsBackendMzR(), fl)) spectraVariables(sps)[!spectraVariables(sps) %in% spectraVariables(sps_im)] ## [1] \"id\" \"name\" \"splash\" \"instrument\" fls <- c(tempfile(), tempfile()) export(sps, MsBackendMzR(), file = fls[c(1, 2, 1, 2)]) ## Writing file file89971767a8d1...OK ## Writing file file8997359073cb...OK"},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"changing-backends","dir":"Articles","previous_headings":"General usage","what":"Changing backends","title":"Description and usage of Spectra objects","text":"previous sections learned already Spectra object can use different backends actual data handling. also possible change backend Spectra different one setBackend() function. example change (MsBackendMzR) backend sps_sciex object MsBackendMemory backend enable use data even without need keep original mzML files. change backend sps_sciex -memory MsBackendMemory backend. call full peak data imported original mzML files object. obviously impact object’s size, now much larger . dataStorage spectrum variable now changed, dataOrigin still keeps information originating files:","code":"print(object.size(sps_sciex), units = \"Mb\") ## 0.4 Mb sps_sciex <- setBackend(sps_sciex, MsBackendMemory()) sps_sciex ## MSn data (Spectra) with 1862 spectra in a MsBackendMemory backend: ## msLevel rtime scanIndex ## ## 1 1 0.280 1 ## 2 1 0.559 2 ## 3 1 0.838 3 ## 4 1 1.117 4 ## 5 1 1.396 5 ## ... ... ... ... ## 1858 1 258.636 927 ## 1859 1 258.915 928 ## 1860 1 259.194 929 ## 1861 1 259.473 930 ## 1862 1 259.752 931 ## ... 33 more variables/columns. ## Processing: ## Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:48:07 2024] print(object.size(sps_sciex), units = \"Mb\") ## 53.2 Mb head(dataStorage(sps_sciex)) ## [1] \"\" \"\" \"\" \"\" \"\" \"\" head(basename(dataOrigin(sps_sciex))) ## [1] \"20171016_POOL_POS_1_105-134.mzML\" \"20171016_POOL_POS_1_105-134.mzML\" ## [3] \"20171016_POOL_POS_1_105-134.mzML\" \"20171016_POOL_POS_1_105-134.mzML\" ## [5] \"20171016_POOL_POS_1_105-134.mzML\" \"20171016_POOL_POS_1_105-134.mzML\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"backends","dir":"Articles","previous_headings":"","what":"Backends","title":"Description and usage of Spectra objects","text":"Backends allow use different backends store mass spectrometry data providing via Spectra class unified interface use data. abstraction -disk -memory data modes MSnbase (Gatto, Gibb, Rainer 2020). Spectra package defines set example backends object extending base MsBackend class used instead. default backends : MsBackendMemory: default backend store data memory. Due design MsBackendMemory provides fast access peaks matrices (using peaksData() function) also optimized fast access spectra variables subsetting. Since data kept memory, backend relatively large memory footprint (depending data) thus suggested large MS experiments. MsBackendDataFrame: mass spectrometry data stored (-memory) DataFrame. Keeping data memory guarantees high performance also, depending number mass peaks spectrum, much higher memory footprint. MsBackendMzR: backend keeps general spectra variables memory relies mzR package read mass peaks (m/z intensity values) original MS files -demand. MsBackendHdf5Peaks: similar MsBackendMzR backend reads peak data -demand disk spectra variables kept memory. peak data stored Hdf5 files guarantees scalability. mentioned backends support changing spectra variables, except MsBackendMzR support changing m/z intensity values mass peaks. example load data single mzML file use MsBackendHdf5Peaks backend data storage. hdf5path parameter allows us specify storage location HDF5 file. (possibly incomplete) list R packages providing additional backends add support additional data types storage options provided : MsBackendCompDb (package CompoundDb): provides access spectra data (spectra peaks variables) CompDb database. small memory footprint data (except precursor m/z values) retrieved --fly database. MsBackendHmdbXml (package MsbackendHmdb): allows import MS data xml files Human Metabolome Database (HMDB). Extends MsBackendDataFrame keeps thus data, import, memory. MsBackendMassbank (package MsBackendMassbank): allows import/export data MassBank text file format. Extends MsBackendDataFrame keeps thus data, import, memory. MsBackendMassbankSql (package MsBackendMassbank): allows directly connect MassBank SQL database retrieve MS data variables. minimal memory footprint data retrieved --fly SQL database. MsBackendMetaboLights (package r BiocStyle::Biocpkg(\"MsBackendMetaboLights\")): retrieves caches MS data files MetaboLights repository. MsBackendMgf: (package MsBackendMgf): support import/export mass spectrometry files mascot generic format (MGF). MsBackendMsp: (package MsBackendMsp): allows import/export data NIST MSP format. Extends MsBackendDataFrame keeps thus data, import, memory. MsBackendRawFileReader (package MsBackendRawFileReader): implements backend reading MS data Thermo Fisher Scientific’s raw data files using manufacturer’s NewRawFileReader .Net libraries. package generalizes functionality introduced rawrr package, see also (Kockmann Panse 2021). MsBackendSql (package MsBackendSql): stores MS data SQL database thus minimal memory footprint. MsBackendTimsTof (package MsBackendTimsTof: allows import data Bruker TimsTOF raw data files (using opentimsr R package). MsBackendWeizMass (package MsBackendWeizMass: allows access MS data WeizMass MS/MS spectral databases.","code":"library(msdata) fl <- proteomics(full.names = TRUE)[5] sps_tmt <- Spectra(fl, backend = MsBackendHdf5Peaks(), hdf5path = tempdir()) head(basename(dataStorage(sps_tmt))) ## [1] \"TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzML.h5\" ## [2] \"TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzML.h5\" ## [3] \"TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzML.h5\" ## [4] \"TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzML.h5\" ## [5] \"TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzML.h5\" ## [6] \"TMT_Erwinia_1uLSike_Top10HCD_isol2_45stepped_60min_01.mzML.h5\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"handling-very-large-data-sets","dir":"Articles","previous_headings":"","what":"Handling very large data sets","title":"Description and usage of Spectra objects","text":"Spectra package designed support also efficient processing large data sets. functionality require keep full MS data memory (specifically, peaks data, .e., m/z intensity values, represent largest chunk data MS experiments). functions however peaks data needs loaded memory. One example lengths() function determine number peaks per spectra calculated (fly) evaluating number rows peaks matrix. Backends MsBackendMzR perform default data processing separately (eventually parallel) data file thus safe call functions Spectra object backend. backends (MsBackendSql MsBackendMassbankSql) however advised process data chunk-wise manner using spectrapply() function parameter chunkSize. split original Spectra object chunks size chunkSize applies function separately chunk. way data one chunk eventually loaded memory iteration enabling process also large Spectra objects computers limited hardware resources. Instead lengths(sps) call, number peaks per spectra also determined (less memory demanding way) spectrapply(sps, lengths, chunkSize = 5000L). way peak data 5000 spectra time loaded memory.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"serializing-saving-moving-and-loading-serialized-spectra-objects","dir":"Articles","previous_headings":"","what":"Serializing (saving), moving and loading serialized Spectra objects","title":"Description and usage of Spectra objects","text":"Serializing re-loading variables/objects analysis using e.g. save() load() functions common many workflows, especially tasks computationally intensive take long time. Sometimes serialized objects might even moved one computer (file system) another. operations unproblematic Spectra objects -memory backends MsBackendMemory MsBackendDataFrame, keep data memory, however break -disk backends MsBackendMzR file path original data files identical. thus suggested (size MS data respectively available system memory allows ) change backend Spectra objects MsBackendMemory serializing object save(). Spectra objects MsBackendMzR alternative option eventually update/adapt path directory containing raw (e.g. mzML) data files: assuming data files available computers, path directory containing can updated dataStorageBasePath<- function allowing thus move/copy serialized Spectra objects computers file systems. example workflow : files .mzML, b.mzML stored directory /data/mzML/ one computer. get loaded Spectra object MsBackendMzR serialized file .RData. Assuming file gets now copied another computer (data available folder /data/mzML/) loaded load(). Spectra object valid MsBackendMzR can longer access MS data original data files. Assuming user also copied data files .mzML b.mzML, folder /some_other_folder/, base storage path object need adapted match directory data files available second computer: pointing now storage path new storage location data files, Spectra object also usable second computer.","code":"A <- Spectra(c(\"/data/mzML/a.mzML\", \"/data/mzML/b.mzML\")) save(A, file = \"A.RData\") load(\"A.RData\") dataStorageBasePath(A) <- \"/some_other_folder\""},{"path":"https://rformassspectrometry.github.io/Spectra/articles/Spectra.html","id":"session-information","dir":"Articles","previous_headings":"","what":"Session information","title":"Description and usage of Spectra objects","text":"","code":"sessionInfo() ## R Under development (unstable) (2024-12-04 r87420) ## Platform: x86_64-pc-linux-gnu ## Running under: Ubuntu 24.04.1 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## time zone: UTC ## tzcode source: system (glibc) ## ## attached base packages: ## [1] stats4 stats graphics grDevices utils datasets methods ## [8] base ## ## other attached packages: ## [1] msdata_0.47.0 msentropy_0.1.4 Rcpp_1.0.13-1 ## [4] MsCoreUtils_1.19.0 Spectra_1.17.2 BiocParallel_1.41.0 ## [7] S4Vectors_0.45.2 BiocGenerics_0.53.3 generics_0.1.3 ## [10] BiocStyle_2.35.0 ## ## loaded via a namespace (and not attached): ## [1] jsonlite_1.8.9 compiler_4.5.0 BiocManager_1.30.25 ## [4] Biobase_2.67.0 rhdf5filters_1.19.0 parallel_4.5.0 ## [7] cluster_2.1.7 jquerylib_0.1.4 systemfonts_1.1.0 ## [10] IRanges_2.41.2 textshaping_0.4.1 yaml_2.3.10 ## [13] fastmap_1.2.0 R6_2.5.1 ProtGenerics_1.39.0 ## [16] knitr_1.49 htmlwidgets_1.6.4 MASS_7.3-61 ## [19] bookdown_0.41 desc_1.4.3 bslib_0.8.0 ## [22] rlang_1.1.4 cachem_1.1.0 xfun_0.49 ## [25] fs_1.6.5 sass_0.4.9 cli_3.6.3 ## [28] Rhdf5lib_1.29.0 pkgdown_2.1.1.9000 ncdf4_1.23 ## [31] digest_0.6.37 mzR_2.41.1 MetaboCoreUtils_1.15.0 ## [34] rhdf5_2.51.0 lifecycle_1.0.4 clue_0.3-66 ## [37] evaluate_1.0.1 codetools_0.2-20 ragg_1.3.3 ## [40] rmarkdown_2.29 tools_4.5.0 htmltools_0.5.8.1"},{"path":[]},{"path":"https://rformassspectrometry.github.io/Spectra/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"RforMassSpectrometry Package Maintainer. Maintainer. Laurent Gatto. Author. Johannes Rainer. Author. Sebastian Gibb. Author. Philippine Louail. Author. Jan Stanstrup. Contributor. Nir Shahaf. Contributor. Mar Garcia-Aloy. Contributor.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Rainer J, Vicini , Salzer L, Stanstrup J, Badia JM, Neumann S, Stravs MA, Verri Hernandes V, Gatto L, Gibb S Wittin M. Modular Expandable Ecosystem Metabolomics Data Annotation R Metabolites 2022, 12, 173. https://doi.org/10.3390/metabo12020173","code":"@Article{, title = {A Modular and Expandable Ecosystem for Metabolomics Data Annotation in R}, author = {Johannes Rainer and Andrea Vicini and Liesa Salzer and Jan Stanstrup and Josep M. Badia and Steffen Neumann and Michael A. Stravs and Vinicius {Verri Hernandes} and Laurent Gatto and Sebastian Gibb and Michael Witting}, journal = {Metabolites}, year = {2022}, doi = {10.3390/metabo12020173}, url = {https://www.mdpi.com/2218-1989/12/2/173}, volume = {12}, pages = {173}, }"},{"path":"https://rformassspectrometry.github.io/Spectra/index.html","id":"low-level-infrastructure-to-handle-ms-spectra","dir":"","previous_headings":"","what":"Spectra Infrastructure for Mass Spectrometry Data","title":"Spectra Infrastructure for Mass Spectrometry Data","text":"Spectra package defines efficient infrastructure storing handling mass spectrometry spectra functionality subset, process, visualize compare spectra data. provides different implementations (backends) store mass spectrometry data. comprise backends tuned fast data access processing backends large data sets ensuring small memory footprint. (possibly incomplete) list available backends (along link R package providing ) shown : MsBackendCompDb (package CompoundDb: provides access spectra data (spectra peaks variables) CompDb database. small memory footprint data (except precursor m/z values) retrieved --fly database. MsBackendDataFrame (package: Spectra): alternative MsBackendMemory also keeping data memory, supporting S4 objects spectra variables data stored internally DataFrame. MsBackendHdf5Peaks (package: Spectra): -disk backend similar MsBackendMzR, peaks data stored HDF5 files (general spectra variables kept memory). MsBackendHmdbXml (package MsbackendHmdb): allows import MS data xml files Human Metabolome Database (HMDB). Extends MsBackendDataFrame keeps thus data, import, memory. MsBackendMassbank (package MsBackendMassbank): allows import/export data MassBank text file format. Extends MsBackendDataFrame keeps thus data, import, memory. MsBackendMassbankSql (package MsBackendMassbank): allows directly connect MassBank SQL database retrieve MS data variables. minimal memory footprint data retrieved --fly SQL database. MsBackendMemory (package: Spectra): default backend keeps data memory. Optimized fast processing. MsBackendMetaboLights (package MsBackendMetaboLights): retrieves caches MS data files MetaboLights. MsBackendMgf (package MsBackendMgf): allows import/export data mascot generic format (MGF). Extends MsBackendDataFrame keeps thus data, import, memory. MsBackendMsp (package MsbackendMsp): allows import/export data NIST MSP format. Extends MsBackendDataFrame keeps thus data, import, memory. MsBackendMzR (package: Spectra): using mzR package supports import MS data mzML, mzXML CDF files. backend keeps general spectra variables memory retrieves peaks data (m/z intensity values) --fly original data files. backend thus smaller memory footprint compared -memory backends. MsBackendOfflineSql (package MsBackendSql): stores MS data SQL database thus minimal memory footprint. , contrast MsBackendSql, keep active SQL database connection can thus support parallel processing. MsBackendRawFileReader (package MsBackendRawFileReader): implements backend reading MS data Thermo Fisher Scientific’s raw data files using manufacturer’s NewRawFileReader .Net libraries. package generalizes functionality introduced rawrr package. MsBackendSql (package MsBackendSql): stores MS data SQL database thus minimal memory footprint. MsBackendTimsTof (package MsBackendTimsTof: allows import data Bruker TimsTOF raw data files (using opentimsr R package). MsBackendWeizMass (package MsBackendWeizMass: allows access MS data WeizMass MS/MS spectral databases. information see package homepage.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Spectra Infrastructure for Mass Spectrometry Data","text":"package can installed ","code":"install.packages(\"BiocManager\") BiocManager::install(\"Spectra\")"},{"path":"https://rformassspectrometry.github.io/Spectra/index.html","id":"contributions","dir":"","previous_headings":"","what":"Contributions","title":"Spectra Infrastructure for Mass Spectrometry Data","text":"Contributions highly welcome follow contribution guidelines. Also, please check coding style guidelines RforMassSpectrometry vignette importantly, follow code conduct.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":null,"dir":"Reference","previous_headings":"","what":"Mass spectrometry data backends — MsBackend","title":"Mass spectrometry data backends — MsBackend","text":"Note classes described meant used directly end-users material man page aimed package developers. MsBackend virtual class defines different backend needs provide. MsBackend objects provide access mass spectrometry data. backends can classified -memory -disk backends, depending data, .e spectra (m/z intensities) spectra annotation (MS level, charge, polarity, ...) stored. Typically, -memory backends keep data memory ensuring fast data access, -disk backends store (parts ) data disk retrieve demand. Backend functions implementation notes new backend classes section documents API backend must implement. Currently available backends : MsBackendMemory MsBackendDataFrame: store data memory. MsBackendMemory optimized accessing processing peak data (.e. numerical matrices m/z intensity values) MsBackendDataFrame keeps data DataFrame. MsBackendMzR: stores m/z intensities -disk raw data files (typically mzML mzXML) spectra annotation information (header) memory DataFrame. backend requires mzR package. MsBackendHdf5Peaks: stores m/z intensities -disk custom hdf5 data files remaining spectra variables memory (DataFrame). backend requires rhdf5 package. See details individual backends.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Mass spectrometry data backends — MsBackend","text":"","code":"# S4 method for class 'MsBackend' backendBpparam(object, BPPARAM = bpparam()) # S4 method for class 'MsBackend' backendInitialize(object, ...) # S4 method for class 'list' backendMerge(object, ...) # S4 method for class 'MsBackend' backendMerge(object, ...) # S4 method for class 'MsBackend' backendParallelFactor(object, ...) # S4 method for class 'MsBackend' export(object, ...) # S4 method for class 'MsBackend' acquisitionNum(object) # S4 method for class 'MsBackend' peaksData(object, columns = c(\"mz\", \"intensity\")) # S4 method for class 'MsBackend' peaksVariables(object) # S4 method for class 'MsBackend,dataframeOrDataFrameOrmatrix' cbind2(x, y = data.frame(), ...) # S4 method for class 'MsBackend' centroided(object) # S4 method for class 'MsBackend' centroided(object) <- value # S4 method for class 'MsBackend' collisionEnergy(object) # S4 method for class 'MsBackend' collisionEnergy(object) <- value # S4 method for class 'MsBackend' dataOrigin(object) # S4 method for class 'MsBackend' dataOrigin(object) <- value # S4 method for class 'MsBackend' dataStorage(object) # S4 method for class 'MsBackend' dataStorage(object) <- value # S4 method for class 'MsBackend' dropNaSpectraVariables(object) # S4 method for class 'MsBackend,ANY' extractByIndex(object, i) # S4 method for class 'MsBackend,missing' extractByIndex(object, i) # S4 method for class 'MsBackend' filterAcquisitionNum(object, n, file, ...) # S4 method for class 'MsBackend' filterDataOrigin(object, dataOrigin = character()) # S4 method for class 'MsBackend' filterDataStorage(object, dataStorage = character()) # S4 method for class 'MsBackend' filterEmptySpectra(object, ...) # S4 method for class 'MsBackend' filterIsolationWindow(object, mz = numeric(), ...) # S4 method for class 'MsBackend' filterMsLevel(object, msLevel = integer()) # S4 method for class 'MsBackend' filterPolarity(object, polarity = integer()) # S4 method for class 'MsBackend' filterPrecursorMzRange(object, mz = numeric()) # S4 method for class 'MsBackend' filterPrecursorMz(object, mz = numeric()) # S4 method for class 'MsBackend' filterPrecursorMzValues(object, mz = numeric(), ppm = 20, tolerance = 0) # S4 method for class 'MsBackend' filterPrecursorCharge(object, z = integer()) # S4 method for class 'MsBackend' filterPrecursorScan(object, acquisitionNum = integer(), f = dataOrigin(object)) # S4 method for class 'MsBackend' filterRanges( object, spectraVariables = character(), ranges = numeric(), match = c(\"all\", \"any\") ) # S4 method for class 'MsBackend' filterRt(object, rt = numeric(), msLevel. = uniqueMsLevels(object)) # S4 method for class 'MsBackend' filterValues( object, spectraVariables = character(), values = numeric(), ppm = 0, tolerance = 0, match = c(\"all\", \"any\") ) # S4 method for class 'MsBackend' intensity(object) # S4 method for class 'MsBackend' intensity(object) <- value # S4 method for class 'MsBackend' ionCount(object) # S4 method for class 'MsBackend' isCentroided(object, ...) # S4 method for class 'MsBackend' isEmpty(x) # S4 method for class 'MsBackend' isolationWindowLowerMz(object) # S4 method for class 'MsBackend' isolationWindowLowerMz(object) <- value # S4 method for class 'MsBackend' isolationWindowTargetMz(object) # S4 method for class 'MsBackend' isolationWindowTargetMz(object) <- value # S4 method for class 'MsBackend' isolationWindowUpperMz(object) # S4 method for class 'MsBackend' isolationWindowUpperMz(object) <- value # S4 method for class 'MsBackend' isReadOnly(object) # S4 method for class 'MsBackend' length(x) # S4 method for class 'MsBackend' msLevel(object) # S4 method for class 'MsBackend' msLevel(object) <- value # S4 method for class 'MsBackend' mz(object) # S4 method for class 'MsBackend' mz(object) <- value # S4 method for class 'MsBackend' lengths(x, use.names = FALSE) # S4 method for class 'MsBackend' polarity(object) # S4 method for class 'MsBackend' polarity(object) <- value # S4 method for class 'MsBackend' precScanNum(object) # S4 method for class 'MsBackend' precursorCharge(object) # S4 method for class 'MsBackend' precursorIntensity(object) # S4 method for class 'MsBackend' precursorMz(object) # S4 method for class 'MsBackend' precursorMz(object, ...) <- value # S4 method for class 'MsBackend' peaksData(object) <- value # S4 method for class 'MsBackend' reset(object) # S4 method for class 'MsBackend' rtime(object) # S4 method for class 'MsBackend' rtime(object) <- value # S4 method for class 'MsBackend' scanIndex(object) # S4 method for class 'MsBackend' selectSpectraVariables(object, spectraVariables = spectraVariables(object)) # S4 method for class 'MsBackend' smoothed(object) # S4 method for class 'MsBackend' smoothed(object) <- value # S4 method for class 'MsBackend' spectraData(object, columns = spectraVariables(object)) # S4 method for class 'MsBackend' spectraData(object) <- value # S4 method for class 'MsBackend' spectraNames(object) # S4 method for class 'MsBackend' spectraNames(object) <- value # S4 method for class 'MsBackend' spectraVariables(object) # S4 method for class 'MsBackend,ANY' split(x, f, drop = FALSE, ...) # S4 method for class 'MsBackend' supportsSetBackend(object, ...) # S4 method for class 'MsBackend' tic(object, initial = TRUE) # S4 method for class 'MsBackend' x[i, j, ..., drop = FALSE] # S4 method for class 'MsBackend' x$name # S4 method for class 'MsBackend' x$name <- value # S4 method for class 'MsBackend' x[[i, j, ...]] # S4 method for class 'MsBackend' x[[i, j, ...]] <- value # S4 method for class 'MsBackend' uniqueMsLevels(object, ...) # S4 method for class 'MsBackend' dataStorageBasePath(object) # S4 method for class 'MsBackend' dataStorageBasePath(object) <- value MsBackendDataFrame() # S4 method for class 'MsBackendDataFrame' backendInitialize(object, data, peaksVariables = c(\"mz\", \"intensity\"), ...) MsBackendHdf5Peaks() MsBackendMemory() # S4 method for class 'MsBackendMemory' backendInitialize(object, data, peaksVariables = c(\"mz\", \"intensity\"), ...) MsBackendMzR()"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Mass spectrometry data backends — MsBackend","text":"object Object extending MsBackend. BPPARAM backendBpparam(): parameter object BiocParallel package defining parallel processing setup. Defaults BPPARAM = bpparam(). See bpparam() information. ... Additional arguments. columns spectraData() accessor: optional character column names (spectra variables) included returned DataFrame. default, columns returned. peaksData() accessor: optional character requested columns individual matrix returned list. Defaults peaksVariables(object) depends peaks variables backend provides. x Object extending MsBackend. y cbind2(): data.frame DataFrame spectra variables added backend. number rows y order match number spectra order x. value replacement value <- methods. See individual method description expected data type. [: integer, logical character subset object. n filterAcquisitionNum(): integer acquisition numbers filter . file filterFile(): index name file(s) data subsetted. export(): character length 1 equal number spectra. dataOrigin filterDataOrigin(): character define spectra keep. filterAcquisitionNum(): optionally specify filtering occur spectra selected dataOrigin. dataStorage filterDataStorage(): character define spectra keep. filterAcquisitionNum(): optionally specify filtering occur spectra selected dataStorage. mz filterIsolationWindow(): numeric(1) m/z value filter object. filterPrecursorMzRange(): numeric(2) lower upper m/z boundary. filterPrecursorMzValues(): numeric m/z value(s) filter object. msLevel integer defining MS level spectra function applied. filterMsLevel(): MS level object subsetted. polarity filterPolarity(): integer specifying polarity subset object. ppm filterPrecursorMzValues(): numeric(1) m/z-relative maximal acceptable difference m/z considered matching. See closest() details. filterValues(): numeric length allowing define maximal accepted difference user input values spectraVariables values. equal length value provided parameter spectraVariables, ppm[1] recycled. tolerance filterPrecursorMzValues(): numeric(1) maximal absolute acceptable difference m/z value considered matching. See closest() details. filterValues(): numeric accepted tolerance values spectra variables. Defaults tolerance = 0. equal length value provided parameter spectraVariables, tolerance[1] recycled. z filterPrecursorCharge(): integer() precursor charges used filter. acquisitionNum filterPrecursorScan(): integer acquisition number spectra object subsetted. f factor defining grouping split x. See split(). filterPrecursorScan(): factor defining original data files spectra derive avoid selecting spectra different samples/files. Defaults f = dataOrigin(object). spectraVariables selectSpectraVariables(): character names spectra variables backend subsetted. filterRanges() filterValues(): character vector specifying column(s) spectraData(object) filter data correspond names spectra variables used filtering. ranges filterRanges(): numeric vector paired values (upper lower boundary) define ranges filter object. paired values need order spectraVariables parameter (see ). match filterRanges() filterValues(): character(1) defining whether condition match provided ranges/values (match = \"\"; default), (match = \"\") spectra retained. rt filterRt(): numeric(2) defining retention time range used subset/filter object. msLevel. msLevel . values filterValues(): numeric vector define values filter object. values needs length parameter spectraVariables order. use.names lengths(): whether spectrum names used. drop [: considered. initial tic(): logical(1) whether initially reported total ion current reported, whether total ion current (re)calculated actual data (initial = FALSE). j [: supported. name $ $<-: name spectra variable return set. data backendInitialize(): DataFrame spectrum metadata/data. parameter can empty MsBackendMzR backends needs provided MsBackendDataFrame backends. peaksVariables backendInitialize() MsBackendMemory: character specifying columns provided data contain peaks variables (.e. information individual mass peaks). Defaults peaksVariables = c(\"mz\", \"intensity\"). \"mz\" \"intensity\" always specified.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Mass spectrometry data backends — MsBackend","text":"See documentation respective function.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"implementation-notes","dir":"Reference","previous_headings":"","what":"Implementation notes","title":"Mass spectrometry data backends — MsBackend","text":"Backends extending MsBackend must implement methods (listed ). Developers new MsBackends follow MsBackendMemory implementation. ensure new implementation conform MsBackend definition, developers included test suites provided package unit test setup. variable created package's \"testthat.R\" file represents (initialized) instance developed backend. path test suites defined test_suite <- system.file(\"test_backends\", \"test_MsBackend\", package = \"Spectra\") followed test_dir(test_suite) run test files directory. Individual unit test files run test_file(file.path(test_suite, \"test_spectra_variables.R\"), stop_on_failure = TRUE) (note without stop_on_failure = TRUE tests fail silently) . Adding code packages \"testthat.R\" file ensures tests checking validity MsBackend instance defined Spectra package also run newly develped backend class. MsBackend defines following slots: @readonly: logical(1) whether backend supports writing/replacing m/z intensity values. Backends extending MsBackend must implement methods (listed ). Developers new MsBackends follow MsBackendDataFrame implementation. MsBackendCached() backend provides caching mechanism allow read backends add change spectra variables. backend used , meant extended. See MsBackendCached() details. MsBackend defines following slots: @readonly: logical(1) whether backend supports writing/replacing m/z intensity values.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"backend-functions","dir":"Reference","previous_headings":"","what":"Backend functions","title":"Mass spectrometry data backends — MsBackend","text":"New backend classes must extend base MsBackend class implement following methods (see MsBackend vignette detailed description examples): [: subset backend. subsetting element (row/) allowed. Parameter support integer indices logical throw error bounds. MsCoreUtils::i2index used check input . = integer() empty backend returned. Implementation method optional, default calls extractByIndex() method (implemented main subsetting method). $, $<-: access set/add single spectrum variable (column) backend. Using value NULL allow deleting specified spectra variable. error thrown spectra variable available. [[, [[<-: access set/add single spectrum variable (column) backend. default implementation uses $, thus methods implemented new classes extending MsBackend. acquisitionNum(): returns acquisition number spectrum. Returns integer length equal number spectra (NA_integer_ available). backendBpparam(): return parallel processing setup supported backend class. function can used higher level function evaluate whether provided parallel processing setup (default one returned bpparam()) supported backend. Backends supporting parallel processing (e.g. contain connection database can shared across processes) extend method return SerialParam() hence disable parallel processing () methods functions. See also backendParallelFactor() function provide preferred splitting backend parallel processing. backendInitialize(): initialises backend. method supposed called rights creating instance backend class prepare backend (e.g. set data memory backend read spectra header data MsBackendMzR backend). Parameters can defined freely backend, depending needed initialize backend. however suggested also support parameter data can used submit full spectra data DataFrame backend. allow backend also usable setBackend() function Spectra. Note eventually (read-backends) also supportsSetBackend method need implemented return TRUE. backendInitialize() method also ensure correctly set spectra variable dataStorage. backendMerge(): merges (combines) MsBackend objects single instance. objects merged type (e.g. MsBackendDataFrame()). backendParallelFactor(): returns factor defining optimal (preferred) way backend can split parallel processing used peak data accessor data manipulation functions. default implementation returns factor length 0 (factor()) providing thus default splitting. backendParallelFactor() MsBackendMzR hand returns factor(dataStorage(object)) hence suggesting split object data file. backendRequiredSpectraVariables(): returns character spectra variable names mandatory specific backend. default returns empty character(). implementation MsBackendMzR returns c(\"dataStorage\", \"scanIndex\") two spectra variables required load MS data --fly. method needs implemented backend requires specific variables defined. dataOrigin(): gets character length equal number spectra object data origin spectrum. e.g. mzML file data read. dataStorage(): gets character length equal number spectra object data storage spectrum. Note missing values (NA_character_) supported dataStorage. dataStorageBasePath(), dataStorageBasePath<-: gets sets common *base* path directory containing data files. supported, function expected return (accept) characterof length 1. backends (example theMsBackendMemorywill support function anddataStorageBasePath()returnNA_character_. MsBackendMzR, function allows get change path directory containing original data files, required e.g. serialized MsBackendMzR` instance gets copied another computer file system. dropNaSpectraVariables(): removes spectra variables (.e. columns object's spectraData contain missing values (NA). Note columns NAs removed, spectraData() call dropNaSpectraVariables() might still show columns containing NA values core spectra variables. cbind2(): allows appends multiple new spectra variables backend . values new spectra variables order spectra x. Replacing existing spectra variables supported function. controlled way adding spectra variables, joinSpectraData() used. centroided(), centroided<-: gets sets centroiding information spectra. centroided() returns logical vector length equal number spectra TRUE spectrum centroided, FALSE profile mode NA undefined. See also isCentroided() estimating spectrum data whether spectrum centroided. value centroided<- either single logical logical length equal number spectra object. collisionEnergy(), collisionEnergy<-: gets sets collision energy spectra object. collisionEnergy() returns numeric length equal number spectra (NA_real_ present/defined), collisionEnergy<- takes numeric length equal number spectra object. export(): exports data Spectra class file. method called export,Spectra method passes second argument function. export,MsBackend implementation thus expected take Spectra class second argument data exported. Taking data Spectra class ensures also eventual data manipulations (cached Spectra's lazy evaluation queue) applied prior export - possible MsBackend class. example implementation export() method MsBackendMzR backend supports export data mzML mzXML format. See documentation MsBackendMzR class information. extractByIndex(): function subset backend selected elements defined provided index. Similar [, method allow extracting (subset) data order. contrast [, however, expected integer ([ also support logical eventually character). apparently redundant [, methods avoids package namespace errors/problems can result implementations [ found R (can happen sometimes parallel processing using SnowParam()). method used internally Spectra extract/subset backend. Implementation method mandatory. filterAcquisitionNum(): filters object keeping spectra matching provided acquisition numbers (argument n). dataOrigin dataStorage also provided, object subsetted spectra acquisition number equal n spectra matching dataOrigin dataStorage values retaining spectra. filterDataOrigin(): filters object retaining spectra matching provided dataOrigin. Parameter dataOrigin type character needs match exactly data origin value spectra subset. filterDataOrigin() return data ordered provided dataOrigin parameter, .e. dataOrigin = c(\"2\", \"1\") provided, spectra resulting object ordered accordingly (first spectra data origin \"2\" \"1\"). Implementation method optional since default implementation MsBackend available. filterDataStorage(): filters object retaining spectra matching provided dataStorage. Parameter dataStorage type character needs match exactly data storage value spectra subset. filterDataStorage() return data ordered provided dataStorage parameter, .e. dataStorage = c(\"2\", \"1\") provided, spectra resulting object ordered accordingly (first spectra data storage \"2\" \"1\"). Implementation method optional since default implementation MsBackend available. filterEmptySpectra(): removes empty spectra (.e. spectra without peaks). Implementation method optional since default implementation MsBackend available. filterFile(): retains data files matching file index file name provided parameter file. filterIsolationWindow(): retains spectra contain mz isolation window m/z range (.e. isolationWindowLowerMz <= mz isolationWindowUpperMz >= mz. Implementation method optional since default implementation MsBackend available. filterMsLevel(): retains spectra MS level msLevel. Implementation method optional since default implementation MsBackend available. filterPolarity(): retains spectra polarity polarity. Implementation method optional since default implementation MsBackend available. filterPrecursorMzRange() (previously filterPrecursorMz): retains spectra precursor m/z within provided m/z range. Implementation method optional since default implementation MsBackend available. filterPrecursorMzValues(): retains spectra precursor m/z matching provided m/z values (given ppm tolerance). Implementation method optional since default implementation MsBackend available. filterPrecursorCharge(): retains spectra defined precursor charge(s). Implementation method optional since default implementation MsBackend available. filterPrecursorScan(): retains parent (e.g. MS1) children scans (e.g. MS2) acquisition number acquisitionNum. Parameter f supposed define origin spectra (.e. original data file) ensure related spectra file/sample selected retained. Implementation method optional since default implementation MsBackend available. filterRanges(): allows filtering Spectra object based user defined numeric ranges (parameter ranges) one available spectra variables object (spectra variable names can specified parameter spectraVariables). Spectra value spectra variable within defined range retained. multiple ranges/spectra variables defined, match parameter can used specify whether conditions (match = \"\"; default) conditions must match (match = \"\"; spectra values within provided ranges retained). Implementation method optional since default implementation MsBackend available. filterRt(): retains spectra MS level msLevel retention times within (>=) rt[1] (<=) rt[2]. Implementation method optional since default implementation MsBackend available. filterValues(): allows filtering Spectra object based similarities numeric values one spectraVariables(object) (parameter spectraVariables) provided values (parameter values) given acceptable differences (parameters tolerance ppm). multiple values/spectra variables defined, match parameter can used specify whether conditions (match = \"\"; default) conditions must match (match = \"\"; spectra values within provided ranges retained). Implementation method optional since default implementation MsBackend available. intensity(): gets intensity values spectra. Returns NumericList() numeric vectors (intensity values spectrum). length list equal number spectra object. intensity<-: replaces intensity values. value list (NumericList()) length equal number spectra number values within list element identical number peaks spectrum (.e. lengths(x)). Note just writeable backends support method. ionCount(): returns numeric sum intensities spectrum. spectrum empty (see isEmpty()), NA_real_ returned. isCentroided(): heuristic approach assessing spectra object profile centroided mode. function takes qtl th quantile top peaks, calculates difference adjacent m/z value returns TRUE first quartile greater k. (See Spectra:::.peaks_is_centroided code.) isEmpty(): checks whether spectrum object empty (.e. contain peaks). Returns logical vector length equal number spectra. isolationWindowLowerMz(), isolationWindowLowerMz<-: gets sets lower m/z boundary isolation window. isolationWindowTargetMz(), isolationWindowTargetMz<-: gets sets target m/z isolation window. isolationWindowUpperMz(), isolationWindowUpperMz<-: gets sets upper m/z boundary isolation window. isReadOnly(): returns logical(1) whether backend read allow also write/update data. length(): returns number spectra object. lengths(): gets number peaks (m/z-intensity values) per spectrum. Returns integer vector (length equal number spectra). empty spectra, 0 returned. msLevel(): gets spectra's MS level. Returns integer vector (length equal number spectra) MS level spectrum (NA_integer_ available). msLevel<-: replaces spectra's MS level. mz(): gets mass--charge ratios (m/z) spectra. Returns NumericList() length equal number spectra, element numeric vector m/z values one spectrum. mz<-: replaces m/z values. value list length equal number spectra number values within list element identical number peaks spectrum (.e. lengths(x)). Note just writeable backends support method. polarity(), polarity<-: gets sets polarity spectrum. polarity() returns integer vector (length equal number spectra), 0 1 representing negative positive polarities, respectively. polarity<- expects integer vector length 1 equal number spectra. precursorCharge(), precursorIntensity(), precursorMz(), precScanNum(), precAcquisitionNum(): get charge (integer), intensity (numeric), m/z (numeric), scan index (integer) acquisition number (interger) precursor MS level 2 spectra object. Returns vector length equal number spectra object. NA reported MS1 spectra precursor information available. peaksData() returns list spectras' peak data, .e. m/z intensity values peak variables. length list equal number spectra object. element list two-dimensional array (matrix data.frame) columns depending provided columns parameter (default \"mz\" \"intensity\", depends backend's available peaksVariables). empty spectrum, matrix (data.frame) 0 rows columns according columns returned. optional parameter columns, supported backend, allows define peak variables returned numeric peak matrix. default c(\"mz\", \"intensity\") used. peaksData<- replaces peak data (m/z intensity values) backend. method expects list two dimensional arrays (matrix data.frame) columns representing peak variables. existing peaks data expected replaced new values. length list match number spectra object. Note writeable backends need support method. peaksVariables(): lists available variables mass peaks. Default peak variables \"mz\" \"intensity\" (backends need support provide), backends might provide additional variables. variables expected returned (requested) peaksData() function. reset() backend (supported). method called backend reset,Spectra method supposed restore data original state (see reset,Spectra details). function returns reset backend. default implementation MsBackend returns backend -. rtime(), rtime<-: gets sets retention times spectrum (seconds). rtime() returns numeric vector (length equal number spectra) retention time spectrum. rtime<- expects numeric vector length equal number spectra. scanIndex(): returns integer vector scan index spectrum. represents relative index spectrum within file. Note can different acquisitionNum() spectrum index spectrum reported mzML file. selectSpectraVariables(): reduces information within backend selected spectra variables. suggested remove values \"dataStorage\" variable, since might required backends work properly (MsBackendMzR). smoothed(),smoothed<-: gets sets whether spectrum smoothed. smoothed() returns logical vector length equal number spectra. smoothed<- takes logical vector length 1 equal number spectra object. spectraData(), spectraData<-: gets sets general spectrum metadata (annotation, also called header). spectraData() returns DataFrame, spectraData<- expects DataFrame number rows spectra object. Note spectraData() return full data, .e. also m/z intensity values (list SimpleList columns \"mz\" \"intensity\". spectraNames(): returns character vector names spectra object NULL set. spectraNames<- allows set spectra names (object read-). spectraVariables(): returns character vector available spectra variables (columns, fields attributes) available object. return spectra variables present object, also \"mz\" \"intensity\" (default returned spectraVariables,Spectra method). split(): splits backend list backends (depending parameter f). default method MsBackend uses split.default(), thus backends extending MsBackend necessarily need implement method. supportsSetBackend(): whether MsBackend supports Spectra setBackend() function. MsBackend support setBackend() needs parameter called data backendInitialize() method support receiving spectra data DataFrame another backend initialize backend data. general read-backends support setBackend() hence, default implementation supportsSetBackend() returns !isReadOnly(object). read-backend support setBackend() initialized DataFrame implementation method backend defined returns TRUE (see also MsBackend vignette details examples). tic(): gets total ion current/count (sum signal spectrum) spectra object. default, value reported original raw data file returned. empty spectrum, NA_real_ returned. uniqueMsLevels(): gets unique MS levels spectra object. default implementation calls unique(msLevel(object)) efficient implementations defined specific backends.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"subsetting-and-merging-backend-classes","dir":"Reference","previous_headings":"","what":"Subsetting and merging backend classes","title":"Mass spectrometry data backends — MsBackend","text":"Backend classes must support (implement) [ method subset object. method support subsetting spectra (rows, ) return MsBackend class. Backends extending MsBackend also implement backendMerge() method support combining backend instances (backend classes type merged). Merging follow following rules: whole spectrum data various objects merged. resulting merged object contain union individual objects' spectra variables (columns/fields), eventually missing variables one object filled NA.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"in-memory-data-backends","dir":"Reference","previous_headings":"","what":"In-memory data backends","title":"Mass spectrometry data backends — MsBackend","text":"MsBackendMemory MsBackendDataFrame: MsBackendMemory MsBackendDataFrame objects keep MS data memory thus ideal fast data processing. Due large memory footprint however suited large scale experiments. two backends store data different. MsBackendDataFrame stores data DataFrame thus supports also S4-classes spectra variables. Also, sepratate access m/z intensity values (.e. using mz() intensity() methods) faster MsBackendDataFrame. MsBackendMemory hand, due way data organized internally, provides much faster access full peak data (.e. numerical matrices m/z intensity values). Also subsetting access spectra variable (except \"mz\" \"intensity\") fastest MsBackendMemory. Thus, use cases, MsBackendMemory provides higher performance flexibility MsBackendDataFrame thus preferred. See also issue 246 performance comparison. New objects can created MsBackendMemory() MsBackendDataFrame() function, respectively. backends can subsequently initialized backendInitialize() method, taking DataFrame (data.frame) (full) MS data first parameter data. second parameter peaksVariables allows define columns data contain peak variables m/z intensity values individual peaks per spectrum. default parameter peaksVariables = c(\"mz\", \"intensity\"). Note supported provide either \"mz\" \"intensity\", provided, need present data frame. Alternatively, function also supports data frame without m/z intensity values, case Spectra without mass peaks created. Suggested columns DataFrame : \"msLevel\": integer MS levels spectra. \"rt\": numeric retention times spectra. \"acquisitionNum\": integer acquisition number spectrum. \"scanIndex\": integer index scan/spectrum within mzML/mzXML/CDF file. \"dataOrigin\": character defining data origin. \"dataStorage\": character indicating grouping spectra different e.g. input files. Note missing values supported. \"centroided\": logical whether spectrum centroided. \"smoothed\": logical whether spectrum smoothed. \"polarity\": integer polarity information spectra. \"precScanNum\": integer specifying index (MS1) spectrum containing precursor (MS2) spectrum. \"precursorMz\": numeric m/z value precursor. \"precursorIntensity\": numeric intensity value precursor. \"precursorCharge\": integer charge precursor. \"collisionEnergy\": numeric collision energy. \"mz\": NumericList() numeric vectors representing m/z values spectrum. \"intensity\": NumericList() numeric vectors representing intensity values spectrum. Additional columns allowed . peaksData() function MsBackendMemory MsBackendDataFrame returns list numeric matrix default (parameter columns = c(\"mz\", \"intensity\")). peak variables requested, list data.frame returned (ensuring m/z intensity values always numeric).","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"msbackendmzr-on-disk-ms-data-backend","dir":"Reference","previous_headings":"","what":"MsBackendMzR, on-disk MS data backend","title":"Mass spectrometry data backends — MsBackend","text":"MsBackendMzR keeps limited amount data memory, spectra data (m/z intensity values) fetched raw files -demand. backend uses mzR package data import retrieval hence requires package installed. Also, can used import represent data stored mzML, mzXML CDF files. MsBackendMzR backend extends MsBackendDataFrame backend using DataFrame keep spectra variables (except m/z intensity) memory. New objects can created MsBackendMzR() function can subsequently filled data calling backendInitialize() passing file names input data files argument files. backend provides export() method export data Spectra mzML mzXML format. definition function : export(object, x, file = tempfile(), format = c(\"mzML\", \"mzXML\"), copy = FALSE) parameters : object: instance MsBackendMzR class. x: Spectra object exported. file: character (full) output file name(s). length 1 equal length(x). single file specified, spectra exported file. Alternatively possible specify spectrum x name file exported (hence file length equal length(x)). format: character(1), either \"mzML\" \"mzXML\" defining output file format. copy: logical(1) whether general file information copied original MS data files. works x uses MsBackendMzR backend dataOrigin(x) contains original MS data file names. BPPARAM: parallel processing settings. See examples Spectra vignette details examples. MsBackendMzR ignores parameter columns peaksData() function returns always m/z intensity values.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"msbackendhdf-peaks-on-disk-ms-data-backend","dir":"Reference","previous_headings":"","what":"MsBackendHdf5Peaks, on-disk MS data backend","title":"Mass spectrometry data backends — MsBackend","text":"MsBackendHdf5Peaks keeps, similar MsBackendMzR, peak data (.e. m/z intensity values) custom data files (HDF5 format) disk remaining spectra variables kept memory. backend supports updating writing manipulated peak data data files. New objects can created MsBackendHdf5Peaks() function can subsequently filled data calling object's backendInitialize() method passing desired file names HDF5 data files along spectra variables form DataFrame (see MsBackendDataFrame expected format). optional parameter hdf5path allows specify folder HDF5 data files stored . provided, added path submitted file names (parameter files). default backendInitialize() store peak data single HDF5 file name provided parameter files. store peak data across several HDF5 files data contain column \"dataStorage\" defines grouping spectra/peaks files: peaks spectra value \"dataStorage\" saved HDF5 file. parameter files omitted, value dataStorage used file name (replacing file ending \".h5\". specify file names, files' length match number unique elements \"dataStorage\". details see examples Spectra() help page. MsBackendHdf5Peaks ignores parameter columns peaksData() function returns always m/z intensity values.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Mass spectrometry data backends — MsBackend","text":"Johannes Rainer, Sebastian Gibb, Laurent Gatto, Philippine Louail","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackend.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Mass spectrometry data backends — MsBackend","text":"","code":"## The MsBackend class is a virtual class and can not be instantiated ## directly. Below we define a new backend class extending this virtual ## class MsBackendDummy <- setClass(\"MsBackendDummy\", contains = \"MsBackend\") MsBackendDummy() #> An object of class \"MsBackendDummy\" #> Slot \"readonly\": #> [1] FALSE #> #> Slot \"version\": #> [1] \"0.1\" #> ## This class inherits now all methods from `MsBackend`, all of which ## however throw an error. These methods would have to be implemented ## for the new backend class. try(mz(MsBackendDummy())) #> Error in .local(object, ...) : Not implemented for MsBackendDummy. ## See `MsBackendDataFrame` as a reference implementation for a backend ## class (in the *R/MsBackendDataFrame.R* file). ## MsBackendDataFrame ## ## The `MsBackendDataFrame` uses a `S4Vectors::DataFrame` to store all MS ## data. Below we create such a backend by passing a `DataFrame` with all ## data to it. data <- DataFrame(msLevel = c(1L, 2L, 1L), scanIndex = 1:3) data$mz <- list(c(1.1, 1.2, 1.3), c(1.4, 54.2, 56.4, 122.1), c(15.3, 23.2)) data$intensity <- list(c(3, 2, 3), c(45, 100, 12.2, 1), c(123, 12324.2)) ## Backends are supposed to be created with their specific constructor ## function be <- MsBackendDataFrame() be #> MsBackendDataFrame with 0 spectra ## The `backendInitialize()` method initializes the backend filling it with ## data. This method can take any parameters needed for the backend to ## get loaded with the data (e.g. a file name from which to load the data, ## a database connection or, in this case, a data frame containing the data). be <- backendInitialize(be, data) be #> MsBackendDataFrame with 3 spectra #> msLevel rtime scanIndex #> #> 1 1 NA 1 #> 2 2 NA 2 #> 3 1 NA 3 #> ... 16 more variables/columns. ## Data can be accessed with the accessor methods msLevel(be) #> [1] 1 2 1 mz(be) #> NumericList of length 3 #> [[1]] 1.1 1.2 1.3 #> [[2]] 1.4 54.2 56.4 122.1 #> [[3]] 15.3 23.2 ## Even if no data was provided for all spectra variables, its accessor ## methods are supposed to return a value. precursorMz(be) #> [1] NA NA NA ## The `peaksData()` method is supposed to return the peaks of the spectra as ## a `list`. peaksData(be) #> [[1]] #> mz intensity #> [1,] 1.1 3 #> [2,] 1.2 2 #> [3,] 1.3 3 #> #> [[2]] #> mz intensity #> [1,] 1.4 45.0 #> [2,] 54.2 100.0 #> [3,] 56.4 12.2 #> [4,] 122.1 1.0 #> #> [[3]] #> mz intensity #> [1,] 15.3 123.0 #> [2,] 23.2 12324.2 #> ## List available peaks variables peaksVariables(be) #> [1] \"mz\" \"intensity\" ## Use columns to extract specific peaks variables. Below we extract m/z and ## intensity values, but in reversed order to the default. peaksData(be, columns = c(\"intensity\", \"mz\")) #> [[1]] #> intensity mz #> [1,] 3 1.1 #> [2,] 2 1.2 #> [3,] 3 1.3 #> #> [[2]] #> intensity mz #> [1,] 45.0 1.4 #> [2,] 100.0 54.2 #> [3,] 12.2 56.4 #> [4,] 1.0 122.1 #> #> [[3]] #> intensity mz #> [1,] 123.0 15.3 #> [2,] 12324.2 23.2 #> ## List available spectra variables (i.e. spectrum metadata) spectraVariables(be) #> [1] \"msLevel\" \"rtime\" #> [3] \"acquisitionNum\" \"scanIndex\" #> [5] \"mz\" \"intensity\" #> [7] \"dataStorage\" \"dataOrigin\" #> [9] \"centroided\" \"smoothed\" #> [11] \"polarity\" \"precScanNum\" #> [13] \"precursorMz\" \"precursorIntensity\" #> [15] \"precursorCharge\" \"collisionEnergy\" #> [17] \"isolationWindowLowerMz\" \"isolationWindowTargetMz\" #> [19] \"isolationWindowUpperMz\" ## Extract precursor m/z, rtime, MS level spectra variables spectraData(be, c(\"precursorMz\", \"rtime\", \"msLevel\")) #> DataFrame with 3 rows and 3 columns #> precursorMz rtime msLevel #> #> 1 NA NA 1 #> 2 NA NA 2 #> 3 NA NA 1 ## MsBackendMemory ## ## The `MsBackendMemory` uses a more efficient internal data organization ## and allows also adding arbitrary additional peaks variables (annotations) ## Below we thus add a column \"peak_ann\" with arbitrary names/ids for each ## peak and add the name of this column to the `peaksVariables` parameter ## of the `backendInitialize()` method (in addition to `\"mz\"` and ## `\"intensity\"` that should **always** be specified. data$peak_ann <- list(c(\"a\", \"\", \"d\"), c(\"\", \"d\", \"e\", \"f\"), c(\"h\", \"i\")) be <- backendInitialize(MsBackendMemory(), data, peaksVariables = c(\"mz\", \"intensity\", \"peak_ann\")) be #> MsBackendMemory with 3 spectra #> msLevel rtime scanIndex #> #> 1 1 NA 1 #> 2 2 NA 2 #> 3 1 NA 3 #> ... 17 more variables/columns. spectraVariables(be) #> [1] \"msLevel\" \"rtime\" #> [3] \"acquisitionNum\" \"scanIndex\" #> [5] \"mz\" \"intensity\" #> [7] \"dataStorage\" \"dataOrigin\" #> [9] \"centroided\" \"smoothed\" #> [11] \"polarity\" \"precScanNum\" #> [13] \"precursorMz\" \"precursorIntensity\" #> [15] \"precursorCharge\" \"collisionEnergy\" #> [17] \"isolationWindowLowerMz\" \"isolationWindowTargetMz\" #> [19] \"isolationWindowUpperMz\" \"peak_ann\" ## peak_ann is also listed as a peaks variable peaksVariables(be) #> [1] \"mz\" \"intensity\" \"peak_ann\" ## The additional peaks variable can be accessed using the `peaksData()` ## function peaksData(be, \"peak_ann\") #> [[1]] #> peak_ann #> 1 a #> 2 #> 3 d #> #> [[2]] #> peak_ann #> 1 #> 2 d #> 3 e #> 4 f #> #> [[3]] #> peak_ann #> 1 h #> 2 i #> ## The $<- method can be used to replace values of an existing peaks ## variable. It is important that the number of elements matches the ## number of peaks per spectrum. be$peak_ann <- list(1:3, 1:4, 1:2) ## A peaks variable can again be removed by setting it to NULL be$peak_ann <- NULL peaksVariables(be) #> [1] \"mz\" \"intensity\""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackendCached.html","id":null,"dir":"Reference","previous_headings":"","what":"Base MsBackend class providing data caching mechanism — MsBackendCached","title":"Base MsBackend class providing data caching mechanism — MsBackendCached","text":"MsBackendCached class rudimentary implementation MsBackend providing simple mechanism cache spectra data locally. class thought used base class MsBackend implementations reuse caching mechanism avoid re-implement commonly used methods. class thus thought used directly user. MsBackendCached caching mechanism allows MsBackend instances add replace spectra variables even backend used allow alter values (e.g. SQL database used backend). replacement operation $<- add specified values local data.frame within MsBackendCached class allows cache values (increasing obviously memory demand object). data accessor functions extending MsBackend class ($ msLevel() spectraData()) first use callNextMethod() call respective accessor MsBackendCached evaluate requested spectra variable(s) local cache return . requested spectra variables neither local cache, listed @spectraVariables slot (defines spectra variables can requested extending MsBackend class) core spectra variables missing values correct data type returned.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackendCached.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Base MsBackend class providing data caching mechanism — MsBackendCached","text":"","code":"MsBackendCached() # S4 method for class 'MsBackendCached' backendInitialize( object, data = data.frame(), nspectra = 0L, spectraVariables = character(), ... ) # S4 method for class 'MsBackendCached' dataStorage(object) # S4 method for class 'MsBackendCached,ANY' extractByIndex(object, i) # S4 method for class 'MsBackendCached' length(x) # S4 method for class 'MsBackendCached' spectraVariables(object) # S4 method for class 'MsBackendCached' spectraData(object, columns = spectraVariables(object)) # S4 method for class 'MsBackendCached' spectraData(object) <- value # S4 method for class 'MsBackendCached' x[i, j, ..., drop = FALSE] # S4 method for class 'MsBackendCached' x$name # S4 method for class 'MsBackendCached' x$name <- value # S4 method for class 'MsBackendCached' selectSpectraVariables(object, spectraVariables = spectraVariables(object)) # S4 method for class 'MsBackendCached' show(object) # S4 method for class 'MsBackendCached' acquisitionNum(object) # S4 method for class 'MsBackendCached' centroided(object) # S4 method for class 'MsBackendCached' centroided(object) <- value # S4 method for class 'MsBackendCached' collisionEnergy(object) # S4 method for class 'MsBackendCached' collisionEnergy(object) <- value # S4 method for class 'MsBackendCached' dataOrigin(object) # S4 method for class 'MsBackendCached' dataOrigin(object) <- value # S4 method for class 'MsBackendCached' msLevel(object) # S4 method for class 'MsBackendCached' intensity(object) # S4 method for class 'MsBackendCached' ionCount(object) # S4 method for class 'MsBackendCached' isEmpty(x) # S4 method for class 'MsBackendCached' isolationWindowLowerMz(object) # S4 method for class 'MsBackendCached' isolationWindowLowerMz(object) <- value # S4 method for class 'MsBackendCached' isolationWindowTargetMz(object) # S4 method for class 'MsBackendCached' isolationWindowTargetMz(object) <- value # S4 method for class 'MsBackendCached' isolationWindowUpperMz(object) # S4 method for class 'MsBackendCached' isolationWindowUpperMz(object) <- value # S4 method for class 'MsBackendCached' lengths(x, use.names = FALSE) # S4 method for class 'MsBackendCached' mz(object) # S4 method for class 'MsBackendCached' polarity(object) # S4 method for class 'MsBackendCached' polarity(object) <- value # S4 method for class 'MsBackendCached' precursorCharge(object) # S4 method for class 'MsBackendCached' precursorIntensity(object) # S4 method for class 'MsBackendCached' precursorMz(object) # S4 method for class 'MsBackendCached' rtime(object) # S4 method for class 'MsBackendCached' rtime(object) <- value # S4 method for class 'MsBackendCached' scanIndex(object) # S4 method for class 'MsBackendCached' smoothed(object) # S4 method for class 'MsBackendCached' smoothed(object) <- value"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackendCached.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Base MsBackend class providing data caching mechanism — MsBackendCached","text":"object MsBackendCached object. data backendInitialize(): (optional) data.frame cached values. number rows (order) match number spectra. nspectra backendInitialize(): integer number spectra. spectraVariables backendInitialize(): character names spectra variables provided extending backend. selectSpectraVariables(): character specifying spectra variables keep. ... ignored [: integer indices subset object. x MsBackendCached object. columns spectraData(): character names spectra variables retrieve. value replacement value <- methods. See individual method description expected data type. j [: ignored. drop [: considered. name $<-: name spectra variable set. use.names lengths(): whether spectrum names used.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackendCached.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Base MsBackend class providing data caching mechanism — MsBackendCached","text":"See documentation respective function.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackendCached.html","id":"implementation-notes","dir":"Reference","previous_headings":"","what":"Implementation notes","title":"Base MsBackend class providing data caching mechanism — MsBackendCached","text":"Classes extending MsBackendCached need call backendInitialize() method class backendInitialize() method set least number spectra nspectra parameter spectraVariables available (extending) backend class. implement spectraData() method also calls spectraData() method MsBackendCached also retrieve cached values (e.g. using res <- callNextMethod() beginning spectraData function). spectraData,MsBackendCached method return NULL selected spectra variables cached core spectra variables provided extending backend. Thus, extending backend can proceed retrieve respective values backend/data storage. implement eventually [ method calls addition [ MsBackendCached. methods accessing setting spectra variables need implemented extending backend class (default implementations MsBackendCached used instead; ensure cached values returned first). Spectra variables can modified added using $<- method MsBackendCached. Replacing adding multiple variables using spectraData<- supported MsBackendCached. extending backend might however implement method internally uses $<- add/replace single variables. MsBackendCached following slots: nspectra: integer(1) defining number spectra backend. variable needs set must match number rows localData actual number spectra (extending) backend. localData: data.frame cached local data. replacement operation $<- set/add column respective values. spectraVariables: character defining spectra variables provided extending MsBackend class (e.g. spectra variables can retrieved data base original data files).","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackendCached.html","id":"available-methods","dir":"Reference","previous_headings":"","what":"Available methods","title":"Base MsBackend class providing data caching mechanism — MsBackendCached","text":"acquisitionNum(): returns acquisition number spectrum. Returns integer length equal number spectra (NA_integer_ available). backendInitialize(): initializes backend. method takes parameters data (data.frame cached data), nspectra (integer defining number spectra) spectraVariables (character spectra variables provided extending backend. centroided(), centroided<-: gets sets centroiding information spectra. centroided returns logical vector length equal number spectra TRUE spectrum centroided, FALSE profile mode NA undefined. See also isCentroided estimating spectrum data whether spectrum centroided. value centroided<- either single logical logical length equal number spectra object. collisionEnergy(), collisionEnergy<-: gets sets collision energy spectra object. collisionEnergy() returns numeric length equal number spectra (NA_real_ present/defined), collisionEnergy<- takes numeric length equal number spectra object. dataOrigin(): gets character length equal number spectra object data origin spectrum. e.g. mzML file data read. intensity(): gets intensity values spectra. Returns NumericList() numeric vectors (intensity values spectrum). length list equal number spectra object. ionCount(): returns numeric sum intensities spectrum. spectrum empty (see isEmpty()), NA_real_ returned. isEmpty(): checks whether spectrum object empty (.e. contain peaks). Returns logical vector length equal number spectra. isolationWindowLowerMz(), isolationWindowLowerMz<-: gets sets lower m/z boundary isolation window. isolationWindowTargetMz(), isolationWindowTargetMz<-: gets sets target m/z isolation window. isolationWindowUpperMz(), isolationWindowUpperMz<-: gets sets upper m/z boundary isolation window. length(): returns number spectra (.e. @nspectra). lengths(): gets number peaks (m/z-intensity values) per spectrum. Returns integer vector (length equal number spectra). empty spectra, 0 returned. msLevel(): gets spectra's MS level. Returns integer vector (length equal number spectra) MS level spectrum (NA_integer_ available). mz(): gets mass--charge ratios (m/z) spectra. Returns NumericList() length equal number spectra, element numeric vector m/z values one spectrum. polarity(), polarity<-: gets sets polarity spectrum. polarity returns integer vector (length equal number spectra), 0 1 representing negative positive polarities, respectively. polarity<- expects integer vector length 1 equal number spectra. precursorCharge(), precursorIntensity(), precursorMz(), precScanNum(), precAcquisitionNum(): get charge (integer), intensity (numeric), m/z (numeric), scan index (integer) acquisition number (interger) precursor MS level 2 spectra object. Returns vector length equal number spectra object. NA reported MS1 spectra precursor information available. rtime(), rtime<-: gets sets retention times spectrum (seconds). rtime() returns numeric vector (length equal number spectra) retention time spectrum. rtime<- expects numeric vector length equal number spectra. scanIndex(): returns integer vector scan index spectrum. represents relative index spectrum within file. Note can different acquisitionNum() spectrum index spectrum reported mzML file. selectSpectraVariables(): subset object specified spectra variables. eventually remove spectra variables listed @spectraVariables also drop columns local cache among spectraVariables. smoothed(),smoothed<-: gets sets whether spectrum smoothed. smoothed() returns logical vector length equal number spectra. smoothed<- takes logical vector length 1 equal number spectra object. spectraVariables(): returns available spectra variables, .e. unique set core spectra variables, cached spectra variables spectra variables defined @spectraVariables slot (.e. spectra variables thought provided extending MsBackend instance). spectraData(): returns DataFrame cached spectra variablers initialized core spectra variables. Parameter spectraVariables allows specify variables retrieve. function returns NULL requested variables cached provided extending backend. Note method returns cached spectra variables core spectra variables provided extending backend. responsibility extending backend add/provide . [: subsets cached data. Parameter needs integer vector. $, $<-: access set/add single spectrum variable (column) backend.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/Spectra/reference/MsBackendCached.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Base MsBackend class providing data caching mechanism — MsBackendCached","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":null,"dir":"Reference","previous_headings":"","what":"The Spectra class to manage and access MS data — Spectra","title":"The Spectra class to manage and access MS data — Spectra","text":"Spectra class encapsules spectral mass spectrometry (MS) data related metadata. MS data represented backend extending virual MsBackend class provides data Spectra object. Spectra class implements data accessor, filtering analysis methods MS data relies backend provide MS data. allows change data representations Spectra object depending user's needs properties data. Different backends properties explained MsBackend documentation. Documentation topics functionality Spectracan found : spectraData() accessing using MS data Spectra objects. filterMsLevel() subset filter Spectra objects. plotSpectra() visualization Spectra orbjects. processingChunkSize() information parallel chunk-wise data processing. combineSpectra() merging, aggregating splitting Spectra objects. combinePeaks() merging aggregating Spectra's mass peaks data. addProcessing() data analysis functions. compareSpectra() spectra similarity calculations.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"The Spectra class to manage and access MS data — Spectra","text":"","code":"# S4 method for class 'missing' Spectra( object, processingQueue = list(), metadata = list(), ..., backend = MsBackendMemory(), BPPARAM = bpparam() ) # S4 method for class 'MsBackend' Spectra( object, processingQueue = list(), metadata = list(), ..., BPPARAM = bpparam() ) # S4 method for class 'character' Spectra( object, processingQueue = list(), metadata = list(), source = MsBackendMzR(), backend = source, ..., BPPARAM = bpparam() ) # S4 method for class 'ANY' Spectra( object, processingQueue = list(), metadata = list(), source = MsBackendMemory(), backend = source, ..., BPPARAM = bpparam() ) # S4 method for class 'Spectra,MsBackend' setBackend( object, backend, f = processingChunkFactor(object), ..., BPPARAM = bpparam() ) # S4 method for class 'Spectra' export(object, backend, ...) # S4 method for class 'Spectra' dataStorageBasePath(object) # S4 method for class 'Spectra' dataStorageBasePath(object) <- value"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"The Spectra class to manage and access MS data — Spectra","text":"object Spectra(): object instantiate Spectra object initialize data.. See section creation Spectra objects details. methods Spectra object. processingQueue Spectra(): optional list ProcessingStep objects. metadata Spectra(): optional list metadata information. ... Additional arguments. backend Spectra(): MsBackend used backend. See section creation Spectra objects details. setBackend(): instance MsBackend supports setBackend() (.e. supportsSetBackend() returns TRUE). backends parameter data backendInitialize() function support passing full spectra data initialize method. See section creation Spectra objects details. export(): MsBackend used export data. BPPARAM Parallel setup configuration. See bpparam() information. passed directly backendInitialize() method MsBackend. source Spectra(): instance MsBackend can used import spectrum data provided files. See section Creation objects details. f setBackend(): factor defining split data parallelized copying spectra data new backend. backends changing parameter can lead errors. Defaults processingChunkFactor(). value dataStorageBasePath(): character vector defines base directory data storage files can found.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"The Spectra class to manage and access MS data — Spectra","text":"Spectra class uses default lazy data manipulation strategy, .e. data manipulations performed replaceIntensitiesBelow() applied immediately data, applied --fly spectrum data retrieved. enables data manipulation operations also read data representations. backends allow write data back data storage (MsBackendMemory(), MsBackendDataFrame() MsBackendHdf5Peaks()) possible apply queue applyProcessing() function (see applyProcessing() function details). Clarifications regarding scan/acquisition numbers indices: spectrumId (spectrumID) vendor specific field mzML file contains information run/spectrum, e.g.: controllerType=0 controllerNumber=1 scan=5281 file=2 acquisitionNum less sanitize spectrum id generated spectrumId field mzR (see ). scanIndex mzR generated sequence number spectrum raw file (acquisitionNum) See also issue.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"data-stored-in-a-spectra-object","dir":"Reference","previous_headings":"","what":"Data stored in a Spectra object","title":"The Spectra class to manage and access MS data — Spectra","text":"Spectra object container MS data includes mass peak data (m/z related intensity values, also referred peaks data context Spectra) metadata individual spectra (called spectra variables). core set spectra variables (coreSpectraVariables()) guaranteed provided Spectra, possible add arbitrary additional spectra variables Spectra object. Spectra object designed contain MS data (large) set mass spectra. data organized linearly can thought list mass spectra, .e. element Spectra one spectrum.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"creation-of-objects","dir":"Reference","previous_headings":"","what":"Creation of objects","title":"The Spectra class to manage and access MS data — Spectra","text":"Spectra classes can created Spectra() constructor function supports following formats: parameter object data.frame DataFrame containing full spectrum data (spectra variables columns well columns individual MS peak data, m/z intensity). provided backend (default MsBackendMemory) initialized data. parameter object MsBackend (assumed already initialized). parameter object missing, case supposed data provided MsBackend class passed along backend argument. parameter object type character expected file names(s) spectra imported. Parameter source allows define MsBackend able import data provided source files. default value source MsBackendMzR() allows import spectra data mzML, mzXML CDF files. ... additional arguments can passed backend's backendInitialize() method. Parameter backend allows specify MsBackend used data representation storage.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"data-representation-of-a-spectra","dir":"Reference","previous_headings":"","what":"Data representation of a Spectra","title":"The Spectra class to manage and access MS data — Spectra","text":"MS data can accessed Spectra object represented backend, means backend defines data stored (e.g. memory disk). Specrta object relies backend provide MS data whenever needs data processing. Different backends different properties, minimal memory requirement fast data access, defined Spectra package one MsBackend* packages. information backends properties provided documentation MsBackend. -disk backends keep limited amount data memory retrieving data (usually MS peak data) upon request --fly -disk data representations. Moving -disk data storage backend serialized object different location file system cause data corruption. dataStorageBasePath() dataStorageBasePath<- functions allow cases (thebackend classes support operation), get change base path directory backend's data storage. -memory backends MsBackendMemory MsBackendDataFrame keeping MS data memory support, need, function, MsBackendMzR function can used update/adapt path directory containing original data files. Thus, Spectra objects (using backend) moved another file system computer, functions allow adjust/adapt base file path.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"changing-data-representation-of-a-spectra","dir":"Reference","previous_headings":"","what":"Changing data representation of a Spectra","title":"The Spectra class to manage and access MS data — Spectra","text":"data representation, .e. backend Spectra object can changed setBackend() method takes instance new backend second parameter backend. call setBackend(sps, backend = MsBackendDataFrame()) example change backend sps -memory MsBackendDataFrame. Changing backend supported backend data parameter backendInitialize() method supportsSetBackend() returns TRUE backend. setBackend() transfer full spectra data originating backend DataFrame new backend. Generally, possible change read-backend MsBackendMzR() backend. definition function : setBackend(object, backend, ..., f = dataStorage(object), BPPARAM = bpparam()) parameters : object: Spectra object. backend: instance new backend, e.g. [MsBackendMemory()]. f: factor allowing parallelize change backends. default process copying spectra data original new backend performed separately (parallel) file. Users advised use default setting. ...: optional additional arguments passed backendInitialize() method new backend. BPPARAM: setup parallel processing. See bpparam() details.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"exporting-data-from-a-spectra-object","dir":"Reference","previous_headings":"","what":"Exporting data from a Spectra object","title":"The Spectra class to manage and access MS data — Spectra","text":"Data Spectra object can exported file export() function. actual export data performed export method MsBackend class defined mandatory parameter backend defines also format data exported. Note however backend classes support export data. MsBackend classes Spectra package currently MsBackendMzR backend supports data export (mzML/mzXML file(s)); see help page MsBackend information arguments examples vignette examples. definition function export(object, backend, ...) parameters : object: Spectra object exported. backend: instance class extending MsBackend supports export data (.e. defined export method). ...: additional parameters specific MsBackend passed parameter backend.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"The Spectra class to manage and access MS data — Spectra","text":"Sebastian Gibb, Johannes Rainer, Laurent Gatto, Philippine Louail","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/Spectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"The Spectra class to manage and access MS data — Spectra","text":"","code":"## -------- CREATION OF SPECTRA OBJECTS -------- ## Create a Spectra providing a `DataFrame` containing the spectrum data. spd <- DataFrame(msLevel = c(1L, 2L), rtime = c(1.1, 1.2)) spd$mz <- list(c(100, 103.2, 104.3, 106.5), c(45.6, 120.4, 190.2)) spd$intensity <- list(c(200, 400, 34.2, 17), c(12.3, 15.2, 6.8)) data <- Spectra(spd) data #> MSn data (Spectra) with 2 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 1.1 NA #> 2 2 1.2 NA #> ... 16 more variables/columns. ## Create a Spectra from mzML files and use the `MsBackendMzR` on-disk ## backend. sciex_file <- dir(system.file(\"sciex\", package = \"msdata\"), full.names = TRUE) sciex <- Spectra(sciex_file, backend = MsBackendMzR()) sciex #> MSn data (Spectra) with 1862 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 1 0.280 1 #> 2 1 0.559 2 #> 3 1 0.838 3 #> 4 1 1.117 4 #> 5 1 1.396 5 #> ... ... ... ... #> 1858 1 258.636 927 #> 1859 1 258.915 928 #> 1860 1 259.194 929 #> 1861 1 259.473 930 #> 1862 1 259.752 931 #> ... 33 more variables/columns. #> #> file(s): #> 20171016_POOL_POS_1_105-134.mzML #> 20171016_POOL_POS_3_105-134.mzML ## -------- CHANGING DATA REPRESENTATIONS -------- ## The MS data is on disk and will be read into memory on-demand. We can ## however change the backend to a MsBackendMemory backend which will ## keep all of the data in memory. sciex_im <- setBackend(sciex, MsBackendMemory()) sciex_im #> MSn data (Spectra) with 1862 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 0.280 1 #> 2 1 0.559 2 #> 3 1 0.838 3 #> 4 1 1.117 4 #> 5 1 1.396 5 #> ... ... ... ... #> 1858 1 258.636 927 #> 1859 1 258.915 928 #> 1860 1 259.194 929 #> 1861 1 259.473 930 #> 1862 1 259.752 931 #> ... 33 more variables/columns. #> Processing: #> Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:46:03 2024] ## The `MsBackendMemory()` supports the `setBackend()` method: supportsSetBackend(MsBackendMemory()) #> [1] TRUE ## Thus, it is possible to change to that backend with `setBackend()`. Most ## read-only backends however don't support that, such as the ## `MsBackendMzR` and `setBackend()` would fail to change to that backend. supportsSetBackend(MsBackendMzR()) #> [1] FALSE ## The on-disk object `sciex` is light-weight, because it does not keep the ## MS peak data in memory. The `sciex_im` object in contrast keeps all the ## data in memory and its size is thus much larger. object.size(sciex) #> 395976 bytes object.size(sciex_im) #> 55802328 bytes ## The spectra variable `dataStorage` returns for each spectrum the location ## where the data is stored. For in-memory objects: head(dataStorage(sciex_im)) #> [1] \"\" \"\" \"\" \"\" \"\" \"\" ## While objects that use an on-disk backend will list the files where the ## data is stored. head(dataStorage(sciex)) #> [1] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [2] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [3] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [4] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [5] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [6] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" ## The spectra variable `dataOrigin` returns for each spectrum the *origin* ## of the data. If the data is read from e.g. mzML files, this will be the ## original mzML file name: head(dataOrigin(sciex)) #> [1] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [2] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [3] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [4] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [5] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [6] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" head(dataOrigin(sciex_im)) #> [1] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [2] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [3] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [4] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [5] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" #> [6] \"/__w/_temp/Library/msdata/sciex/20171016_POOL_POS_1_105-134.mzML\" ## -------- DATA EXPORT -------- ## Some `MsBackend` classes provide an `export()` method to export the data ## to the file format supported by the backend. ## The `MsBackendMzR` for example allows to export MS data to mzML or ## mzXML file(s), the `MsBackendMgf` (defined in the MsBackendMgf R package) ## would allow to export the data in mgf file format. ## Below we export the MS data in `data`. We call the `export()` method on ## this object, specify the backend that should be used to export the data ## (and which also defines the output format) and provide a file name. fl <- tempfile() export(data, MsBackendMzR(), file = fl) ## This exported our data in mzML format. Below we read the first 6 lines ## from that file. readLines(fl, n = 6) #> [1] \"\" #> [2] \"\" #> [3] \" \" #> [4] \" \" #> [5] \" \" #> [6] \" \" ## If only a single file name is provided, all spectra are exported to that ## file. To export data with the `MsBackendMzR` backend to different files, a ## file name for each individual spectrum has to be provided. ## Below we export each spectrum to its own file. fls <- c(tempfile(), tempfile()) export(data, MsBackendMzR(), file = fls) ## Reading the data from the first file res <- Spectra(backendInitialize(MsBackendMzR(), fls[1])) mz(res) #> NumericList of length 1 #> [[1]] 100 103.2 104.3 106.5 mz(data) #> NumericList of length 2 #> [[1]] 100 103.2 104.3 106.5 #> [[2]] 45.6 120.4 190.2"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/addProcessing.html","id":null,"dir":"Reference","previous_headings":"","what":"Data manipulation and analysis methods — applyProcessing","title":"Data manipulation and analysis methods — applyProcessing","text":"Various data analysis functions available Spectra objects. can categorized functions either return Spectra object (manipulated data) functions directly return result calculation. former category, data manipulations cached result object's processing queue exectuted --fly respective data gets extracted Spectra (see section processing queue information). second category, calculations directly executed result, usually one value per spectrum, returned. Generally, reduce memory demand, chunk-wise processing data performed.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/addProcessing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Data manipulation and analysis methods — applyProcessing","text":"","code":"applyProcessing( object, f = processingChunkFactor(object), BPPARAM = bpparam(), ... ) processingLog(x) scalePeaks(x, by = sum, msLevel. = uniqueMsLevels(x)) # S4 method for class 'Spectra' addProcessing(object, FUN, ..., spectraVariables = character()) # S4 method for class 'Spectra' bin( x, binSize = 1L, breaks = NULL, msLevel. = uniqueMsLevels(x), FUN = sum, zero.rm = TRUE ) # S4 method for class 'Spectra' containsMz( object, mz = numeric(), tolerance = 0, ppm = 20, which = c(\"any\", \"all\"), BPPARAM = bpparam() ) # S4 method for class 'Spectra' containsNeutralLoss( object, neutralLoss = 0, tolerance = 0, ppm = 20, BPPARAM = bpparam() ) # S4 method for class 'Spectra' entropy(object, normalized = TRUE) # S4 method for class 'ANY' entropy(object, ...) # S4 method for class 'Spectra' pickPeaks( object, halfWindowSize = 2L, method = c(\"MAD\", \"SuperSmoother\"), snr = 0, k = 0L, descending = FALSE, threshold = 0, msLevel. = uniqueMsLevels(object), ... ) # S4 method for class 'Spectra' replaceIntensitiesBelow( object, threshold = min, value = 0, msLevel. = uniqueMsLevels(object) ) # S4 method for class 'Spectra' reset(object, ...) # S4 method for class 'Spectra' smooth( x, halfWindowSize = 2L, method = c(\"MovingAverage\", \"WeightedMovingAverage\", \"SavitzkyGolay\"), msLevel. = uniqueMsLevels(x), ... ) # S4 method for class 'Spectra' spectrapply( object, FUN, ..., chunkSize = integer(), f = factor(), BPPARAM = SerialParam() )"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/addProcessing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Data manipulation and analysis methods — applyProcessing","text":"object Spectra object. f spectrapply() applyProcessing(): factor defining object splitted eventual parallel processing. Defaults factor() spectrapply() hence object splitted defaults f = processingChunkSize(object) applyProcessing() splitting thus object default chunks depending processingChunkSize(). BPPARAM Parallel setup configuration. See bpparam() information. passed directly backendInitialize() method MsBackend. See also processingChunkSize() additional information parallel processing. ... Additional arguments passed internal downstream functions. x Spectra. scalePeaks(): function calculate single numeric intensity values spectrum intensities (spectrum) divided . default = sum divide intensities spectrum sum intensities spectrum. msLevel. integer defining MS level(s) spectra function applied (defaults MS levels object. FUN addProcessing(): function applied peak matrix spectrum object. bin(): function aggregate intensity values peaks falling bin. Defaults FUN = sum thus summing intensities. spectrapply() chunkapply(): function applied individual chunk Spectra. spectraVariables addProcessing(): character additional spectra variables passed along function defined FUN. See function description details. binSize bin(): numeric(1) defining size m/z bins. Defaults binSize = 1. breaks bin(): numeric defining m/z breakpoints bins. zero.rm bin(): logical(1) indicating whether remove bins zero intensity. Defaults TRUE, meaning function discard bins created intensity 0 enhance memory efficiency. mz containsMz(): numeric m/z value(s) mass peaks check. tolerance containsMz() neutralLoss(): numeric(1) allowing define constant maximal accepted difference m/z values peaks matched. ppm containsMz() neutralLoss(): numeric(1) defining relative, m/z-dependent, maximal accepted difference m/z values peaks matched. containsMz(): either \"\" \"\" defining whether (default) provided mz present spectrum. neutralLoss containsNeutralLoss(): numeric(1) defining value subtracted spectrum's precursor m/z. normalized entropy(): logical(1) whether normalized entropy calculated (default). See also nentropy() details. halfWindowSize pickPeaks(): integer(1), used identification mass peaks: local maximum maximum window (- halfWindowSize):(+ halfWindowSize). smooth(): integer(1), used smoothing algorithm, window reaches (- halfWindowSize):(+ halfWindowSize). method pickPeaks(): character(1), noise estimators used, currently Median Absolute Deviation (method = \"MAD\") Friedman's Super Smoother (method = \"SuperSmoother\") supported. smooth(): character(1), smoothing function used, currently, Moving-Average- (method = \"MovingAverage\"), Weighted-Moving-Average- (method = \"WeightedMovingAverage\"), Savitzky-Golay-Smoothing (method = \"SavitzkyGolay\") supported. snr pickPeaks(): double(1) defining Signal--Noise-Ratio. intensity local maximum higher snr * noise considered peak. k pickPeaks(): integer(1), number values left right peak considered weighted mean calculation. descending pickPeaks(): logical, TRUE just values betwee nearest valleys around peak centroids used. threshold pickPeaks(): numeric(1) defining proportion maximal peak intensity. values threshold used weighted mean calculation. replaceIntensitiesBelow(): numeric(1) defining threshold function calculate threshold spectrum intensity values. Defaults threshold = min. value replaceIntensitiesBelow(): numeric(1) defining value intensities replaced . chunkSize spectrapply(): size chunks Spectra split. parameter overrides parameters f BPPARAM.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/addProcessing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Data manipulation and analysis methods — applyProcessing","text":"See documentation individual functions description return value.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/addProcessing.html","id":"data-analysis-methods-returning-a-spectra","dir":"Reference","previous_headings":"","what":"Data analysis methods returning a Spectra","title":"Data manipulation and analysis methods — applyProcessing","text":"methods listed return Spectra object result. addProcessing(): adds arbitrary function applied peaks matrix every spectrum object. function (can passed parameter FUN) expected take peaks matrix input return peaks matrix. peaks matrix numeric matrix two columns, first containing m/z values peaks second corresponding intensities. function ... definition. Additional arguments can passed .... parameter spectraVariables possible define additional spectra variables object passed function FUN. passed name (e.g. specifying spectraVariables = \"precursorMz\" pass spectra's precursor m/z parameter named precursorMz function. exception spectra's MS level, passed function parameter called spectrumMsLevel (.e. spectraVariables = \"msLevel\" MS levels spectrum submitted function parameter called spectrumMsLevel). Examples provided package vignette. bin(): aggregates individual spectra discrete (m/z) bins. Binning performed spectra specified MS level(s) (parameter msLevel, default MS levels x). bins can defined parameter breaks default equally sized bins, size defined parameter binSize, minimal maximal m/z spectra (MS level msLevel) within x. bins used spectra x. intensity values peaks falling bin aggregated using function provided parameter FUN (defaults FUN = sum, .e. intensities summed ). Note binning operation applied peak data --fly upon data access possible revert operation reset() function (see description reset() ). countIdentifications: counts number identifications scan led . See countIdentifications() details. pickPeaks(): picks peaks individual spectra using moving window-based approach (window size = 2 * halfWindowSize). noisy spectra currently two different noise estimators available, Median Absolute Deviation (method = \"MAD\") Friedman's Super Smoother (method = \"SuperSmoother\"), implemented MsCoreUtils::noise(). method supports also optionally refine m/z value identified centroids considering data points belong (likely) mass peak. Therefore m/z value calculated intensity weighted average m/z values within peak region. peak region defined m/z values (respective intensities) 2 * k closest signals centroid closest valleys (descending = TRUE) 2 * k region. latter k chosen general larger. See MsCoreUtils::refineCentroids() details. ratio signal highest intensity peak threshold ignored weighted average. replaceIntensitiesBelow(): replaces intensities specified threshold provided value. Parameter threshold can either single numeric value function applied non-NA intensities spectrum determine threshold value spectrum. default threshold = min replaces values <= minimum intensity spectrum value (default value 0). Note function specified threshold expected parameter na.rm since na.rm = TRUE passed function. spectrum profile mode, ranges successive non-0 peaks <= threshold set 0. Parameter msLevel. allows apply spectra certain MS level(s). scalePeaks(): scales intensities peaks within spectrum depending parameter . = sum (default) peak intensities divided sum peak intensities within spectrum. sum intensities thus 1 spectrum scaling. Parameter msLevel. allows apply scaling spectra certain MS level. default (msLevel. = uniqueMsLevels(x)) intensities spectra scaled. smooth(): smooths individual spectra using moving window-based approach (window size = 2 * halfWindowSize). Currently, Moving-Average- (method = \"MovingAverage\"), Weighted-Moving-Average- (method = \"WeightedMovingAverage\"), weights depending distance center calculated 1/2^(-halfWindowSize:halfWindowSize)) Savitzky-Golay-Smoothing (method = \"SavitzkyGolay\") supported. details choose correct halfWindowSize please see MsCoreUtils::smooth().","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/addProcessing.html","id":"data-analysis-methods-returning-the-result-from-the-calculation","dir":"Reference","previous_headings":"","what":"Data analysis methods returning the result from the calculation","title":"Data manipulation and analysis methods — applyProcessing","text":"functions listed section return immediately result calculation. reduce memory demand (allow parallel processing) calculations chunk-wise processing generally performed. chunkapply(): apply arbitrary function chunks spectra. See chunkapply() details examples. containsMz(): checks spectra whether contain mass peaks m/z equal mz (given acceptable difference defined parameters tolerance ppm - see common() details). Parameter allows define whether (= \"\", default) (= \"\") mz match. function returns NA mz length 0 NA. containsNeutralLoss(): checks spectrum object peak m/z value equal precursor m/z - neutralLoss (given acceptable difference defined parameters tolerance ppm). Returns NA MS1 spectra (spectra without precursor m/z). entropy(): calculates entropy spectra based metrics suggested Li et al. (https://doi.org/10.1038/s41592-021-01331-z). See also nentropy() MsCoreUtils package details. estimatePrecursorIntensity(): defines precursor intensities MS2 spectra using intensity matching MS1 peak closest MS1 spectrum (.e. last MS1 spectrum measured respective MS2 spectrum). method = \"interpolation\" also possible calculate precursor intensity based interpolation intensity values (retention times) matching MS1 peaks previous next MS1 spectrum. See estimatePrecursorIntensity() examples details. estimatePrecursorMz(): DDA data: allows estimate fragment spectra's precursor m/z based reported precursor m/z data previous MS1 spectrum. See estimatePrecursorMz() details. neutralLoss(): calculates neutral loss spectra fragment spectra. See neutralLoss() detailed documentation. spectrapply(): applies given function individual spectrum sets Spectra object. default, Spectra split individual spectra (.e. Spectra length 1) function FUN applied . alternative splitting can defined parameter f. Parameters FUN can passed using .... returned result order depend function FUN object split (hence f, provided). Parallel processing supported can configured parameter BPPARAM, however suggested computational intense FUN. alternative (eventual parallel) processing full Spectra, spectrapply() supports also chunk-wise processing. , parameter chunkSize needs specified. object split chunks size chunkSize (stepwise) processed FUN. guarantees lower memory demand (especially -disk backends) since data one chunk needs loaded memory iteration. Note specifying chunkSize, parameters f BPPARAM ignored. See also chunkapply() examples details chunk-wise processing.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/addProcessing.html","id":"the-processing-queue","dir":"Reference","previous_headings":"","what":"The processing queue","title":"Data manipulation and analysis methods — applyProcessing","text":"Operations modify mass peak data, .e. m/z intensity values Spectra generally applied immediately data cached within object's processing queue. operations applied data upon request, example m/z /intensity values extracted. lazy execution guarantees functionality can applied Spectra object, regardless type backend used. Thus, data manipulation operations can also applied data read . side effect, enables also undo operations using reset() function. Functions related processing queue : applyProcessing(): Spectra objects use writeable backend : apply steps lazy processing queue peak data write back data storage. Parameter f allows specify object split parallel processing. either equal dataStorage, f = rep(1, length(object)) disable parallel processing alltogether. partitionings might result errors (especially MsBackendHdf5Peaks backend used). processingLog(): returns character vector processing log messages. reset(): restores data original state (much possible): removes processing steps lazy processing queue calls reset() backend , depending backend, can also undo e.g. data filtering operations. Note reset*( call applyProcessing() effect. See examples information.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/Spectra/reference/addProcessing.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Data manipulation and analysis methods — applyProcessing","text":"Sebastian Gibb, Johannes Rainer, Laurent Gatto, Philippine Louail, Nir Shahaf, Mar Garcia-Aloy","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/addProcessing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Data manipulation and analysis methods — applyProcessing","text":"","code":"## Load a `Spectra` object with LC-MS/MS data. fl <- system.file(\"TripleTOF-SWATH\", \"PestMix1_DDA.mzML\", package = \"msdata\") sps_dda <- Spectra(fl) sps_dda #> MSn data (Spectra) with 7602 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 1 0.231 1 #> 2 1 0.351 2 #> 3 1 0.471 3 #> 4 1 0.591 4 #> 5 1 0.711 5 #> ... ... ... ... #> 7598 1 899.491 7598 #> 7599 1 899.613 7599 #> 7600 1 899.747 7600 #> 7601 1 899.872 7601 #> 7602 1 899.993 7602 #> ... 33 more variables/columns. #> #> file(s): #> PestMix1_DDA.mzML ## -------- FUNCTIONS RETURNING A SPECTRA -------- ## Replace peak intensities below 40 with a value of 1 sps_mod <- replaceIntensitiesBelow(sps_dda, threshold = 20, value = 1) sps_mod #> MSn data (Spectra) with 7602 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 1 0.231 1 #> 2 1 0.351 2 #> 3 1 0.471 3 #> 4 1 0.591 4 #> 5 1 0.711 5 #> ... ... ... ... #> 7598 1 899.491 7598 #> 7599 1 899.613 7599 #> 7600 1 899.747 7600 #> 7601 1 899.872 7601 #> 7602 1 899.993 7602 #> ... 33 more variables/columns. #> #> file(s): #> PestMix1_DDA.mzML #> Lazy evaluation queue: 1 processing step(s) #> Processing: #> Signal <= 20 in MS level(s) 1, 2 set to 0 [Mon Dec 9 10:46:04 2024] ## Get the intensities of the first spectrum before and after the ## operation intensity(sps_dda[1]) #> NumericList of length 1 #> [[1]] 0.0307632219046354 0.163443520665169 ... 0.507792055606842 intensity(sps_mod[1]) #> NumericList of length 1 #> [[1]] 1 1 1 1 1 1 88.7230834960938 1 1 1 1 1 1 1 ... 1 1 1 1 1 1 1 1 1 1 1 1 1 ## Remove all peaks with an intensity below 5. sps_mod <- filterIntensity(sps_dda, intensity = c(5, Inf)) intensity(sps_mod) #> NumericList of length 7602 #> [[1]] 88.7230834960938 6.28782653808594 #> [[2]] 90.9452285766602 6.51183843612671 #> [[3]] 117.253837585449 6.71664762496948 #> [[4]] 75.9008331298828 8.15607166290283 #> [[5]] 63.7168960571289 8.26729297637939 6.08404684066772 #> [[6]] 81.0469970703125 6.34799957275391 #> [[7]] 68.0150375366211 7.7239465713501 5.05049753189087 #> [[8]] 84.4253540039062 7.3393931388855 #> [[9]] intensity=111.353569030762 #> [[10]] 84.0783767700195 8.68693542480469 6.3865818977356 #> ... #> <7592 more elements> ## In addition it is possible to pass a function to `filterIntensity()`: in ## the example below we want to keep only peaks that have an intensity which ## is larger than one third of the maximal peak intensity in that spectrum. keep_peaks <- function(x, prop = 3) { x > max(x, na.rm = TRUE) / prop } sps_mod <- filterIntensity(sps_dda, intensity = keep_peaks) intensity(sps_mod) #> NumericList of length 7602 #> [[1]] intensity=88.7230834960938 #> [[2]] intensity=90.9452285766602 #> [[3]] intensity=117.253837585449 #> [[4]] intensity=75.9008331298828 #> [[5]] intensity=63.7168960571289 #> [[6]] intensity=81.0469970703125 #> [[7]] intensity=68.0150375366211 #> [[8]] intensity=84.4253540039062 #> [[9]] intensity=111.353569030762 #> [[10]] intensity=84.0783767700195 #> ... #> <7592 more elements> ## We can also change the proportion by simply passing the `prop` parameter ## to the function. To keep only peaks that have an intensity which is ## larger than half of the maximum intensity: sps_mod <- filterIntensity(sps_dda, intensity = keep_peaks, prop = 2) intensity(sps_mod) #> NumericList of length 7602 #> [[1]] intensity=88.7230834960938 #> [[2]] intensity=90.9452285766602 #> [[3]] intensity=117.253837585449 #> [[4]] intensity=75.9008331298828 #> [[5]] intensity=63.7168960571289 #> [[6]] intensity=81.0469970703125 #> [[7]] intensity=68.0150375366211 #> [[8]] intensity=84.4253540039062 #> [[9]] intensity=111.353569030762 #> [[10]] intensity=84.0783767700195 #> ... #> <7592 more elements> ## With the `scalePeaks()` function we can alternatively scale the ## intensities of mass peaks per spectrum to relative intensities. This ## is specifically useful for fragment (MS2) spectra. We below thus ## scale the intensities per spectrum by the total sum of intensities ## (such that the sum of all intensities per spectrum is 1). ## Below we scale the intensities of all MS2 spectra in our data set. sps_mod <- scalePeaks(sps_dda, msLevel = 2L) ## MS1 spectra were not affected sps_mod |> filterMsLevel(1L) |> intensity() #> NumericList of length 4627 #> [[1]] 0.0307632219046354 0.163443520665169 ... 0.507792055606842 #> [[2]] 0.124385602772236 0.306980639696121 ... 0.752154946327209 #> [[3]] 0.140656530857086 0.194816112518311 ... 0.455461025238037 #> [[4]] 0.0389336571097374 0.357547700405121 ... 0.478326231241226 #> [[5]] 0.124386593699455 0.054143700748682 ... 0.251276850700378 #> [[6]] 0.0940475389361382 0.247442871332169 ... 0.10762557387352 #> [[7]] 0.0940475389361382 0.17366424202919 ... 0.355754435062408 #> [[8]] 0.0389340370893478 0.116887390613556 ... 0.40066459774971 #> [[9]] 0.0307626128196716 0.0626986622810364 ... 0.359330594539642 #> [[10]] 0.217585012316704 0.333028763532639 ... 0.297511428594589 #> ... #> <4617 more elements> ## Intensities of MS2 spectra were scaled sps_mod |> filterMsLevel(2L) |> intensity() #> NumericList of length 2975 #> [[1]] 0.237546288845328 0.478541149367473 0.283912561787199 #> [[2]] 0.137308998224213 0.0223434223564616 0.840347579419325 #> [[3]] 0.406266967176935 0.53879813438082 0.0549348984422444 #> [[4]] 0.280229322504475 0.381273738198204 0.338496939297321 #> [[5]] intensity=1 #> [[6]] 0.104432137389865 0.0285431704350093 ... 0.0402209771615151 #> [[7]] 0.0386159813711874 0.346130168120392 ... 0.228058722675167 #> [[8]] numeric(0) #> [[9]] 0.210018635385678 0.216171000981623 ... 0.0462104568765319 #> [[10]] 0.0555197043853142 0.722227534151142 0.166680504527357 0.0555722569361873 #> ... #> <2965 more elements> ## Since data manipulation operations are by default not directly applied to ## the data but only cached in the internal processing queue, it is also ## possible to remove these data manipulations with the `reset()` function: tmp <- reset(sps_mod) tmp #> MSn data (Spectra) with 7602 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 1 0.231 1 #> 2 1 0.351 2 #> 3 1 0.471 3 #> 4 1 0.591 4 #> 5 1 0.711 5 #> ... ... ... ... #> 7598 1 899.491 7598 #> 7599 1 899.613 7599 #> 7600 1 899.747 7600 #> 7601 1 899.872 7601 #> 7602 1 899.993 7602 #> ... 33 more variables/columns. #> #> file(s): #> PestMix1_DDA.mzML #> Processing: #> Scale peak intensities in spectra of MS level(s) 2. [Mon Dec 9 10:46:07 2024] #> Reset object. [Mon Dec 9 10:46:07 2024] lengths(sps_dda) |> head() #> [1] 223 211 227 210 220 228 lengths(sps_mod) |> head() #> [1] 223 211 227 210 220 228 lengths(tmp) |> head() #> [1] 223 211 227 210 220 228 ## Data manipulation operations cached in the processing queue can also be ## applied to the mass peaks data with the `applyProcessing()` function, if ## the `Spectra` uses a backend that supports that (i.e. allows replacing ## the mass peaks data). Below we first change the backend to a ## `MsBackendMemory()` and then use the `applyProcessing()` to modify the ## mass peaks data sps_dda <- setBackend(sps_dda, MsBackendMemory()) sps_mod <- filterIntensity(sps_dda, intensity = c(5, Inf)) sps_mod <- applyProcessing(sps_mod) sps_mod #> MSn data (Spectra) with 7602 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 0.231 1 #> 2 1 0.351 2 #> 3 1 0.471 3 #> 4 1 0.591 4 #> 5 1 0.711 5 #> ... ... ... ... #> 7598 1 899.491 7598 #> 7599 1 899.613 7599 #> 7600 1 899.747 7600 #> 7601 1 899.872 7601 #> 7602 1 899.993 7602 #> ... 33 more variables/columns. #> Processing: #> Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:46:10 2024] #> Remove peaks with intensities outside [5, Inf] in spectra of MS level(s) 1, 2. [Mon Dec 9 10:46:10 2024] #> Applied processing queue with 1 steps [Mon Dec 9 10:46:10 2024] ## While we can't *undo* this filtering operation now using the `reset()` ## function, accessing the data would now be faster, because the operation ## does no longer to be applied to the original data before returning to the ## user. ## -------- FUNCTIONS RETURNING THE RESULT -------- ## With the `spectrapply()` function it is possible to apply an ## arbitrary function to each spectrum in a Spectra. ## In the example below we calculate the mean intensity for each spectrum ## in a subset of the sciex_im data. Note that we can access all variables ## of each individual spectrum either with the `$` operator or the ## corresponding method. res <- spectrapply(sps_dda[1:20], FUN = function(x) mean(x$intensity[[1]])) head(res) #> $`1` #> [1] 0.9623952 #> #> $`2` #> [1] 1.016938 #> #> $`3` #> [1] 1.056198 #> #> $`4` #> [1] 0.9000712 #> #> $`5` #> [1] 0.8756414 #> #> $`6` #> [1] 0.9105883 #> ## As an alternative, applying a function `FUN` to a `Spectra` can be ## performed *chunk-wise*. The advantage of this is, that only the data for ## one chunk at a time needs to be loaded into memory reducing the memory ## demand. This type of processing can be performed by specifying the size ## of the chunks (i.e. number of spectra per chunk) with the `chunkSize` ## parameter spectrapply(sps_dda[1:20], lengths, chunkSize = 5L) #> [1] 223 211 227 210 220 228 201 215 214 211 208 217 219 190 201 195 196 208 233 #> [20] 224 ## Precursor intensity estimation. Some manufacturers don't report the ## precursor intensity for MS2 spectra: sps_dda |> filterMsLevel(2L) |> precursorIntensity() #> [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [223] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [260] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [297] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [334] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [371] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [408] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [445] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [482] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [519] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [556] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [593] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [630] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [667] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [704] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [741] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [778] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [815] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [852] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [889] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [926] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [963] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1000] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1037] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1074] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1111] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1148] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1185] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1222] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1259] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1296] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1333] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1370] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1407] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1444] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1481] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1518] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1555] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1592] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1629] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1666] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1703] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1740] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1777] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1814] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1851] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1888] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1925] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1962] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [1999] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2036] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2073] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2110] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2147] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2184] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2221] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2258] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2295] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2332] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2369] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2406] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2443] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2480] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2517] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2554] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2591] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2628] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2665] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2702] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2739] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2776] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2813] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2850] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2887] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2924] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [2961] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ## This intensity can however be estimated from the previously measured ## MS1 scan with the `estimatePrecursorIntensity()` function: pi <- estimatePrecursorIntensity(sps_dda) ## This function returned the result as a `numeric` vector with one ## value per spectrum: pi #> [1] NA NA NA NA NA #> [6] NA NA NA NA NA #> [11] NA NA NA NA NA #> [16] NA NA NA NA NA #> [21] NA NA NA NA NA #> [26] NA NA NA NA NA #> [31] NA NA NA NA NA #> [36] NA NA NA NA NA #> [41] NA NA NA NA NA #> [46] NA NA NA NA NA #> [51] NA NA NA NA NA #> [56] NA NA 0.2562894 NA NA #> [61] NA NA NA NA NA #> [66] NA NA NA NA NA #> [71] NA NA NA NA NA #> [76] NA NA NA NA NA #> [81] NA NA NA NA NA #> [86] NA NA NA NA NA #> [91] NA NA NA NA NA #> [96] NA NA NA NA NA #> [101] NA NA NA NA NA #> [106] 0.6533012 NA NA NA NA #> [111] NA NA NA NA NA #> [116] NA NA NA NA NA #> [121] NA NA NA NA NA #> [126] NA NA NA NA NA #> [131] NA NA NA NA NA #> [136] NA NA NA NA NA #> [141] NA NA NA NA NA #> [146] NA NA NA NA NA #> [151] NA NA NA NA NA #> [156] NA NA NA NA NA #> [161] NA NA NA NA NA #> [166] NA NA NA NA NA #> [171] NA NA NA NA NA #> [176] NA NA NA NA NA #> [181] NA NA NA NA NA #> [186] 0.9115737 NA NA NA NA #> [191] NA NA NA NA NA #> [196] NA NA NA NA NA #> [201] 2.0881963 NA NA NA NA #> [206] NA NA NA NA NA #> [211] NA NA NA NA NA #> [216] NA NA NA 0.4161463 NA #> [221] NA NA NA NA NA #> [226] NA NA NA NA NA #> [231] NA NA NA NA NA #> [236] NA NA NA NA NA #> [241] NA 1.6393325 NA NA NA #> [246] NA NA NA NA NA #> [251] NA NA NA NA NA #> [256] NA NA NA NA NA #> [261] NA 1.9403350 0.2138104 NA NA #> [266] NA NA NA NA NA #> [271] NA NA NA NA NA #> [276] NA 2.2869656 NA NA NA #> [281] NA NA NA NA NA #> [286] NA NA NA NA 0.3581794 #> [291] NA NA NA NA NA #> [296] NA NA 1.2965702 NA NA #> [301] NA NA NA NA NA #> [306] NA NA NA NA NA #> [311] NA NA NA NA NA #> [316] NA NA NA NA NA #> [321] NA NA NA NA NA #> [326] NA 7.1932635 NA 1.7952728 NA #> [331] NA NA 1.7991002 4.6187558 NA #> [336] 2.3082116 NA NA 2.1572299 7.6883049 #> [341] NA NA NA NA NA #> [346] NA NA NA NA NA #> [351] NA NA NA NA 0.6671617 #> [356] NA NA NA NA NA #> [361] NA NA NA NA NA #> [366] NA NA NA 1.3682123 1.7227559 #> [371] NA NA 0.8182324 NA NA #> [376] NA 1.3030148 NA NA NA #> [381] NA NA NA NA NA #> [386] 0.4186687 NA NA NA NA #> [391] NA NA NA NA NA #> [396] NA NA NA NA NA #> [401] NA NA NA NA NA #> [406] NA NA NA NA NA #> [411] NA NA NA NA NA #> [416] NA NA NA NA NA #> [421] 0.4893252 NA NA NA NA #> [426] NA NA NA NA NA #> [431] NA NA NA NA NA #> [436] NA NA NA NA NA #> [441] NA NA NA NA NA #> [446] NA NA NA NA NA #> [451] NA NA NA NA NA #> [456] NA NA NA NA NA #> [461] NA 0.6470237 NA NA NA #> [466] NA NA NA NA NA #> [471] NA NA NA NA NA #> [476] NA NA NA NA NA #> [481] NA NA NA NA NA #> [486] NA NA NA NA NA #> [491] NA NA NA NA NA #> [496] NA NA NA NA NA #> [501] NA NA NA NA NA #> [506] NA NA NA NA NA #> [511] NA NA NA NA NA #> [516] NA NA NA NA NA #> [521] NA NA NA NA NA #> [526] NA NA NA NA NA #> [531] NA NA NA NA NA #> [536] NA NA NA NA NA #> [541] NA NA NA NA NA #> [546] NA NA NA 1.2660308 NA #> [551] NA NA NA NA NA #> [556] NA NA NA NA 0.3448766 #> [561] NA NA NA NA NA #> [566] NA NA NA NA NA #> [571] NA NA NA NA NA #> [576] NA NA NA NA NA #> [581] NA NA NA NA NA #> [586] NA NA NA NA NA #> [591] NA NA NA NA NA #> [596] NA NA NA NA NA #> [601] NA NA NA NA NA #> [606] 1.0501561 NA NA NA 1.0818608 #> [611] NA 0.1523102 NA 1.6358998 NA #> [616] NA 1.0994979 NA 2.0477426 0.9073558 #> [621] NA NA 0.5244763 NA 2.2316427 #> [626] NA 2.6152663 NA NA NA #> [631] 1.7466167 1.7643924 NA 1.0328368 2.0097375 #> [636] NA NA NA NA NA #> [641] NA NA NA NA NA #> [646] NA NA NA NA NA #> [651] NA NA NA NA NA #> [656] 0.3149102 NA NA NA NA #> [661] NA NA NA NA NA #> [666] NA NA NA NA NA #> [671] NA 0.5953222 NA NA NA #> [676] 0.8350294 NA 1.0704968 NA NA #> [681] NA NA NA 1.3077880 NA #> [686] NA NA 1.5747164 NA NA #> [691] NA NA NA NA NA #> [696] NA NA NA NA NA #> [701] NA NA NA NA NA #> [706] NA 0.3147899 NA NA NA #> [711] NA NA NA NA NA #> [716] NA NA NA NA NA #> [721] NA 0.4084390 NA NA NA #> [726] NA NA NA NA NA #> [731] NA NA NA NA NA #> [736] NA NA NA NA 0.4539037 #> [741] NA 0.9779218 NA 2.4162381 NA #> [746] 6.3833795 NA 2.8862731 1.2910393 10.6581869 #> [751] NA 1.4951602 3.7959058 2.8722730 NA #> [756] 2.4529448 5.3233647 3.5772564 4.4303422 NA #> [761] 2.9447591 2.1176453 5.0967083 3.3420610 NA #> [766] 2.4258153 0.8650878 7.3779054 6.8362355 NA #> [771] 2.1940181 0.7469152 2.0079441 6.3011317 10.4023485 #> [776] 3.3065796 NA 2.3813672 1.3428380 4.0137057 #> [781] 1.4098256 2.4288177 1.3962808 7.4319925 NA #> [786] 20.5047512 0.9047846 1.3858606 2.8306339 3.7321482 #> [791] 2.8828564 5.5602937 NA 115.1193542 2.0473588 #> [796] 4.9510341 NA 118.5648346 2.0066054 2.9266124 #> [801] 2.4156189 4.2713437 NA NA NA #> [806] NA NA NA 0.2551613 NA #> [811] 2.6899714 5.8423100 11.0782356 NA NA #> [816] 0.8772338 NA 2.3091309 NA NA #> [821] NA NA NA NA NA #> [826] NA NA 3.4256361 NA NA #> [831] NA NA 3.7716985 NA NA #> [836] NA NA NA NA NA #> [841] NA NA NA NA NA #> [846] NA NA NA NA NA #> [851] NA NA NA NA NA #> [856] NA NA NA NA NA #> [861] NA NA NA NA NA #> [866] NA NA NA 1.5463245 NA #> [871] NA NA NA NA NA #> [876] NA NA NA 1.8332181 NA #> [881] NA NA NA NA NA #> [886] NA NA NA NA NA #> [891] NA NA NA NA NA #> [896] NA NA NA NA NA #> [901] NA NA NA NA NA #> [906] NA NA NA NA NA #> [911] 1.1230040 3.6158812 NA NA NA #> [916] NA NA NA 1.1808953 NA #> [921] NA NA NA NA NA #> [926] 1.2916937 NA NA NA NA #> [931] NA NA NA NA NA #> [936] NA 3.6537952 NA NA NA #> [941] NA NA NA NA NA #> [946] 1.9253193 NA NA 6.6556292 NA #> [951] NA NA NA NA NA #> [956] NA NA NA NA NA #> [961] NA NA NA NA NA #> [966] NA NA NA NA NA #> [971] NA NA NA NA NA #> [976] NA NA NA NA NA #> [981] NA 2.8096755 0.4722714 NA NA #> [986] NA 1.5738993 NA 3.1981614 NA #> [991] 2.3436296 NA 1.1402670 NA 4.2488189 #> [996] 5.5579276 1.3360999 NA 1.4311922 165.9235382 #> [1001] 1.0471303 2.2803576 2.3772638 1.4516939 2.6042576 #> [1006] NA 1.4513292 110.1937103 1.6985731 NA #> [1011] 7.4143949 2.9037418 4.3727541 NA 2.5551207 #> [1016] 3.4643288 3.0462031 5.5572038 5.8211880 3.4240117 #> [1021] 3.9230976 NA 326.0313110 2.8209546 4.4502177 #> [1026] 45.2657852 2.6507335 2.4535000 5.7406173 5.1763091 #> [1031] NA 1.5400567 1.0795214 1.5230681 3.4662752 #> [1036] 4.3179688 NA 0.7036181 NA NA #> [1041] NA 3.9843678 NA 3.7730997 NA #> [1046] NA NA 0.8382843 NA NA #> [1051] NA NA 0.5566598 NA NA #> [1056] NA NA NA NA NA #> [1061] NA 0.8787179 NA NA 0.4405660 #> [1066] NA NA NA NA NA #> [1071] NA NA NA NA NA #> [1076] NA NA NA NA NA #> [1081] NA NA NA NA NA #> [1086] NA NA 2.2968674 NA 0.4199017 #> [1091] NA NA NA NA NA #> [1096] NA NA NA NA NA #> [1101] NA NA NA NA NA #> [1106] NA NA NA NA NA #> [1111] NA NA NA NA NA #> [1116] NA NA NA 0.9166892 NA #> [1121] NA NA NA 3.8255417 NA #> [1126] NA NA NA NA NA #> [1131] NA NA NA NA NA #> [1136] NA NA NA NA NA #> [1141] NA NA NA NA NA #> [1146] NA NA NA NA NA #> [1151] NA 0.5752081 NA NA NA #> [1156] NA NA NA NA NA #> [1161] NA NA NA NA NA #> [1166] NA NA NA NA NA #> [1171] NA NA NA NA NA #> [1176] NA NA NA NA NA #> [1181] NA NA NA NA NA #> [1186] NA NA NA 0.5180702 NA #> [1191] NA NA NA NA NA #> [1196] NA NA NA NA NA #> [1201] NA NA NA NA 1.5857564 #> [1206] NA NA 1.6556677 NA NA #> [1211] NA NA NA NA NA #> [1216] NA NA NA NA NA #> [1221] NA NA NA NA 0.5855740 #> [1226] 1.0657172 NA NA NA NA #> [1231] NA NA NA NA NA #> [1236] 0.4307829 NA NA NA NA #> [1241] NA NA NA NA NA #> [1246] NA NA NA NA NA #> [1251] 1.3963100 NA NA NA NA #> [1256] NA NA NA NA NA #> [1261] NA NA NA NA NA #> [1266] NA NA NA NA NA #> [1271] NA NA NA NA 2.4678311 #> [1276] NA NA NA NA NA #> [1281] NA NA NA NA 0.9768236 #> [1286] NA NA 1.0707787 NA NA #> [1291] NA NA NA NA NA #> [1296] 0.8175089 1.4743868 NA NA NA #> [1301] NA NA NA NA NA #> [1306] NA NA NA NA NA #> [1311] NA 5.0737371 0.5766439 NA NA #> [1316] NA NA NA NA NA #> [1321] NA NA NA NA NA #> [1326] NA NA NA NA NA #> [1331] NA NA NA NA NA #> [1336] NA NA NA NA NA #> [1341] NA NA NA NA NA #> [1346] NA 1.4214748 NA NA NA #> [1351] NA 0.2014372 2.2585330 NA NA #> [1356] 0.7659990 NA NA NA NA #> [1361] 0.6345024 NA 1.1232179 1.2145635 NA #> [1366] NA NA NA NA NA #> [1371] NA NA NA NA NA #> [1376] NA NA NA NA NA #> [1381] NA 10.4214382 NA NA NA #> [1386] NA NA 1.5072360 NA NA #> [1391] NA 1.6478479 NA NA NA #> [1396] NA NA 2.0655625 NA NA #> [1401] NA NA NA NA NA #> [1406] NA NA NA NA NA #> [1411] NA NA NA 0.5699065 NA #> [1416] NA NA NA NA NA #> [1421] NA NA NA NA 1.0214655 #> [1426] NA 0.6936538 NA NA NA #> [1431] NA NA NA NA NA #> [1436] NA NA NA NA NA #> [1441] NA NA NA NA NA #> [1446] NA NA NA NA NA #> [1451] NA NA NA NA NA #> [1456] NA NA NA NA 2.5300288 #> [1461] NA NA NA NA NA #> [1466] NA NA NA NA NA #> [1471] 0.5699503 NA NA NA 0.4178057 #> [1476] NA NA NA NA NA #> [1481] NA NA NA NA NA #> [1486] NA 2.3085105 7.4867916 NA NA #> [1491] NA NA NA NA NA #> [1496] NA 2.4417286 NA NA NA #> [1501] NA 3.0711961 2.6359253 1.0029373 NA #> [1506] NA NA NA 0.3156207 3.3271339 #> [1511] NA NA NA 0.7859326 0.9116367 #> [1516] NA NA 2.2751508 NA 3.6905310 #> [1521] 1.7462349 NA NA NA NA #> [1526] NA NA NA 0.6127930 NA #> [1531] 0.6677385 NA NA NA 0.3307993 #> [1536] NA NA NA NA NA #> [1541] NA NA NA NA NA #> [1546] NA 2.4790754 NA NA NA #> [1551] NA NA NA NA NA #> [1556] NA NA NA NA NA #> [1561] NA NA NA NA NA #> [1566] NA NA NA NA 0.9691072 #> [1571] NA NA NA NA NA #> [1576] NA NA NA NA NA #> [1581] NA NA NA NA NA #> [1586] NA NA 3.0772917 NA NA #> [1591] NA 0.3885723 NA 0.3215049 1.6329483 #> [1596] 4.4057989 NA NA NA 0.4121964 #> [1601] NA NA NA 0.8756598 NA #> [1606] 1.1511103 NA NA NA NA #> [1611] NA NA NA NA NA #> [1616] NA NA NA 1.2199212 2.9056976 #> [1621] NA NA NA NA NA #> [1626] NA NA NA NA 0.9633790 #> [1631] NA 1.1713226 2.6179757 NA NA #> [1636] NA NA 7.3096509 NA 4.6009355 #> [1641] NA NA NA NA 0.6218465 #> [1646] NA 4.1894031 NA 10.0505095 NA #> [1651] 12.7552290 10.4093504 NA NA NA #> [1656] NA NA NA NA NA #> [1661] NA NA NA 2.2360206 NA #> [1666] NA NA NA NA NA #> [1671] NA 1.2496341 NA NA NA #> [1676] NA NA NA NA NA #> [1681] NA NA NA NA NA #> [1686] NA 0.4214600 NA NA NA #> [1691] NA NA NA NA NA #> [1696] NA NA NA NA NA #> [1701] NA 1.4234974 NA 5.9685678 NA #> [1706] 1.4870299 6.5259218 NA 10.9112473 NA #> [1711] NA NA NA NA NA #> [1716] NA NA NA NA NA #> [1721] 3.0024679 NA NA NA NA #> [1726] NA NA NA NA NA #> [1731] NA NA NA NA NA #> [1736] NA NA 5.5636888 NA NA #> [1741] NA NA 1.0834279 NA NA #> [1746] NA NA NA NA NA #> [1751] NA NA 6.3247514 NA NA #> [1756] NA 8.4820938 NA 1.0724249 NA #> [1761] 1.7462807 NA 0.2578186 2.8363187 NA #> [1766] 2.7652164 NA 9.1981554 NA 2.7739875 #> [1771] 27.5907974 NA 3.4431446 NA NA #> [1776] 7.6219230 NA 7.2448454 0.9365459 NA #> [1781] NA NA NA NA NA #> [1786] 1.4254460 NA NA 1.9484344 NA #> [1791] 25.4685478 3.3151047 NA 5.4201798 NA #> [1796] NA 1.0591918 NA NA NA #> [1801] NA NA NA NA 2.2389860 #> [1806] NA NA 7.2797980 NA 177.9112701 #> [1811] NA 712.0562744 NA 1.9180223 1.0850360 #> [1816] NA 15.4796858 2.2603140 1.6407841 3.5157232 #> [1821] 1.3970622 2.8673556 4.1254120 NA 2.8693426 #> [1826] 4.2749281 0.8203884 2.7943869 NA 3.3467057 #> [1831] 3.0753074 2.7253366 NA 2.1626289 5.0227842 #> [1836] 2.3628030 NA 1.2205384 0.8150464 NA #> [1841] 3.2100937 4247.9296875 NA NA NA #> [1846] 4877.1162109 NA 1.7616867 1.8174063 0.7508621 #> [1851] NA 3.5258093 2.7256949 NA 2.5574954 #> [1856] NA 1.5129316 NA 0.6094913 2.6934810 #> [1861] NA 0.9192376 NA 1.3823618 NA #> [1866] 111.0667496 0.6147639 1.4611453 NA 0.7056657 #> [1871] 0.4673733 0.5605560 1.7962961 0.7591861 0.6475862 #> [1876] NA NA NA 1.0416414 13.4244280 #> [1881] 0.8334653 1.4189600 0.8297019 2.9611456 1.5615076 #> [1886] NA NA NA 1.4051919 NA #> [1891] NA 0.9027803 NA 3.6805460 NA #> [1896] NA NA NA 145.7117004 NA #> [1901] NA NA NA NA NA #> [1906] NA NA NA NA NA #> [1911] NA NA NA NA NA #> [1916] NA NA NA NA NA #> [1921] NA 0.3470792 NA 1.5938562 1.4932191 #> [1926] NA NA NA NA NA #> [1931] NA NA NA NA 4.3753552 #> [1936] NA 0.6481672 2.1519599 NA NA #> [1941] NA NA NA 1.0128362 NA #> [1946] 0.6915093 NA 1.9947214 NA NA #> [1951] NA NA NA NA NA #> [1956] NA NA NA 0.2430045 NA #> [1961] 2.9182062 0.6795040 1.6664841 2.3586757 NA #> [1966] NA 0.8883650 NA NA 3.2617228 #> [1971] NA 2.8392348 NA NA NA #> [1976] 1.6086547 NA NA NA NA #> [1981] NA 0.6026787 NA NA NA #> [1986] NA NA NA NA NA #> [1991] 1.2004064 NA NA NA NA #> [1996] NA 1.3173006 3.6571672 NA NA #> [2001] 2.2624974 NA 0.9398944 3.5710230 NA #> [2006] 1.0233446 NA NA NA 1.3720112 #> [2011] 1.0055754 0.5655854 1.5054272 NA 1.0397023 #> [2016] 3.3238027 NA NA NA 2.1077371 #> [2021] NA 2.7032313 NA 3.8104489 NA #> [2026] 2.8180630 7.8234811 NA 4.9062996 NA #> [2031] NA NA 1.3160198 NA NA #> [2036] 1.0076615 NA 1.0950712 NA NA #> [2041] 3.9908450 NA 4.2435541 NA 0.7174511 #> [2046] 5.2825084 NA NA NA NA #> [2051] NA NA NA NA NA #> [2056] NA NA NA NA NA #> [2061] NA NA NA NA NA #> [2066] 0.8802158 NA 0.3888731 NA NA #> [2071] NA NA NA NA NA #> [2076] 0.7251250 NA NA NA NA #> [2081] NA NA 1.0856016 NA NA #> [2086] NA NA NA 0.5659533 NA #> [2091] NA NA NA NA NA #> [2096] NA NA NA NA NA #> [2101] NA NA NA 0.4917859 NA #> [2106] NA NA NA NA 0.4981284 #> [2111] 0.9569623 NA 0.7542380 NA NA #> [2116] NA NA NA 1.5303959 NA #> [2121] NA NA NA NA NA #> [2126] 2.5028656 NA NA NA NA #> [2131] 1.2001288 NA NA NA NA #> [2136] NA NA NA NA NA #> [2141] NA NA NA NA NA #> [2146] NA NA NA 1.7258205 NA #> [2151] 0.5163053 NA NA NA NA #> [2156] NA NA NA 1.1474305 NA #> [2161] NA NA 2.1486368 NA 2.4524887 #> [2166] 3.0907106 3.9163256 NA 6.1858454 6.0148554 #> [2171] NA 3.3022101 6.8535738 NA 0.9091500 #> [2176] 5.3752904 NA NA NA 2.6620142 #> [2181] 14.2303267 NA 0.3268394 3.2703023 3.7256567 #> [2186] 3.4891803 NA NA NA 6.1556778 #> [2191] NA NA NA NA NA #> [2196] NA NA NA NA NA #> [2201] NA NA 1.2317547 NA NA #> [2206] NA 3.0012579 NA 6.3596826 NA #> [2211] 0.6037928 0.5698133 NA 3.7267346 NA #> [2216] 10.2576380 0.8706866 4.9864445 4.3741260 NA #> [2221] NA NA NA 1.0901091 10.9061537 #> [2226] 4.1417003 0.5189514 8.2503548 2.2269182 NA #> [2231] NA NA NA NA NA #> [2236] NA NA NA NA NA #> [2241] NA NA NA NA NA #> [2246] 0.3962348 0.3956501 NA NA NA #> [2251] NA NA NA 2.1887872 NA #> [2256] NA NA NA NA NA #> [2261] NA NA NA NA NA #> [2266] NA NA 1.7824746 NA 3.7205944 #> [2271] NA 3.6917150 NA NA NA #> [2276] 0.7435969 NA 9.6342754 24.0429783 1.5591800 #> [2281] NA NA NA NA 1.9394968 #> [2286] NA 3.0097637 NA 5.7848148 9.7665796 #> [2291] NA NA 2.0749505 NA NA #> [2296] NA 0.4870613 NA 2.6161067 0.6431220 #> [2301] NA NA NA NA NA #> [2306] 1.2651863 NA NA NA NA #> [2311] 3.6852174 NA 1.1431226 21.9405651 NA #> [2316] NA NA 1.2046832 1.8209703 NA #> [2321] 0.5066832 0.9095992 9.7609291 NA 3.3460293 #> [2326] NA 0.4121834 NA NA 0.9202868 #> [2331] NA 0.6617500 NA NA NA #> [2336] NA NA NA NA NA #> [2341] NA NA NA NA NA #> [2346] NA NA NA NA NA #> [2351] NA NA NA 2.0171058 1.1644038 #> [2356] NA NA 2.6082158 NA NA #> [2361] 3.6380553 NA NA 0.8339515 NA #> [2366] 1.4020016 7.2250385 NA 0.7268345 0.7294782 #> [2371] NA NA 0.9507068 NA 2.5481384 #> [2376] NA NA NA 3.6101770 NA #> [2381] 0.6119207 5.6888528 NA 16.1643982 NA #> [2386] 2.6750910 NA 4.8989611 NA 0.4897856 #> [2391] 15.6936617 NA 3.9424517 NA NA #> [2396] NA NA 1.3334647 NA 0.4453856 #> [2401] 3.3320382 NA NA 7.2846007 NA #> [2406] 3.1082804 NA 3.1209931 NA NA #> [2411] 9.3145094 NA NA 0.8143211 NA #> [2416] 1.1926577 NA 0.6434940 NA NA #> [2421] NA NA NA NA NA #> [2426] NA NA NA NA NA #> [2431] NA NA NA NA NA #> [2436] NA NA 0.6482291 2.3913691 2.1481240 #> [2441] 2.7833135 NA 4.5657282 5.3265414 NA #> [2446] 10.3909426 15.4557104 NA 0.6454072 43.3171730 #> [2451] NA 1.4262301 NA 2.5555761 1.7280343 #> [2456] NA 2.7765193 1.3546977 1.9755590 1.4631903 #> [2461] 1.5031183 1.5941623 1.5892071 NA 5.8746567 #> [2466] 2.2622027 2.5123510 5.3907886 5.1953430 3.1958568 #> [2471] 3.0968442 4.0582609 NA 3.2192631 2.5363874 #> [2476] 4.4969444 5.3325839 2.3695500 3.0062342 5.6627531 #> [2481] 6.4923205 NA 4.7920384 4.5700383 4.0006895 #> [2486] 9.5566549 5.8871794 7.4422898 5.2004848 9.2628069 #> [2491] NA 784.9196167 4.6816382 4.1257901 6.6807156 #> [2496] 4.1821823 6.8080244 7.7087774 12.4988031 NA #> [2501] 1.4474308 985.7752686 5.5145364 2.7746949 2.3561726 #> [2506] 3.7145381 6.2821894 10.4331989 NA 1.7673082 #> [2511] NA NA 3.1912456 NA 7.3891306 #> [2516] 1.3537637 NA 0.2704858 4.0082321 8.5943022 #> [2521] NA 1.3064193 3.6371551 NA NA #> [2526] 2.5390623 NA NA NA NA #> [2531] NA NA NA NA 0.7411902 #> [2536] 0.5046070 NA NA NA NA #> [2541] 0.5680771 NA 1.2300223 2.8467999 2.6166818 #> [2546] NA NA 0.5497193 NA 16.0667572 #> [2551] 1.9547974 NA 0.9511589 15.4262342 NA #> [2556] 2.4667881 NA 1.0057802 NA 2.2017863 #> [2561] 3.7578349 5.2645087 NA 0.7512842 2.5041356 #> [2566] 1.8741575 11.7041502 NA 22.0120201 NA #> [2571] 3.6391535 2.4130566 NA NA 1.3888769 #> [2576] 1.4703723 NA NA 1.5291082 NA #> [2581] 2.3573880 NA NA NA NA #> [2586] 0.6399383 1.6180218 NA 2.6052721 NA #> [2591] 1237.6204834 19.8997154 NA 39.6545715 4069.6533203 #> [2596] 3.8779757 2.9248793 14.3836384 NA 38.9334831 #> [2601] 4267.4248047 6.9302726 5.0617962 4.1785703 28.3963814 #> [2606] NA 6.4566789 3.4296451 NA 3.7816880 #> [2611] NA NA NA NA NA #> [2616] NA 11.0247078 27.2765732 NA NA #> [2621] NA NA NA NA NA #> [2626] NA 2.2371943 NA 0.9170940 0.7460240 #> [2631] NA 0.8210835 1.6487689 9.5727634 NA #> [2636] 1.6570802 NA 0.8196399 0.8946962 13.3170853 #> [2641] NA 28.8410645 NA 1.4570224 0.2454604 #> [2646] 0.6586674 NA 1.0929065 1.2879230 NA #> [2651] 2.9674864 0.5844296 NA 11.5823431 NA #> [2656] 2.6197197 0.6617230 1.0072753 NA 1.0431374 #> [2661] 1.7980380 1.8940541 4.3480368 2.6686113 NA #> [2666] NA 2.4794784 4.1561966 NA 1.2986863 #> [2671] 1.2777241 3.0134482 NA 101.8303833 3.4352007 #> [2676] 3.0277224 13.1016092 NA 0.5244251 1.7064619 #> [2681] 0.3486639 50.7429390 1.7649055 NA 2.7503626 #> [2686] NA 0.3800137 3.3221421 3.1534879 NA #> [2691] 15.4715948 1.4704005 1.8855512 4.0389700 1.0823137 #> [2696] 2.6767426 2.1071370 3.6332088 NA 0.6826217 #> [2701] 1.0185049 3.3197520 3.8973808 6.3822713 5.1280479 #> [2706] 8.5763950 3.2864881 NA 1.3272406 3.2673051 #> [2711] 5.7568297 8.3966360 16.3681469 7.2476711 5.4942021 #> [2716] 2.1211190 NA 1.5519290 3.6947889 3.6529276 #> [2721] 7.1617284 23.2306347 20.4122696 17.6928806 5.1081491 #> [2726] NA 117.3710403 2.7161827 48.0717468 18.4067097 #> [2731] 3.7467299 3.6180439 15.2693739 NA 4.7089896 #> [2736] 2.5892634 9.7226076 139.4568787 7.4229794 11.8008423 #> [2741] 44.5208054 10.5249119 NA 5.9375591 20.7310448 #> [2746] 216.7257538 12.0509796 32.5807915 140.1287079 18.1983509 #> [2751] 7.9473476 NA 4.0145078 NA 5.9600363 #> [2756] 4.9861374 40.1272926 16.1208572 13.0407543 6.8589644 #> [2761] NA 4.9722199 11.0004854 7.2423544 6.4803615 #> [2766] 14.1402922 23.9029579 15.6984034 17.9236164 NA #> [2771] 3.2453372 9.5185261 8.6210403 3.0081079 3.5888493 #> [2776] 6.0433631 7.4204693 11.3490496 NA 3.6138747 #> [2781] 1.7851294 4.3751335 38.7952423 25.8243275 20.6631317 #> [2786] NA 2.3311818 701.8855591 333.9076538 5.9194384 #> [2791] 5.2374392 50.5938759 6.6050563 29.6740894 NA #> [2796] 6.8099937 729.9282227 4.7258272 377.9533081 3.7225027 #> [2801] 5.8937206 8.3230190 8.7469826 NA 1.2891947 #> [2806] 2.5859647 75.5915375 4.7863827 45.3149376 2.4862499 #> [2811] 6.5945859 6.9634075 NA 35.3314667 3.0827610 #> [2816] 86.5234299 1061.5833740 3.1925797 39.1028519 5.1561656 #> [2821] 727.2340088 NA 4.6954513 4.7806416 2.0299914 #> [2826] 67.0260162 NA NA 8.1010742 1.6631573 #> [2831] 1.8530455 79.0636978 30.3669281 NA 0.8927791 #> [2836] 10.3849897 1.0268044 NA 3.1952302 0.7755960 #> [2841] 5.7425203 7.2843447 NA 1.2209314 1.8280462 #> [2846] 7.8098340 NA NA NA 3.8438480 #> [2851] 1.6488374 NA 1.9727218 21.7567501 0.7352579 #> [2856] NA 1.9201657 52.0057869 NA 127.3143768 #> [2861] 5.6821346 NA 2.5211284 2.3330369 2.1601825 #> [2866] 9.7243500 9.3593960 NA 2.9505100 5.4880805 #> [2871] 8.6688786 2.6024387 NA 11.9668989 2.1561337 #> [2876] 12.3195581 1.2745084 1.9595144 5.3821392 19.5642281 #> [2881] 16.0015182 NA 3.0178616 4.6744413 21.4054432 #> [2886] 2.3722150 17.8877811 7.6304569 36.1747169 4.2541361 #> [2891] NA 33.9568787 6.3856707 2.6096203 13.1905775 #> [2896] 2.4566786 47.8784180 6.1847539 NA 46.1483879 #> [2901] 3.2702918 3.5770297 12.7957163 5.9115996 4.5292888 #> [2906] 5.1561074 NA 4.0170932 3.9871593 5.1863651 #> [2911] 1.8988326 7.9102783 NA 5.5774412 2934.2749023 #> [2916] 1.7749847 8.5469313 16.3584347 10.1700211 NA #> [2921] 0.2661873 6.4565039 8.4741077 NA NA #> [2926] NA 0.1989040 0.4645469 1.7402502 29.9008598 #> [2931] 0.5417653 NA 0.7619571 2.3052864 23.7764740 #> [2936] 3.5269954 NA 6.3716865 NA 4.5834875 #> [2941] 0.6944337 9.3756256 NA 0.4391756 0.4102839 #> [2946] NA 0.4088447 4.4651365 NA NA #> [2951] 2.3560781 0.8629871 1.7296497 NA 2.3054824 #> [2956] 0.4738956 0.8453057 0.6674856 2.9770677 0.9882508 #> [2961] 2.5485382 1.3252913 NA 0.9046306 3.3730309 #> [2966] NA 1.3325157 0.8287238 3.2393219 2.8408599 #> [2971] 1.1969875 NA 4.9852405 16.4274426 0.7676155 #> [2976] 5.0130310 NA 2.2948136 NA 2.0398157 #> [2981] 1.0926311 NA 1.6752559 2.0661981 0.7237425 #> [2986] 4.8128242 11.1487827 NA 0.8632420 1.8443307 #> [2991] NA 0.4144078 1.5147480 2.7527251 NA #> [2996] 13.0752268 NA 1.8903236 7.9921408 1.5463461 #> [3001] NA 0.8109860 1.0667026 1.1346698 NA #> [3006] 3.6560605 NA 3.3797889 NA 3.5629609 #> [3011] 3.4544880 4.5592079 NA 16.6013031 NA #> [3016] 4.6765566 1.6968081 1.1385404 NA 1.4192655 #> [3021] 2.8486712 2.6313102 NA 0.6307487 2.3814776 #> [3026] 2.7711914 0.7061450 NA 4.9312925 1.1609619 #> [3031] 6.7711430 NA 2.8384895 NA 3.6513107 #> [3036] NA 3.9373784 5.0244951 9.3638000 NA #> [3041] 17.6887131 NA NA NA 8.8094635 #> [3046] NA NA 4.6279211 NA 1.6137590 #> [3051] NA NA NA 0.6182525 0.8786079 #> [3056] 15.0547085 24.5552330 7.9792995 NA 64.7950058 #> [3061] 97.0138016 9.9027309 0.5985516 NA 1.5779028 #> [3066] 11.9724445 NA 1.9544525 NA 163.6211090 #> [3071] NA 2.1614091 8.1083727 NA 2.6397953 #> [3076] 3.5538256 7.1930056 NA 0.6664237 442.5400391 #> [3081] 3.0430346 6.4073930 5.0266309 5.8590345 19.6998043 #> [3086] NA 4.3898072 1.1305788 13.5925970 7.2308283 #> [3091] NA 1.1136869 1.3520640 1.6164834 1.0973755 #> [3096] 2.0894964 9.5560360 NA NA 8.9295197 #> [3101] 779.4788818 2.5705523 809.9169312 3.0098879 94.3604507 #> [3106] 8.8758574 NA 3.4457500 4.9686089 1.5195554 #> [3111] 2.1578839 4.8023272 2.1327522 NA 0.3200580 #> [3116] 12.4226055 12.1050863 1096.2231445 1066.9301758 129.4904938 #> [3121] 4.5963664 3.0736189 NA 8.0031509 3.2705626 #> [3126] NA 0.3757358 15.2121391 2.8834486 15.9752741 #> [3131] 1346.7353516 2.6217887 1228.9621582 5.0895567 NA #> [3136] 2.1218104 184.3674316 4.2164469 2.8267379 6.7104831 #> [3141] 3.8288674 3.0664554 4.4310689 NA 2268.6291504 #> [3146] 1836.1269531 2.0746028 2.2918937 10.7542877 51.3735046 #> [3151] 6.6448908 6.1085730 NA 1.4560728 2.8452797 #> [3156] 3.7901433 2.0456872 1.9614782 5.3406096 6.5233908 #> [3161] 5.8153443 NA 4.9779243 5.2980742 1.9569403 #> [3166] NA 3.0366473 NA 0.8441148 0.7282568 #> [3171] 0.6270677 1.9153599 2.5157802 2.5211849 NA #> [3176] 1.3664742 16.0325813 NA 1.9972137 1.1040767 #> [3181] NA 0.9441139 NA NA 0.9234766 #> [3186] NA 2.2210290 0.8783525 2.1501570 NA #> [3191] 8.6357822 NA 1.6162349 NA NA #> [3196] 1.9563223 1.2261102 5.9679408 NA 2.4582469 #> [3201] 3.3074541 NA 0.6635520 NA 3.4940929 #> [3206] NA NA 2.6760423 NA 1.0429727 #> [3211] 0.5086066 1.0268028 3.8812792 NA 3.5886321 #> [3216] NA 3.9809752 7.7894588 NA NA #> [3221] 0.8405986 NA 1.1336366 NA NA #> [3226] 2.8971629 NA NA NA NA #> [3231] NA NA NA 0.7070799 NA #> [3236] NA NA NA NA 0.7151046 #> [3241] NA 0.5353748 1.3802744 NA 4.1309824 #> [3246] 4.8025975 NA 8.7120161 2.2102430 10.5090933 #> [3251] 10.4218655 NA 22.3232746 NA 36.9990120 #> [3256] NA 2.9090240 2.3153019 76.6485138 2.9318345 #> [3261] NA 1.6010859 5.8318458 2.6627228 6.4075303 #> [3266] 2.0914986 11.3002634 NA 1.0663972 9.0038490 #> [3271] 7.7891731 1.4418688 4.8872490 13.7815018 7.2834721 #> [3276] NA 0.6722869 12.7788944 14.1886673 6.0767541 #> [3281] 17.2682152 NA 5.8392038 3.2879653 25.1995487 #> [3286] 27.0342846 11.1438723 38.4615974 10.6467648 20.4387722 #> [3291] NA 3.0112209 1.9950336 10.1919136 1.5909361 #> [3296] 4.7708578 1141.7640381 9.8121815 22.5490570 NA #> [3301] 3.3931487 9.8001604 4.6790090 1271.7685547 2.8506472 #> [3306] 1103.0401611 17.5955009 5.1776738 NA 2.9927020 #> [3311] 2.1627703 3.1698050 NA 13.8667717 1411.4106445 #> [3316] 1272.9426270 21.3413105 NA 0.8185354 2.8377655 #> [3321] 2.0303440 21.7762794 NA 1345.3233643 1350.6333008 #> [3326] 6.6278219 29.8857651 NA 52.9047775 1294.8477783 #> [3331] 12.9526482 9.6068335 17.7135353 NA NA #> [3336] NA 2.6911139 3.7828991 NA 0.7059131 #> [3341] 5.9516506 4.0300317 2.7630870 5.6403260 NA #> [3346] 7.4636693 2.0741365 5.1799192 6.4390368 9.8243055 #> [3351] NA 1.5092793 4.3210769 NA 1.7446249 #> [3356] 3.4029963 2283.2792969 3.9234891 6.9994988 4.1006012 #> [3361] NA 0.6282611 1.8591487 4.4599166 2.1398880 #> [3366] 2337.1853027 4.3932910 9.6464186 12.7156582 NA #> [3371] 0.9086848 9.3874264 3.2540348 2646.2402344 6.6778555 #> [3376] 3.9801006 21.6677666 NA 1.3727722 2.5189867 #> [3381] 7.1042595 10.0052004 1.5813689 23.2121410 2.8682461 #> [3386] NA 1.3422523 0.7672858 0.6866859 3.6084216 #> [3391] 18.3351460 NA 0.8394666 1.9887234 1.5026515 #> [3396] 1.3683980 5.7951837 9.8654814 2.1221330 NA #> [3401] 2.1047983 3.0744431 1.9053514 2.6970651 2.0816550 #> [3406] 1.9742609 9.6418734 7.6057978 NA 3.4838214 #> [3411] 8.8084707 6.6040335 3.2611005 9.0701380 3.0636346 #> [3416] 1.7033354 12.7065725 NA 1.9277512 11.4872437 #> [3421] 12.6639729 1.8488846 4.4552321 4.2770810 9.8547640 #> [3426] 3.8485291 NA 2.1161973 2.0724041 6.0630097 #> [3431] 2.5432432 29.9757633 3.4243822 1.5343714 7.8658175 #> [3436] NA 1.2879468 6.8999977 6.3626080 268.5536194 #> [3441] 5.7748380 NA 5.2410469 2.0550699 NA #> [3446] 0.4435597 5.4935684 0.9196581 75.9311295 3.3142908 #> [3451] 80.4429626 5.9293828 2.2810714 NA 2.8269784 #> [3456] 20.1030636 NA 1.1432312 3.6678035 NA #> [3461] 1.0070125 3.5375540 2.9908266 22.7290974 NA #> [3466] 2.3943624 0.9211383 1.9665295 NA 0.8259042 #> [3471] 0.4845653 25.3855438 3.8617392 NA 6.6030455 #> [3476] 18.8038082 NA 0.5806934 3.3330538 101.8569031 #> [3481] NA 14.4165783 NA 1.7161655 7.3081284 #> [3486] NA 2.1098645 0.8144141 1.3382024 1.4885535 #> [3491] NA 0.8770674 0.6791099 NA 1.6695246 #> [3496] NA 1.2673935 NA 0.6891360 1.2439822 #> [3501] 5.2793922 NA 1.2573010 NA 3.7120969 #> [3506] 4.9950824 11.5787373 1.9612808 NA 10.3544693 #> [3511] 6.0420938 18.6085644 NA 1.5667670 1.2138346 #> [3516] 30.0845642 19.6141224 3.2639980 NA 3.6546156 #> [3521] 29.6098766 2.8610103 6.0040512 1.8776323 3.8169975 #> [3526] NA 4.7191100 1.0195367 3.8605018 8.1590776 #> [3531] 2.8668685 12.0980616 5.0243416 7.0915346 NA #> [3536] 2.7560163 6.1319265 5.5243936 46.6120872 24.7890339 #> [3541] 6.4685655 9.1421661 10.3797007 NA 10.7507782 #> [3546] 7.7589669 12.2742815 4.6532531 5.1379547 23.7994213 #> [3551] 29.3476200 4.0036497 NA 7.5182543 11.9706621 #> [3556] 63.0551071 5.1469116 8.4730129 72.0657578 10.1063595 #> [3561] 65.6397705 NA 4.1467509 13.0881023 27.2654285 #> [3566] 96.3133926 108.4684830 15.9769907 16.9430561 14.3318129 #> [3571] NA 4.6791883 126.8739243 6.6298981 18.2740936 #> [3576] 28.1178570 8.4018116 24.9042740 22.9308643 NA #> [3581] 5.7845116 2804.5610352 6.1323233 7.0216298 34.0006905 #> [3586] 11.0745640 23.1465626 26.1845646 NA 15.7390766 #> [3591] 6.2733459 11.7022743 4.5109916 3.0380044 72.1676025 #> [3596] 18.0594807 16.0637493 NA 8.0370464 176.6657867 #> [3601] 2181.4362793 9.6984138 3978.9870605 8.6989155 11.3172474 #> [3606] 39.0961494 NA 2588.9499512 3505.7983398 144.8855133 #> [3611] 5.1680942 30.6885090 6.6054115 5.6432614 2.7389083 #> [3616] NA 53.9481773 62.0971260 2972.6391602 161.4343109 #> [3621] 35.4546394 11.2379074 13.3652372 15.0986557 NA #> [3626] 20.7111149 9.2977657 425.2767639 216.2778320 7.9142838 #> [3631] 5.0309882 NA 1.0399815 1.0769179 4.5379925 #> [3636] 3.6899538 2.2575519 17.9379234 NA 22.7302589 #> [3641] 6.5185528 19.6637669 NA 0.2854209 7.1664414 #> [3646] 9.3295479 NA 1.1119181 1.1998634 44.4294777 #> [3651] 6.0005445 1.2984159 NA 0.4181677 1.3962787 #> [3656] NA 0.8486760 0.6826237 1.3289268 41.6967010 #> [3661] 1.6696991 NA 0.8142897 0.3997326 64.2423019 #> [3666] NA 4.2105532 8.1320543 0.8433636 21.3994884 #> [3671] 0.6499675 1.6173933 2.2819724 79.2927475 NA #> [3676] 2.7942066 0.6122881 5.6340408 2.3877366 2.5358839 #> [3681] NA 1.6963638 2.8207321 1.6094570 3.0496490 #> [3686] NA 5.2695556 0.7497861 1.1942160 NA #> [3691] 2.8949137 1.8337013 NA 7.7278204 3.0212984 #> [3696] NA 4.6463079 1.1313710 NA 3.0398493 #> [3701] NA NA NA 1.1938435 NA #> [3706] 0.5559963 3.7946312 NA NA 0.7459199 #> [3711] 2.6556878 4.8397417 NA NA NA #> [3716] 2.1508582 4.1808691 NA 1.3044889 3.6563311 #> [3721] NA 5.6848607 4.3057156 4.3253880 NA #> [3726] 44.0154037 6.8031969 NA 1.0149941 16.5446339 #> [3731] NA 50.2134972 1.4178553 5.2461462 NA #> [3736] 6.6964250 NA 1.3668361 7.0547361 15.4979038 #> [3741] NA 2.5466137 12.0476017 16.9358387 4.2765665 #> [3746] NA 3.0282452 2.0438735 3.0750351 30.2993698 #> [3751] 4.1311669 10.5620518 NA 6.3157725 2.0541127 #> [3756] 6.4616790 52.7001801 6.5350013 2.7538323 5.5697684 #> [3761] 7.0785255 NA 0.7346154 4.6684666 2.3665750 #> [3766] 2.1643167 13.1310358 11.3682957 NA 1.0712550 #> [3771] 12.9957743 1371.8287354 1.3735292 4.6520715 20.4687824 #> [3776] 14.5587559 NA 1770.5562744 2.6400170 15.1324883 #> [3781] 1.9400562 4.7408748 2.0517797 32.1368103 NA #> [3786] 0.9072015 1766.3382568 11.0576754 2.3649356 7.1545792 #> [3791] 5.3592334 29.8745804 NA 99.2443008 1.9519557 #> [3796] 3.5576828 5.4862013 19.1255341 NA 1.0205218 #> [3801] 74.6288681 2.6257737 3.8454990 0.9508846 15.9569130 #> [3806] NA 3.9706428 NA 6.0614076 NA #> [3811] 0.9358777 0.4645265 1.3660873 2.9063818 6.6953201 #> [3816] NA 1.7190092 0.9622721 1.7018661 11.3596716 #> [3821] NA NA 3.0443096 NA 0.6346511 #> [3826] NA NA NA 10.0340395 0.8095649 #> [3831] 0.9709995 NA 3.2444031 NA NA #> [3836] 0.5028589 2.7934396 6.8828177 NA 0.5587204 #> [3841] 1.6042945 1.3587892 NA 0.8313419 2.4558291 #> [3846] 1.7974735 NA 3.6726115 5.6037540 6.7877126 #> [3851] NA 3.6458204 0.8579472 8.0946331 12.1906815 #> [3856] 1.5101539 6.0351577 11.0641689 NA 17.6339569 #> [3861] 3.6026669 16.1998940 2.8316128 NA 4.9478583 #> [3866] 27.5424156 7.0986490 3.9904847 NA 4.6039705 #> [3871] 3.3738575 12.1051941 11.3188763 14.8368187 9.5498314 #> [3876] NA 1.9773377 13.8263979 23.9170589 13.4375019 #> [3881] 9.8440132 NA 11.2628098 2.5026691 22.5849972 #> [3886] 29.0189171 18.8118534 NA 22.0679207 4.0647068 #> [3891] 2.0535538 1.5048116 3.3824587 2.3311884 32.8195572 #> [3896] NA 37.0816650 7.0685787 5.5009451 5.8517952 #> [3901] 4.9319654 3.4151902 4.2116370 8.8043442 NA #> [3906] 1099.1087646 5.3256183 5.2614517 480.0812378 5.3612590 #> [3911] 12.7172546 6.3167968 14.1994934 NA 59.6927795 #> [3916] 964.6279297 1400.3564453 535.6882324 23.6954079 14.5343561 #> [3921] 2.9595783 17.3649712 NA 1.0824900 1221.8245850 #> [3926] 147.4770660 683.7954712 6.1305389 4.9751444 15.9264107 #> [3931] 18.4570618 NA 1083.5487061 191.7899017 875.8353271 #> [3936] 577.2622681 71.0305328 8.1075430 5.3227873 11.6976309 #> [3941] NA 0.4594952 1.4792782 1.6332765 4.2618947 #> [3946] 6.4441838 2.9269114 130.0458374 5.1534815 NA #> [3951] 3.5288918 2.2328265 7.3872643 35.0871201 164.8385925 #> [3956] 41.0983658 NA 3.6965251 3.6046982 34.9871025 #> [3961] 54.6165199 NA 3.3092432 6.2893038 54.9078522 #> [3966] NA 4.6468277 5.5542288 52.0769882 NA #> [3971] 7.5430121 11.7523575 32.7870789 NA 4.3187008 #> [3976] 22.1579170 5.4699397 1.8834021 NA 9.8157177 #> [3981] 3.3649621 10.4119244 12.9897251 NA 3.0194745 #> [3986] 20.3988075 9.6839437 1.9245056 27.7328892 4.6774187 #> [3991] 2.8958423 NA 5.1254649 25.3332367 15.3362989 #> [3996] 5.6253791 9.0580263 3.3217881 16.1069527 5.7460155 #> [4001] NA 9.0998583 6.4395881 27.5900745 11.9862118 #> [4006] 10.4788322 4.7713022 7.4465909 21.6194534 NA #> [4011] 3.4900868 11.9859657 7.1533313 53.6382294 22.4019108 #> [4016] 3.4466097 11.8166838 31.7925739 NA 7.1903763 #> [4021] 22.3436050 21.0166111 11.6625166 9.6446323 11.8060122 #> [4026] 10.7140808 20.5072823 NA 5.8385706 12.4566240 #> [4031] 27.2418690 1374.2124023 5.0976796 8.5298624 8.9547720 #> [4036] 14.1582394 NA 3.6345949 8.9698286 746.4771729 #> [4041] 16.0491295 14.2799292 12.4969416 16.1063213 17.6739025 #> [4046] NA 13.8779955 5.8102989 4.7912970 8.5829220 #> [4051] 7.5092740 16.8982792 8.7955656 27.1313457 NA #> [4056] 10.5999660 102.9700699 5.2469325 78.4538498 23.4321194 #> [4061] 13.5085144 28.0264759 42.0644264 NA 3.0340507 #> [4066] 16.6190434 1717.7260742 6.9299235 10.5656214 27.8841705 #> [4071] 17.4288807 47.0360756 NA 5.2313685 49.5542450 #> [4076] 4.6091428 7.5845995 5.1649594 5.6527944 6.7112393 #> [4081] 7.1952438 NA 2.8361075 936.4321899 10.8392658 #> [4086] 300.9952393 3.7918711 5.8666444 9.0892420 7.9013219 #> [4091] NA 5.9726405 6.4315825 6.7033081 174.0914154 #> [4096] 9.4583406 13.8090487 25.1833706 10.3936863 NA #> [4101] 11.1641397 3.6089337 4.3211293 4.5236745 5.9249415 #> [4106] 19.1762638 44.9207954 1162.3734131 NA 9.1217899 #> [4111] 6.2500715 14.8576088 9.4355440 27.3175831 75.4738541 #> [4116] 1927.7430420 10.6061239 NA 2.5857298 5.2106519 #> [4121] 16.0033913 13.5474854 30.9249420 2882.4428711 37.9162636 #> [4126] 75.5530014 NA 6.0951519 4.3891191 10.3061371 #> [4131] 6.6429935 39.4176941 10.0774698 83.8411789 21.2222996 #> [4136] NA NA 0.6372588 3.5606251 2.5927734 #> [4141] 3.2620273 2.3674390 1.8626410 6.6079321 NA #> [4146] 2.4800649 6.8728633 2.8025930 10.0381966 4.8456726 #> [4151] 89.1146164 4.3337107 3.8712926 NA 42.9793968 #> [4156] 2.5299530 7.4297533 4.6089058 NA 3.5378845 #> [4161] NA 0.1817949 1.1290787 1.5784779 1.1125787 #> [4166] NA NA NA NA 2.0033450 #> [4171] NA NA NA NA 1.0376083 #> [4176] 1.9011122 2.3181555 NA NA NA #> [4181] 1.6446155 NA NA NA 0.9089839 #> [4186] 0.4841611 NA 0.6897894 0.7658206 0.6156495 #> [4191] 1.4828655 2.3340645 1.1662629 0.9815852 2.3534944 #> [4196] NA NA NA 2.1499813 0.7019742 #> [4201] 0.3516256 3.2850077 5.8242555 NA NA #> [4206] 1.3007295 1.5015216 0.8093400 3.2225409 2.6426129 #> [4211] NA 2.3901305 2.9790335 2.9894137 5.2419791 #> [4216] 4.8620076 NA 0.3997991 3.0470288 11.9397249 #> [4221] 3.6320026 8.3058691 1.3834330 NA 4.1316576 #> [4226] 3.7130520 3.9005911 16.1633472 3.6801958 12.0339565 #> [4231] NA 1.1500748 1.2219627 0.5826390 3.3800447 #> [4236] 5.2994637 NA 2.6451149 NA 2.7287869 #> [4241] 3.1930273 NA 1.8436399 2.9893756 NA #> [4246] 4.9069676 NA 5.8526864 NA 1.9956532 #> [4251] 5.7515755 NA 9.3381653 NA 3.7572572 #> [4256] NA NA NA NA NA #> [4261] NA NA NA NA NA #> [4266] NA 0.4758977 NA NA NA #> [4271] NA 0.5950958 NA 1.2651656 0.5604061 #> [4276] NA NA NA NA NA #> [4281] NA NA NA NA 1.5873302 #> [4286] NA NA 1.7309831 NA 2.2026825 #> [4291] NA NA NA NA NA #> [4296] NA NA NA NA NA #> [4301] NA 0.8321332 NA NA NA #> [4306] NA NA NA 3.1331923 NA #> [4311] NA NA 1.8596388 NA 4.0986276 #> [4316] NA 1.4462790 5.0948448 NA 3.3446779 #> [4321] NA 14.7490797 4.2720022 2.3573306 12.4373245 #> [4326] 5.4349809 NA 5.5168352 7.1895194 NA #> [4331] 1.3353804 31.1978798 6.0550547 5.3862381 NA #> [4336] 2.3742425 1.6283454 NA NA NA #> [4341] 3.8663564 NA 2.5557170 NA NA #> [4346] 3.9340308 NA 4.8355684 NA NA #> [4351] NA NA 0.8258027 NA NA #> [4356] 1.6850734 NA NA 8.2018566 NA #> [4361] 2.8547313 NA 2.7901099 NA 1.2237481 #> [4366] NA 1.2317826 5.9977107 NA 2.4985216 #> [4371] 5.4254308 10.2619724 3.6585343 NA 0.7505842 #> [4376] 1.0290449 1.4102111 31.6295795 6.0977502 3.3116033 #> [4381] NA 6.6416101 13.4169693 NA 2.0772371 #> [4386] 2.5722609 1.4239205 1.1951129 19.3541183 6.6528106 #> [4391] 7.6534238 NA 3.3320429 3.9984677 2.1092513 #> [4396] 8.5107756 2.7920604 28.8576584 1.6512991 2.0430546 #> [4401] NA 6.1738434 2.2872250 3.3046799 4.1366568 #> [4406] 2.0184140 3.4700344 2.1820960 9.8032455 NA #> [4411] 9.3485680 7.2345314 20.3594875 7.5089312 1627.1451416 #> [4416] 5.3730831 8.5319214 12.6467562 NA 6.4055276 #> [4421] 5.4178729 3.8174756 60.1280174 6.4091296 14.2986145 #> [4426] 13.2007456 17.6533527 NA 4.6876645 2218.6071777 #> [4431] 5.9873571 5.4104090 13.5144920 4.3813696 8.5980825 #> [4436] 19.0352879 NA 1989.9606934 6.5922198 8.3580027 #> [4441] 5.7576084 341.0995483 3.3168538 9.5687895 9.9157639 #> [4446] NA 8.6866083 366.3923645 6.9480758 10.2027311 #> [4451] 7.9508238 12.0425510 5.7334862 5.7009211 NA #> [4456] 9.3929729 4.2744284 16.8116989 3.3318050 61.5876274 #> [4461] 3.6692767 4.6599665 NA 16.0338726 43.3646393 #> [4466] NA 0.4666836 1.1231649 3.3837605 5.3292937 #> [4471] 3.6405241 9.7523746 NA 0.9140767 0.7435523 #> [4476] 0.2535407 5.4856982 15.5203247 NA NA #> [4481] 3.2470930 2.7420650 NA 0.6101449 1.0404911 #> [4486] 2.7917345 6.6811185 2.0745556 NA 1.2540616 #> [4491] 0.3098164 1.6586421 9.5700045 NA 0.7319268 #> [4496] 12.7017021 NA NA 0.6637144 NA #> [4501] 1.5885706 0.8827127 NA 2.1940100 3.7667232 #> [4506] NA 2.0905075 NA 0.6379106 2.9787626 #> [4511] NA NA NA 0.4874143 NA #> [4516] NA 0.3836070 NA NA 0.5107485 #> [4521] NA NA NA 1.1823709 1.2667042 #> [4526] NA 19.2034588 1.6550628 1.1661954 0.8966293 #> [4531] NA 3.2779715 NA 11.0150242 NA #> [4536] 1.6130922 26.5314026 2.5117977 2.3132839 2.2919271 #> [4541] NA 3.1338563 1.5114740 NA 2.0381725 #> [4546] 5.2738991 2.9814677 3.5173035 NA 2.9813018 #> [4551] 1.8998176 NA 7.4101906 5.3717108 4.2854128 #> [4556] NA 0.2399864 6.4908400 1.6760609 4.9045634 #> [4561] 3.0678418 NA 2.1384492 9.3216219 10.4645767 #> [4566] NA 0.3764410 1.2218126 1.2995534 9.7801199 #> [4571] 2.0047073 26.3789768 NA 1.0760976 0.9736537 #> [4576] 2.0357609 1576.8568115 1.4469386 3.0481942 1.6708410 #> [4581] NA 0.9496741 2.6938272 1.8960530 2.1988547 #> [4586] 1.2718045 1.2236259 NA 1.4919758 4.3979073 #> [4591] 71.3828812 2.0391872 2.2703087 2.6103971 1.4898348 #> [4596] NA 1.5168892 0.8818803 1.8848048 0.6037043 #> [4601] 1.8731611 7.1765389 1.9562593 NA 11.7375755 #> [4606] 1.6933267 1.5986614 5.0060325 5.2257977 NA #> [4611] 4.1671195 4.4332304 6.8677626 NA 2.4653215 #> [4616] 6.3500257 10.9838686 6.4111762 9.4890432 4.7053976 #> [4621] 1.8102279 1.4213001 NA 1.6444297 1.9174886 #> [4626] 0.4131429 1.5709261 3.1760740 1.0655589 919.2457886 #> [4631] 1.5643872 NA 1.7901465 1.7823997 6.9229293 #> [4636] 2.2213833 NA 0.8164910 NA 6.7707281 #> [4641] 1034.1815186 2.8209743 0.6380021 NA 1.1908475 #> [4646] 2.2225995 NA NA NA 1.8188674 #> [4651] NA NA 2.1192210 NA 1.1434188 #> [4656] NA 1.2050375 NA NA NA #> [4661] NA 1.7906495 NA NA 3.5892394 #> [4666] NA NA NA NA NA #> [4671] NA NA NA 0.7533023 NA #> [4676] NA NA NA NA NA #> [4681] NA 1.4840194 2.2305763 NA NA #> [4686] NA NA NA NA NA #> [4691] NA NA NA NA NA #> [4696] NA NA NA NA NA #> [4701] NA NA NA NA NA #> [4706] NA NA NA NA NA #> [4711] NA NA NA NA NA #> [4716] NA NA NA NA NA #> [4721] NA 2.4143374 NA NA NA #> [4726] NA NA NA NA NA #> [4731] NA NA NA 1.9114826 NA #> [4736] 1.0137789 NA NA 4.2369156 NA #> [4741] 2.1006327 2.7787836 0.9601986 NA 8.1295986 #> [4746] 7.2806950 1.1032010 NA 2.3385823 NA #> [4751] 1.1522059 1.4659723 8.5681458 1.8708251 NA #> [4756] NA NA 9.6687212 5.7849174 NA #> [4761] NA 2.4449232 1.6775528 4.9673247 1.8457032 #> [4766] NA NA 11.6521568 NA 5.6321864 #> [4771] 0.9540480 NA 12.1773853 0.4559720 NA #> [4776] NA NA NA NA NA #> [4781] NA NA NA NA 0.7230437 #> [4786] NA 1.5481060 NA NA NA #> [4791] 1.7013626 NA 1.9925474 NA NA #> [4796] NA 4.0501847 NA 1.5732721 2.9336040 #> [4801] NA NA 1.2153755 2.3473213 NA #> [4806] 1.6044481 3.8102901 5.9565816 NA NA #> [4811] 3.5146675 NA 2.6926224 NA 4.9956584 #> [4816] NA 7.3882804 31.3160343 1.3993325 6.2274776 #> [4821] NA 2.9698203 NA 3.2010090 NA #> [4826] 1.3510920 5.6216455 NA NA 3.3691561 #> [4831] 2.7835443 NA 0.4399868 2.5057735 5.0695376 #> [4836] NA 0.6980689 1.8963152 8.0071716 9.3238049 #> [4841] NA 2.4393957 4.9562755 2.4916747 NA #> [4846] 1.4161593 1.7179910 2.8897645 2.1166553 2.5877254 #> [4851] 12.7337999 NA 1.2360386 2.1893265 1.5300977 #> [4856] 3.0833626 8.4302454 NA 4.9040179 10.9480925 #> [4861] NA NA 2.1738741 3.3114023 6.0667453 #> [4866] NA NA 0.6554648 NA 3.5936801 #> [4871] 1.5739572 NA 5.1975174 NA NA #> [4876] 3.9125762 9.3439398 7.9241571 3.9933949 NA #> [4881] 4.6318932 NA NA 8.3959627 NA #> [4886] 0.7565725 2.3423707 15.7967987 12.7200508 NA #> [4891] NA NA 3.1725900 11.7995720 NA #> [4896] 0.9761860 NA 1.1349560 NA NA #> [4901] 1.9718618 NA 4.9297872 NA 7.0475721 #> [4906] NA NA NA 2.8053823 NA #> [4911] 34.1454964 156.3358002 NA NA NA #> [4916] 2.1250823 4.3354549 NA 64.4767151 278.9322815 #> [4921] NA 0.7963252 NA 3.8422236 NA #> [4926] 61.7775192 190.2516785 1.4124620 1.3479694 NA #> [4931] 1.6552913 4.4471312 329.0337830 2.3342044 2.1571195 #> [4936] 0.9733863 2.4092717 4.8433948 NA 2.3092387 #> [4941] 360.7164307 3.0873225 1.7288386 NA 2.3073480 #> [4946] 0.5996385 5.3622589 1420.7687988 7.9223099 5.6030631 #> [4951] NA 0.6277632 0.8355366 0.4711815 1.3496840 #> [4956] 0.8089792 5.8526330 NA 1.8503476 0.6572140 #> [4961] NA 305.6041870 1.4397534 NA 0.8994330 #> [4966] 277.0521240 2.2045338 NA NA NA #> [4971] NA NA NA NA NA #> [4976] NA 0.5602361 NA 1.2226131 NA #> [4981] NA NA NA 1.3568290 1.7129589 #> [4986] NA 2.0047822 1.7247094 NA NA #> [4991] NA NA 6.7786064 NA 2.6411271 #> [4996] NA NA 1.9010485 1.7608452 NA #> [5001] 4.4309907 NA 3.1676409 NA NA #> [5006] NA NA 3.3830304 4.6565275 3.3298314 #> [5011] NA 1.5452514 NA NA 3.5828693 #> [5016] NA NA NA NA 1.7718617 #> [5021] 0.8061830 NA 1.2403909 4.6554375 NA #> [5026] NA NA NA NA NA #> [5031] 1.6074916 3.6399906 1.1538744 NA NA #> [5036] 4.6306715 NA 22.4013309 NA NA #> [5041] NA 4.1293302 6.8009396 NA 32.1985893 #> [5046] NA 9.7335100 NA NA NA #> [5051] NA NA NA NA NA #> [5056] NA NA 0.5418288 NA NA #> [5061] NA NA NA NA NA #> [5066] NA NA NA 0.5632182 NA #> [5071] NA NA 2.9177530 NA 2.1166260 #> [5076] NA 6.6263289 NA 2.1903484 6.9556012 #> [5081] 3.3954957 NA 3.9068611 NA 1.8365928 #> [5086] NA 3.1866224 6.6193805 5.9870872 NA #> [5091] 2.3148339 31.7243080 1.7895136 3.5860963 NA #> [5096] NA NA 1.8591824 77.3616867 NA #> [5101] 3.4268165 0.5249496 1.5734435 3.8141046 NA #> [5106] 2.7002668 NA 1096.7601318 NA 1496.8631592 #> [5111] 3.2043941 NA 1.8505754 587.6149292 1741.0694580 #> [5116] NA 885.2774048 NA 23.7601643 NA #> [5121] NA NA 594.6196899 NA NA #> [5126] NA NA NA 0.4923916 29.5300331 #> [5131] NA NA NA NA NA #> [5136] NA NA NA NA NA #> [5141] 1.3024459 NA NA NA NA #> [5146] NA NA NA NA NA #> [5151] NA NA 0.7680741 NA 0.8888112 #> [5156] NA NA 2.1178827 1.4857029 NA #> [5161] 1.1276029 1.3496284 2.1555452 NA NA #> [5166] NA 2.1827545 1.2788655 NA NA #> [5171] NA NA 1.2924441 NA 0.9934639 #> [5176] NA NA NA NA 5.3240347 #> [5181] 1.0079803 1.3528888 NA NA NA #> [5186] NA NA 10.8723679 NA NA #> [5191] NA NA NA NA 1.9321351 #> [5196] NA NA NA NA 2.5913424 #> [5201] NA NA NA NA 2.0170100 #> [5206] 2.6124203 NA NA NA 25.0653572 #> [5211] 0.7242321 NA NA NA NA #> [5216] NA NA NA NA NA #> [5221] 2.9123745 NA 1.8755200 NA 5.4409308 #> [5226] NA 1.6049031 NA 4.8650875 3.9305305 #> [5231] 2.3677256 2.1769772 NA 6.9278378 0.9471752 #> [5236] 11.2096748 8.1439409 NA 7.7992425 8.1538477 #> [5241] 7.7033796 NA 15.1453743 31.8052731 18.0042858 #> [5246] NA 1.2677478 5.5277863 2.1457639 NA #> [5251] 3.4404881 6.6042099 NA 4.3178186 10.6584396 #> [5256] 4.6253743 NA 4.4684582 9.8839989 NA #> [5261] 0.4913557 NA 4.2288108 NA 2.3422270 #> [5266] 220.2428894 76.3024292 2.4397397 NA 0.7708665 #> [5271] 0.5308517 153.5867767 NA 0.7601256 NA #> [5276] 5.8568654 3.3581190 1.1768376 NA 1.9733516 #> [5281] 8.9577475 NA NA 1.6991717 NA #> [5286] NA NA NA NA NA #> [5291] 0.6544989 0.8063468 NA NA 0.5237735 #> [5296] NA 1.2291242 NA NA NA #> [5301] 0.4108943 11.5966806 NA NA NA #> [5306] NA 1.5359516 NA NA NA #> [5311] NA NA NA NA NA #> [5316] 0.5914992 NA NA NA NA #> [5321] NA NA 1.5501552 NA NA #> [5326] NA NA NA NA NA #> [5331] 0.4674177 NA NA NA NA #> [5336] NA 1.4722780 NA 10.3540297 12.8971653 #> [5341] 76.4729843 3.3384745 NA NA NA #> [5346] NA NA NA NA NA #> [5351] NA NA NA NA NA #> [5356] NA NA NA NA NA #> [5361] NA 8.8360243 NA 0.8269219 NA #> [5366] NA NA NA NA NA #> [5371] NA NA NA 0.8899398 6.1822929 #> [5376] 1.4949089 NA NA NA NA #> [5381] NA NA NA NA NA #> [5386] NA NA 6.1136923 45.9732246 1.8630898 #> [5391] NA NA NA NA NA #> [5396] NA NA NA NA NA #> [5401] NA NA NA NA NA #> [5406] NA NA NA NA NA #> [5411] NA NA NA 0.4607324 NA #> [5416] NA NA NA NA NA #> [5421] NA NA 2.4314377 NA NA #> [5426] NA NA NA NA NA #> [5431] NA NA NA NA NA #> [5436] NA NA NA NA NA #> [5441] NA NA NA NA NA #> [5446] NA NA NA NA NA #> [5451] NA NA NA NA 0.3267280 #> [5456] 7.7629838 NA NA NA NA #> [5461] NA 0.9005343 NA NA NA #> [5466] NA 6.4958630 0.6801585 1.1879852 NA #> [5471] 13.1560583 NA NA NA NA #> [5476] NA 2.3879337 NA NA NA #> [5481] NA NA NA NA NA #> [5486] NA NA NA NA NA #> [5491] NA NA 0.7733446 NA 1.1475980 #> [5496] NA 3.0229218 14.0746317 NA NA #> [5501] NA NA NA NA NA #> [5506] NA NA NA 0.5247985 NA #> [5511] NA NA NA NA NA #> [5516] NA NA NA NA 1.2050325 #> [5521] 9.2619877 NA 0.7634576 NA NA #> [5526] NA NA NA NA NA #> [5531] NA NA NA 1.0241749 1.0909539 #> [5536] 5.3293109 NA NA NA NA #> [5541] NA 2.7063551 NA 3.4095821 NA #> [5546] NA NA NA NA NA #> [5551] NA NA NA 0.6897098 NA #> [5556] NA NA NA NA NA #> [5561] 1.0274373 NA NA NA NA #> [5566] NA NA NA NA NA #> [5571] NA NA NA NA 0.8178927 #> [5576] NA NA NA NA NA #> [5581] 1.5089374 0.7430726 NA 1.1275156 NA #> [5586] NA NA NA NA NA #> [5591] NA NA NA NA NA #> [5596] NA NA NA NA NA #> [5601] NA NA NA NA NA #> [5606] 21.9422588 1.3811653 NA 3.5942285 NA #> [5611] NA 1.6271605 NA NA NA #> [5616] NA NA NA NA NA #> [5621] NA NA NA NA NA #> [5626] 2.1611414 NA NA NA NA #> [5631] NA 0.8879982 NA 0.8763292 NA #> [5636] NA NA NA 1.7225560 13.2923336 #> [5641] NA NA NA NA NA #> [5646] NA NA NA NA NA #> [5651] NA NA NA NA NA #> [5656] NA NA NA NA NA #> [5661] 3.3895564 21.7352753 NA NA NA #> [5666] NA NA NA NA NA #> [5671] NA NA NA NA NA #> [5676] NA NA NA NA NA #> [5681] NA NA NA NA NA #> [5686] NA NA NA NA 0.4632308 #> [5691] NA NA NA 1.5177442 NA #> [5696] NA NA NA NA NA #> [5701] 1.9604896 NA NA NA NA #> [5706] NA NA NA 5.8416729 NA #> [5711] 0.6393901 2.9566762 0.3774208 NA NA #> [5716] NA NA NA NA NA #> [5721] NA 1.6599923 3.0378304 NA NA #> [5726] NA NA NA 2.7158394 NA #> [5731] NA NA NA NA NA #> [5736] NA NA NA NA NA #> [5741] NA NA NA NA NA #> [5746] NA NA NA NA NA #> [5751] NA NA NA NA NA #> [5756] NA NA NA NA NA #> [5761] NA 0.6954392 NA NA NA #> [5766] 1.9243698 NA NA NA NA #> [5771] NA NA NA 1.4208319 NA #> [5776] NA NA NA 0.3644979 NA #> [5781] NA NA NA NA NA #> [5786] NA NA NA NA NA #> [5791] NA NA NA NA NA #> [5796] NA NA NA NA 0.9764859 #> [5801] NA NA NA NA NA #> [5806] NA NA NA 1.7312529 1.9927244 #> [5811] 8.3358564 NA NA NA NA #> [5816] NA NA NA NA NA #> [5821] NA NA NA NA NA #> [5826] NA NA NA NA NA #> [5831] NA NA 0.3344689 NA NA #> [5836] NA 1.5944563 NA NA NA #> [5841] NA NA NA NA NA #> [5846] 1.4439087 2.7181752 NA NA NA #> [5851] NA 0.9094949 1.2030648 NA NA #> [5856] NA NA NA 2.7429266 6.6508756 #> [5861] NA NA NA NA NA #> [5866] NA NA NA 2.8126271 3.6208489 #> [5871] 6.5295534 NA 0.3424659 NA NA #> [5876] NA NA NA NA NA #> [5881] NA NA NA NA NA #> [5886] 0.5115961 0.5035965 NA NA NA #> [5891] NA NA NA NA NA #> [5896] NA NA NA NA NA #> [5901] NA NA NA NA NA #> [5906] NA NA NA NA NA #> [5911] 1.0872059 NA NA 1.5785052 NA #> [5916] 0.2461324 NA NA NA NA #> [5921] NA NA 1.9896445 NA NA #> [5926] NA NA NA NA 0.8427312 #> [5931] 0.7660883 NA NA NA NA #> [5936] NA 2.3450923 2.4805903 NA NA #> [5941] NA NA 0.8671566 NA NA #> [5946] NA 0.6639645 NA NA NA #> [5951] NA NA NA NA NA #> [5956] NA NA NA 0.5334827 0.4702013 #> [5961] NA NA NA NA NA #> [5966] NA NA 3.1127882 64.2761841 5.7723532 #> [5971] NA NA NA NA NA #> [5976] NA NA NA NA NA #> [5981] 0.9449326 NA NA NA 9.8559513 #> [5986] NA 1.5376849 NA NA NA #> [5991] 0.6502208 NA 0.8867813 0.9406697 NA #> [5996] NA NA NA NA NA #> [6001] NA NA NA NA NA #> [6006] NA 2.6839008 NA 3.2349586 26.2348919 #> [6011] 2.3463531 NA 0.7232664 0.5971866 NA #> [6016] NA NA NA NA NA #> [6021] 2.7867749 1.2694967 NA 5.0291767 NA #> [6026] NA NA NA NA NA #> [6031] NA NA NA NA NA #> [6036] NA NA NA NA NA #> [6041] NA NA NA 1.4869373 NA #> [6046] 1.9182748 NA NA NA NA #> [6051] NA NA NA 0.8268527 4.4961567 #> [6056] NA NA 0.4737805 NA NA #> [6061] NA NA NA NA NA #> [6066] NA NA NA 2.8711464 NA #> [6071] NA NA NA NA NA #> [6076] 3.6332841 NA 1.5385498 NA NA #> [6081] NA 4.7165794 NA NA NA #> [6086] NA NA NA NA NA #> [6091] 1.2112534 NA NA NA NA #> [6096] NA NA 2.5973957 4.9447703 NA #> [6101] NA NA NA NA NA #> [6106] NA NA NA 0.9545295 NA #> [6111] NA NA NA 1.4072028 1.8630619 #> [6116] 1.4024746 NA NA NA NA #> [6121] NA NA NA NA 0.5282810 #> [6126] 1.8168713 4.9301190 NA NA NA #> [6131] NA NA NA NA NA #> [6136] NA NA NA NA NA #> [6141] NA NA NA NA NA #> [6146] NA NA NA NA NA #> [6151] NA 0.1499837 0.7057289 NA NA #> [6156] NA NA NA NA NA #> [6161] NA 1.6758749 1.9225767 NA NA #> [6166] NA NA NA 0.6456749 1.0736265 #> [6171] 0.6631852 NA NA NA NA #> [6176] NA NA NA NA NA #> [6181] NA NA NA NA NA #> [6186] NA NA NA NA NA #> [6191] 2.0254166 0.8686433 NA NA NA #> [6196] NA 2.9635856 NA NA NA #> [6201] NA NA NA NA NA #> [6206] NA NA NA NA 2.8306408 #> [6211] 0.6591658 NA 1.8536581 NA 0.7700182 #> [6216] NA NA NA NA NA #> [6221] NA 0.6434809 NA NA 3.0102704 #> [6226] NA 0.6942499 2.7054408 NA NA #> [6231] NA NA NA 6.5840912 NA #> [6236] NA NA NA 0.4648814 NA #> [6241] 2.2047083 NA NA NA NA #> [6246] NA 0.8025916 NA NA 0.9868059 #> [6251] NA NA 0.9812470 1.6068337 NA #> [6256] NA NA NA 1.6466388 0.6577185 #> [6261] 3.3152702 NA NA NA NA #> [6266] NA NA NA NA NA #> [6271] NA 0.3456087 1.4819642 1.6930362 NA #> [6276] NA NA NA NA 0.6172115 #> [6281] NA 4.8450933 10.5450792 48.2902794 0.6500265 #> [6286] NA NA NA NA NA #> [6291] NA NA NA 0.6208660 NA #> [6296] 0.6039580 NA NA 0.9597225 NA #> [6301] NA NA NA NA NA #> [6306] 0.3537683 NA NA NA 0.8526208 #> [6311] NA NA NA NA NA #> [6316] NA 0.2884314 0.8374825 NA NA #> [6321] NA NA NA NA NA #> [6326] NA NA 1.8498940 NA NA #> [6331] NA NA NA NA NA #> [6336] NA 2.6492484 NA 0.8956540 1.2795352 #> [6341] 3.1287794 NA NA NA NA #> [6346] NA 2.0273194 NA NA NA #> [6351] NA 3.7718840 1.8026490 NA NA #> [6356] NA NA NA NA 0.7220110 #> [6361] NA NA NA 0.7175305 4.3183942 #> [6366] NA NA NA NA NA #> [6371] NA NA NA NA 1.4981960 #> [6376] NA NA NA NA NA #> [6381] NA NA NA NA NA #> [6386] NA NA 0.2836370 NA 0.8527241 #> [6391] 3.5981882 NA NA NA NA #> [6396] NA NA NA NA NA #> [6401] 0.3067524 NA NA NA NA #> [6406] 1.3901409 NA NA NA NA #> [6411] NA NA NA NA NA #> [6416] NA NA NA NA 2.7463164 #> [6421] NA NA NA NA 2.1976302 #> [6426] NA 0.2309106 NA 0.2099868 NA #> [6431] NA NA NA NA NA #> [6436] NA 0.8203602 NA 1.9904572 4.0084724 #> [6441] NA NA 0.5368133 NA NA #> [6446] NA NA 0.4482878 1.4325606 NA #> [6451] NA NA NA 2.3086529 NA #> [6456] NA NA NA NA 0.4549935 #> [6461] NA NA NA NA NA #> [6466] NA NA NA NA NA #> [6471] NA NA NA 3.1426587 1.3987031 #> [6476] NA NA NA NA NA #> [6481] NA NA NA 0.4663780 NA #> [6486] NA NA 2.3534548 NA NA #> [6491] NA NA NA NA NA #> [6496] NA NA NA NA NA #> [6501] NA NA NA NA NA #> [6506] NA NA NA NA NA #> [6511] NA NA NA NA NA #> [6516] NA NA NA NA NA #> [6521] NA NA NA NA NA #> [6526] NA NA NA 3.8060784 NA #> [6531] NA NA NA NA NA #> [6536] 0.4556686 NA NA NA NA #> [6541] NA NA NA NA NA #> [6546] NA NA NA NA NA #> [6551] NA 1.3394214 NA 1.1004189 NA #> [6556] NA NA NA NA NA #> [6561] NA NA NA NA 2.4211915 #> [6566] NA 3.3820996 NA NA NA #> [6571] NA NA NA NA NA #> [6576] NA NA NA NA NA #> [6581] NA NA NA NA NA #> [6586] NA 31.4883842 NA NA NA #> [6591] NA NA NA NA NA #> [6596] 0.7637222 NA NA NA NA #> [6601] NA NA NA NA 2.0601268 #> [6606] NA 0.7897440 NA NA NA #> [6611] 1.1024669 NA NA 1.4127746 NA #> [6616] NA NA NA NA NA #> [6621] NA NA NA NA NA #> [6626] 0.7815835 NA NA NA NA #> [6631] NA NA NA NA NA #> [6636] NA NA NA 0.3922873 2.3492901 #> [6641] NA 1.7412961 NA NA NA #> [6646] NA NA 1.0913932 NA NA #> [6651] NA NA NA NA NA #> [6656] NA NA NA NA NA #> [6661] NA 2.1832561 5.6013675 NA 0.5410951 #> [6666] NA NA NA NA NA #> [6671] NA NA NA NA NA #> [6676] NA NA NA NA NA #> [6681] NA NA NA NA NA #> [6686] NA NA NA NA NA #> [6691] NA NA NA NA 1.5191215 #> [6696] 8.5703373 NA NA NA NA #> [6701] NA NA NA NA NA #> [6706] NA 1.4032021 NA NA NA #> [6711] NA NA NA NA NA #> [6716] NA NA NA NA NA #> [6721] NA NA NA NA NA #> [6726] NA NA NA 2.8650708 NA #> [6731] 1.6290002 NA NA NA NA #> [6736] NA 0.6252948 NA NA NA #> [6741] 2.6510727 5.6316738 NA NA NA #> [6746] NA NA NA NA NA #> [6751] 0.6707575 1.2557933 2.8557181 NA NA #> [6756] NA NA NA NA NA #> [6761] NA NA NA NA NA #> [6766] NA NA NA NA 6.8578634 #> [6771] NA 0.6140221 NA NA NA #> [6776] NA NA NA 4.2484360 NA #> [6781] 0.6619285 1.2980875 3.2068131 NA 1.3282340 #> [6786] NA NA NA NA NA #> [6791] NA 1.5175761 NA NA NA #> [6796] NA NA NA NA NA #> [6801] 2.3767309 NA 0.8093471 NA NA #> [6806] NA NA NA NA NA #> [6811] 0.6040459 NA NA NA NA #> [6816] 0.6218860 NA NA NA NA #> [6821] NA NA NA NA NA #> [6826] NA 1.4518211 NA NA NA #> [6831] NA NA NA 1.7191668 NA #> [6836] 1.9510572 NA NA NA 0.3967183 #> [6841] NA NA NA NA NA #> [6846] 1.0216656 NA 3.4807718 12.6569872 NA #> [6851] 1.2336719 11.7144327 0.6784623 NA NA #> [6856] NA NA NA NA NA #> [6861] NA NA NA NA NA #> [6866] NA NA NA 1.0983104 0.8703533 #> [6871] NA NA NA 0.9070129 NA #> [6876] NA NA NA 2.6424198 NA #> [6881] NA NA NA NA NA #> [6886] NA NA NA NA NA #> [6891] NA NA NA NA NA #> [6896] NA NA NA NA NA #> [6901] NA NA NA 1.1471686 NA #> [6906] 0.9019348 NA NA NA NA #> [6911] NA 2.5049481 11.4490557 NA 0.5566154 #> [6916] NA NA NA NA NA #> [6921] NA NA NA NA NA #> [6926] NA 1.9753987 NA NA NA #> [6931] NA NA 2.3320930 3.7091351 2.4257834 #> [6936] NA NA NA 0.7362632 NA #> [6941] NA NA NA 0.8419358 NA #> [6946] 3.9386895 NA NA NA NA #> [6951] 0.9128963 NA NA NA NA #> [6956] NA NA NA NA 1.6723500 #> [6961] NA NA NA NA NA #> [6966] 1.3298150 NA NA NA NA #> [6971] NA NA NA NA NA #> [6976] NA NA NA NA NA #> [6981] NA NA NA NA NA #> [6986] 0.6335756 NA NA NA NA #> [6991] NA NA NA NA NA #> [6996] NA NA NA NA 0.6562991 #> [7001] NA NA NA 3.2722898 NA #> [7006] NA NA NA NA NA #> [7011] 2.3044112 NA NA NA NA #> [7016] NA 1.4757828 NA NA NA #> [7021] NA NA NA NA NA #> [7026] NA NA NA NA 8.4148054 #> [7031] NA 0.3076566 1.2632453 0.8317384 6.0139632 #> [7036] 2.7857358 NA 1.4718702 NA NA #> [7041] NA 2.8902125 NA NA NA #> [7046] 3.4636676 NA NA NA NA #> [7051] NA NA NA NA NA #> [7056] 2.9858587 NA NA 1.1537194 6.6131492 #> [7061] NA NA NA NA NA #> [7066] 0.2267639 0.5474497 0.4946014 NA NA #> [7071] NA 1.2936714 NA NA NA #> [7076] NA NA NA NA NA #> [7081] NA NA NA NA NA #> [7086] NA NA NA NA NA #> [7091] NA NA NA NA NA #> [7096] NA NA NA NA NA #> [7101] NA NA NA NA 1.6368855 #> [7106] 0.9594902 1.4098917 NA NA NA #> [7111] NA NA 0.7878828 NA NA #> [7116] NA NA NA 0.6673341 NA #> [7121] NA NA NA 3.1816411 NA #> [7126] NA NA NA NA NA #> [7131] NA NA 1.2840652 NA 2.6560736 #> [7136] 19.9554462 NA NA NA NA #> [7141] NA NA NA NA NA #> [7146] NA NA NA 1.0239617 NA #> [7151] 1.8550906 2.3586714 NA NA NA #> [7156] NA NA NA NA NA #> [7161] NA NA NA NA NA #> [7166] NA NA NA 0.4221451 NA #> [7171] NA NA NA NA NA #> [7176] NA NA NA NA NA #> [7181] NA NA NA NA NA #> [7186] NA NA NA 2.8507216 3.4885705 #> [7191] 7.3413062 NA NA NA NA #> [7196] NA NA NA NA NA #> [7201] NA NA 35.7378654 NA 1.4843854 #> [7206] 0.8229836 NA 1.9679027 NA NA #> [7211] NA NA NA NA NA #> [7216] NA NA NA NA NA #> [7221] NA NA NA NA NA #> [7226] NA NA NA NA NA #> [7231] 0.9418428 NA 2.5392017 NA NA #> [7236] NA NA NA NA NA #> [7241] NA NA NA NA NA #> [7246] NA NA NA NA NA #> [7251] NA NA NA NA NA #> [7256] 0.9196062 NA NA NA 4.2101269 #> [7261] NA NA NA 0.8723121 NA #> [7266] 1.1009536 NA 2.2867596 5.5058069 NA #> [7271] NA NA NA NA NA #> [7276] NA NA 1.2713206 NA NA #> [7281] NA NA NA NA NA #> [7286] NA 2.4941492 NA NA NA #> [7291] NA NA NA NA NA #> [7296] NA NA 1.5185130 2.7117639 NA #> [7301] NA NA NA NA NA #> [7306] NA NA NA NA NA #> [7311] NA NA NA NA NA #> [7316] NA 4.5919437 5.1406364 NA 2.8025935 #> [7321] 5.8709002 13.7791338 14.5640020 4.8297606 7.8658409 #> [7326] 6.8229294 27.7137413 NA 5.3379407 14.4617805 #> [7331] 4.4964433 16.1921463 10.2128115 4.2068844 10.3527794 #> [7336] 30.8382893 NA 6.8301725 9.5161114 46.6889000 #> [7341] 5.9609809 13.2284927 7.8532238 36.7056198 8.2213917 #> [7346] NA 7.4940300 11.8976650 13.4008360 19.2198009 #> [7351] 2.2085142 16.2607841 27.6975002 84.5502777 NA #> [7356] 8.9375477 17.9089260 15.0652647 9.7659874 20.4718914 #> [7361] 10.5261488 102.4522476 17.9931507 NA 11.4199753 #> [7366] 19.1676826 17.0927010 24.3487606 6.6103988 8.1302404 #> [7371] 9.6394157 30.0782166 NA 10.6189022 3.9972832 #> [7376] 13.7391968 28.9560966 6.7734051 8.2172832 10.3078299 #> [7381] 20.1655922 NA 18.3504696 2.8396056 27.5377102 #> [7386] 4.3330150 4.9756093 8.2070942 2.5828452 7.6423254 #> [7391] NA 7.4956326 3.3020027 8.2716713 10.5372095 #> [7396] 5.9630933 5.2237558 9.0436430 7.9005804 NA #> [7401] 4.6265149 4.5348096 14.0217648 11.7508678 5.1471868 #> [7406] 11.1270819 7.9933724 12.3714352 NA NA #> [7411] 9.6415024 1.0363822 2.1618273 2.2038519 16.1064682 #> [7416] 6.1964874 5.3220701 NA 1.6039859 98.4771194 #> [7421] 4.0282149 2.6477625 16.8007278 3.5877471 2.6565950 #> [7426] 5.3537140 NA 39.1409950 3.9032741 51.0578613 #> [7431] 14.7823324 NA 23.7130947 41.8512573 27.0040703 #> [7436] 8.8542757 40.3777084 36.5384369 6.2642756 10.2587223 #> [7441] NA 25.8907166 44.1283989 16.7547779 1.5664260 #> [7446] 36.2730598 45.0348854 5.4926982 9.8852091 NA #> [7451] 38.9618721 45.9797630 NA 3.3837142 NA #> [7456] 1.5297805 2.0968738 NA 4.4807029 NA #> [7461] NA NA 0.6716859 NA 4.6078916 #> [7466] 2.3965619 0.9893416 NA NA 1.2310627 #> [7471] NA 5.1445694 1.9888287 NA 0.6328241 #> [7476] 0.5137627 NA 5.9770460 0.9208446 NA #> [7481] NA 1.4403317 NA NA NA #> [7486] 4.3081975 0.9803630 0.8477652 0.4548255 11.3158970 #> [7491] 1.3294666 NA NA NA 1.6702332 #> [7496] NA 4.7679958 0.8518687 1.8222345 2.7682319 #> [7501] NA NA NA NA NA #> [7506] NA NA NA NA NA #> [7511] NA NA NA 4.0749702 NA #> [7516] 0.4489682 NA NA NA NA #> [7521] NA NA NA NA NA #> [7526] NA NA NA NA NA #> [7531] NA NA NA 0.6329405 1.6010697 #> [7536] NA NA NA NA NA #> [7541] NA NA NA NA NA #> [7546] NA NA NA NA NA #> [7551] 0.1622699 0.8471114 NA 0.4407594 NA #> [7556] NA NA NA NA NA #> [7561] NA NA NA NA NA #> [7566] 1.1682943 NA 1.4405993 NA 2.0458810 #> [7571] 6.8692994 NA NA NA 2.7137775 #> [7576] NA 1.1100407 NA NA NA #> [7581] NA NA NA NA NA #> [7586] NA NA NA NA NA #> [7591] 0.3899231 NA NA NA NA #> [7596] NA NA NA NA NA #> [7601] NA NA ## We can replace the precursor intensity values of the originating ## object: sps_dda$precursorIntensity <- pi sps_dda |> filterMsLevel(2L) |> precursorIntensity() #> [1] 0.2562894 0.6533012 NA 0.9115737 2.0881963 #> [6] 0.4161463 1.6393325 1.9403350 0.2138104 2.2869656 #> [11] 0.3581794 1.2965702 7.1932635 1.7952728 1.7991002 #> [16] 4.6187558 2.3082116 2.1572299 7.6883049 0.6671617 #> [21] 1.3682123 1.7227559 0.8182324 1.3030148 0.4186687 #> [26] 0.4893252 NA NA 0.6470237 NA #> [31] 1.2660308 0.3448766 1.0501561 1.0818608 0.1523102 #> [36] 1.6358998 1.0994979 2.0477426 0.9073558 0.5244763 #> [41] 2.2316427 2.6152663 1.7466167 1.7643924 1.0328368 #> [46] 2.0097375 0.3149102 0.5953222 0.8350294 1.0704968 #> [51] 1.3077880 1.5747164 0.3147899 0.4084390 0.4539037 #> [56] 0.9779218 2.4162381 6.3833795 2.8862731 1.2910393 #> [61] 10.6581869 1.4951602 3.7959058 2.8722730 2.4529448 #> [66] 5.3233647 3.5772564 4.4303422 2.9447591 2.1176453 #> [71] 5.0967083 3.3420610 2.4258153 0.8650878 7.3779054 #> [76] 6.8362355 2.1940181 0.7469152 2.0079441 6.3011317 #> [81] 10.4023485 3.3065796 2.3813672 1.3428380 4.0137057 #> [86] 1.4098256 2.4288177 1.3962808 7.4319925 20.5047512 #> [91] 0.9047846 1.3858606 2.8306339 3.7321482 2.8828564 #> [96] 5.5602937 115.1193542 2.0473588 4.9510341 118.5648346 #> [101] 2.0066054 2.9266124 2.4156189 4.2713437 NA #> [106] 0.2551613 2.6899714 5.8423100 11.0782356 0.8772338 #> [111] 2.3091309 3.4256361 3.7716985 1.5463245 1.8332181 #> [116] 1.1230040 3.6158812 1.1808953 1.2916937 3.6537952 #> [121] 1.9253193 6.6556292 2.8096755 0.4722714 1.5738993 #> [126] 3.1981614 2.3436296 1.1402670 4.2488189 5.5579276 #> [131] 1.3360999 1.4311922 165.9235382 1.0471303 2.2803576 #> [136] 2.3772638 1.4516939 2.6042576 1.4513292 110.1937103 #> [141] 1.6985731 7.4143949 2.9037418 4.3727541 2.5551207 #> [146] 3.4643288 3.0462031 5.5572038 5.8211880 3.4240117 #> [151] 3.9230976 326.0313110 2.8209546 4.4502177 45.2657852 #> [156] 2.6507335 2.4535000 5.7406173 5.1763091 1.5400567 #> [161] 1.0795214 1.5230681 3.4662752 4.3179688 0.7036181 #> [166] 3.9843678 3.7730997 0.8382843 0.5566598 0.8787179 #> [171] 0.4405660 2.2968674 0.4199017 NA 0.9166892 #> [176] 3.8255417 0.5752081 0.5180702 1.5857564 1.6556677 #> [181] 0.5855740 1.0657172 0.4307829 1.3963100 2.4678311 #> [186] 0.9768236 1.0707787 0.8175089 1.4743868 NA #> [191] NA 5.0737371 0.5766439 1.4214748 0.2014372 #> [196] 2.2585330 0.7659990 0.6345024 1.1232179 1.2145635 #> [201] 10.4214382 1.5072360 1.6478479 2.0655625 0.5699065 #> [206] 1.0214655 0.6936538 2.5300288 0.5699503 0.4178057 #> [211] 2.3085105 7.4867916 2.4417286 3.0711961 2.6359253 #> [216] 1.0029373 0.3156207 3.3271339 0.7859326 0.9116367 #> [221] 2.2751508 3.6905310 1.7462349 0.6127930 0.6677385 #> [226] 0.3307993 2.4790754 0.9691072 3.0772917 0.3885723 #> [231] 0.3215049 1.6329483 4.4057989 0.4121964 0.8756598 #> [236] 1.1511103 1.2199212 2.9056976 0.9633790 1.1713226 #> [241] 2.6179757 7.3096509 4.6009355 0.6218465 4.1894031 #> [246] 10.0505095 12.7552290 10.4093504 2.2360206 1.2496341 #> [251] 0.4214600 1.4234974 5.9685678 1.4870299 6.5259218 #> [256] 10.9112473 3.0024679 5.5636888 1.0834279 6.3247514 #> [261] 8.4820938 1.0724249 1.7462807 0.2578186 2.8363187 #> [266] 2.7652164 9.1981554 2.7739875 27.5907974 3.4431446 #> [271] 7.6219230 7.2448454 0.9365459 1.4254460 1.9484344 #> [276] 25.4685478 3.3151047 5.4201798 1.0591918 NA #> [281] 2.2389860 7.2797980 177.9112701 712.0562744 1.9180223 #> [286] 1.0850360 15.4796858 2.2603140 1.6407841 3.5157232 #> [291] 1.3970622 2.8673556 4.1254120 2.8693426 4.2749281 #> [296] 0.8203884 2.7943869 3.3467057 3.0753074 2.7253366 #> [301] 2.1626289 5.0227842 2.3628030 1.2205384 0.8150464 #> [306] 3.2100937 4247.9296875 NA 4877.1162109 1.7616867 #> [311] 1.8174063 0.7508621 3.5258093 2.7256949 2.5574954 #> [316] 1.5129316 0.6094913 2.6934810 0.9192376 1.3823618 #> [321] 111.0667496 0.6147639 1.4611453 0.7056657 0.4673733 #> [326] 0.5605560 1.7962961 0.7591861 0.6475862 1.0416414 #> [331] 13.4244280 0.8334653 1.4189600 0.8297019 2.9611456 #> [336] 1.5615076 NA 1.4051919 NA 0.9027803 #> [341] NA 3.6805460 145.7117004 0.3470792 1.5938562 #> [346] 1.4932191 4.3753552 0.6481672 2.1519599 1.0128362 #> [351] 0.6915093 1.9947214 NA 0.2430045 2.9182062 #> [356] 0.6795040 1.6664841 2.3586757 0.8883650 3.2617228 #> [361] 2.8392348 1.6086547 0.6026787 1.2004064 1.3173006 #> [366] 3.6571672 2.2624974 0.9398944 3.5710230 1.0233446 #> [371] 1.3720112 1.0055754 0.5655854 1.5054272 1.0397023 #> [376] 3.3238027 2.1077371 2.7032313 3.8104489 2.8180630 #> [381] 7.8234811 4.9062996 1.3160198 1.0076615 1.0950712 #> [386] 3.9908450 4.2435541 0.7174511 5.2825084 0.8802158 #> [391] 0.3888731 0.7251250 1.0856016 0.5659533 0.4917859 #> [396] 0.4981284 0.9569623 0.7542380 1.5303959 2.5028656 #> [401] 1.2001288 1.7258205 0.5163053 1.1474305 2.1486368 #> [406] 2.4524887 3.0907106 3.9163256 6.1858454 6.0148554 #> [411] 3.3022101 6.8535738 0.9091500 5.3752904 2.6620142 #> [416] 14.2303267 0.3268394 3.2703023 3.7256567 3.4891803 #> [421] 6.1556778 1.2317547 3.0012579 6.3596826 0.6037928 #> [426] 0.5698133 3.7267346 10.2576380 0.8706866 4.9864445 #> [431] 4.3741260 1.0901091 10.9061537 4.1417003 0.5189514 #> [436] 8.2503548 2.2269182 NA 0.3962348 0.3956501 #> [441] 2.1887872 1.7824746 3.7205944 3.6917150 0.7435969 #> [446] 9.6342754 24.0429783 1.5591800 1.9394968 3.0097637 #> [451] 5.7848148 9.7665796 2.0749505 0.4870613 2.6161067 #> [456] 0.6431220 1.2651863 3.6852174 1.1431226 21.9405651 #> [461] 1.2046832 1.8209703 0.5066832 0.9095992 9.7609291 #> [466] 3.3460293 0.4121834 0.9202868 0.6617500 2.0171058 #> [471] 1.1644038 2.6082158 3.6380553 0.8339515 1.4020016 #> [476] 7.2250385 0.7268345 0.7294782 0.9507068 2.5481384 #> [481] 3.6101770 0.6119207 5.6888528 16.1643982 2.6750910 #> [486] 4.8989611 0.4897856 15.6936617 3.9424517 1.3334647 #> [491] 0.4453856 3.3320382 7.2846007 3.1082804 3.1209931 #> [496] 9.3145094 0.8143211 1.1926577 0.6434940 0.6482291 #> [501] 2.3913691 2.1481240 2.7833135 4.5657282 5.3265414 #> [506] 10.3909426 15.4557104 0.6454072 43.3171730 1.4262301 #> [511] 2.5555761 1.7280343 2.7765193 1.3546977 1.9755590 #> [516] 1.4631903 1.5031183 1.5941623 1.5892071 5.8746567 #> [521] 2.2622027 2.5123510 5.3907886 5.1953430 3.1958568 #> [526] 3.0968442 4.0582609 3.2192631 2.5363874 4.4969444 #> [531] 5.3325839 2.3695500 3.0062342 5.6627531 6.4923205 #> [536] 4.7920384 4.5700383 4.0006895 9.5566549 5.8871794 #> [541] 7.4422898 5.2004848 9.2628069 784.9196167 4.6816382 #> [546] 4.1257901 6.6807156 4.1821823 6.8080244 7.7087774 #> [551] 12.4988031 1.4474308 985.7752686 5.5145364 2.7746949 #> [556] 2.3561726 3.7145381 6.2821894 10.4331989 1.7673082 #> [561] 3.1912456 7.3891306 1.3537637 0.2704858 4.0082321 #> [566] 8.5943022 1.3064193 3.6371551 2.5390623 NA #> [571] 0.7411902 0.5046070 0.5680771 1.2300223 2.8467999 #> [576] 2.6166818 0.5497193 16.0667572 1.9547974 0.9511589 #> [581] 15.4262342 2.4667881 1.0057802 2.2017863 3.7578349 #> [586] 5.2645087 0.7512842 2.5041356 1.8741575 11.7041502 #> [591] 22.0120201 3.6391535 2.4130566 NA 1.3888769 #> [596] 1.4703723 1.5291082 2.3573880 0.6399383 1.6180218 #> [601] 2.6052721 1237.6204834 19.8997154 39.6545715 4069.6533203 #> [606] 3.8779757 2.9248793 14.3836384 38.9334831 4267.4248047 #> [611] 6.9302726 5.0617962 4.1785703 28.3963814 6.4566789 #> [616] 3.4296451 3.7816880 11.0247078 27.2765732 2.2371943 #> [621] 0.9170940 0.7460240 0.8210835 1.6487689 9.5727634 #> [626] 1.6570802 NA 0.8196399 0.8946962 13.3170853 #> [631] 28.8410645 1.4570224 0.2454604 0.6586674 1.0929065 #> [636] 1.2879230 NA 2.9674864 0.5844296 11.5823431 #> [641] NA 2.6197197 0.6617230 1.0072753 1.0431374 #> [646] 1.7980380 1.8940541 4.3480368 2.6686113 NA #> [651] 2.4794784 4.1561966 1.2986863 1.2777241 3.0134482 #> [656] 101.8303833 3.4352007 3.0277224 13.1016092 0.5244251 #> [661] 1.7064619 0.3486639 50.7429390 1.7649055 2.7503626 #> [666] 0.3800137 3.3221421 3.1534879 15.4715948 1.4704005 #> [671] 1.8855512 4.0389700 1.0823137 2.6767426 2.1071370 #> [676] 3.6332088 0.6826217 1.0185049 3.3197520 3.8973808 #> [681] 6.3822713 5.1280479 8.5763950 3.2864881 1.3272406 #> [686] 3.2673051 5.7568297 8.3966360 16.3681469 7.2476711 #> [691] 5.4942021 2.1211190 1.5519290 3.6947889 3.6529276 #> [696] 7.1617284 23.2306347 20.4122696 17.6928806 5.1081491 #> [701] 117.3710403 2.7161827 48.0717468 18.4067097 3.7467299 #> [706] 3.6180439 15.2693739 4.7089896 2.5892634 9.7226076 #> [711] 139.4568787 7.4229794 11.8008423 44.5208054 10.5249119 #> [716] 5.9375591 20.7310448 216.7257538 12.0509796 32.5807915 #> [721] 140.1287079 18.1983509 7.9473476 4.0145078 NA #> [726] 5.9600363 4.9861374 40.1272926 16.1208572 13.0407543 #> [731] 6.8589644 4.9722199 11.0004854 7.2423544 6.4803615 #> [736] 14.1402922 23.9029579 15.6984034 17.9236164 3.2453372 #> [741] 9.5185261 8.6210403 3.0081079 3.5888493 6.0433631 #> [746] 7.4204693 11.3490496 3.6138747 1.7851294 4.3751335 #> [751] 38.7952423 25.8243275 20.6631317 2.3311818 701.8855591 #> [756] 333.9076538 5.9194384 5.2374392 50.5938759 6.6050563 #> [761] 29.6740894 6.8099937 729.9282227 4.7258272 377.9533081 #> [766] 3.7225027 5.8937206 8.3230190 8.7469826 1.2891947 #> [771] 2.5859647 75.5915375 4.7863827 45.3149376 2.4862499 #> [776] 6.5945859 6.9634075 35.3314667 3.0827610 86.5234299 #> [781] 1061.5833740 3.1925797 39.1028519 5.1561656 727.2340088 #> [786] 4.6954513 4.7806416 2.0299914 67.0260162 NA #> [791] 8.1010742 1.6631573 1.8530455 79.0636978 30.3669281 #> [796] 0.8927791 10.3849897 1.0268044 3.1952302 0.7755960 #> [801] 5.7425203 7.2843447 1.2209314 1.8280462 7.8098340 #> [806] 3.8438480 1.6488374 1.9727218 21.7567501 0.7352579 #> [811] 1.9201657 52.0057869 127.3143768 5.6821346 2.5211284 #> [816] 2.3330369 2.1601825 9.7243500 9.3593960 2.9505100 #> [821] 5.4880805 8.6688786 2.6024387 11.9668989 2.1561337 #> [826] 12.3195581 1.2745084 1.9595144 5.3821392 19.5642281 #> [831] 16.0015182 3.0178616 4.6744413 21.4054432 2.3722150 #> [836] 17.8877811 7.6304569 36.1747169 4.2541361 33.9568787 #> [841] 6.3856707 2.6096203 13.1905775 2.4566786 47.8784180 #> [846] 6.1847539 46.1483879 3.2702918 3.5770297 12.7957163 #> [851] 5.9115996 4.5292888 5.1561074 4.0170932 3.9871593 #> [856] 5.1863651 1.8988326 7.9102783 5.5774412 2934.2749023 #> [861] 1.7749847 8.5469313 16.3584347 10.1700211 0.2661873 #> [866] 6.4565039 8.4741077 0.1989040 0.4645469 1.7402502 #> [871] 29.9008598 0.5417653 0.7619571 2.3052864 23.7764740 #> [876] 3.5269954 6.3716865 4.5834875 0.6944337 9.3756256 #> [881] 0.4391756 0.4102839 NA 0.4088447 4.4651365 #> [886] 2.3560781 0.8629871 1.7296497 2.3054824 0.4738956 #> [891] 0.8453057 0.6674856 2.9770677 0.9882508 2.5485382 #> [896] 1.3252913 0.9046306 3.3730309 1.3325157 0.8287238 #> [901] 3.2393219 2.8408599 1.1969875 4.9852405 16.4274426 #> [906] 0.7676155 5.0130310 2.2948136 2.0398157 1.0926311 #> [911] 1.6752559 2.0661981 0.7237425 4.8128242 11.1487827 #> [916] 0.8632420 1.8443307 0.4144078 1.5147480 2.7527251 #> [921] 13.0752268 1.8903236 7.9921408 1.5463461 0.8109860 #> [926] 1.0667026 1.1346698 3.6560605 3.3797889 3.5629609 #> [931] 3.4544880 4.5592079 16.6013031 4.6765566 1.6968081 #> [936] 1.1385404 1.4192655 2.8486712 2.6313102 0.6307487 #> [941] 2.3814776 2.7711914 0.7061450 4.9312925 1.1609619 #> [946] 6.7711430 2.8384895 3.6513107 3.9373784 5.0244951 #> [951] 9.3638000 17.6887131 8.8094635 4.6279211 1.6137590 #> [956] 0.6182525 0.8786079 15.0547085 24.5552330 7.9792995 #> [961] 64.7950058 97.0138016 9.9027309 0.5985516 1.5779028 #> [966] 11.9724445 1.9544525 163.6211090 2.1614091 8.1083727 #> [971] 2.6397953 3.5538256 7.1930056 0.6664237 442.5400391 #> [976] 3.0430346 6.4073930 5.0266309 5.8590345 19.6998043 #> [981] 4.3898072 1.1305788 13.5925970 7.2308283 1.1136869 #> [986] 1.3520640 1.6164834 1.0973755 2.0894964 9.5560360 #> [991] NA 8.9295197 779.4788818 2.5705523 809.9169312 #> [996] 3.0098879 94.3604507 8.8758574 3.4457500 4.9686089 #> [1001] 1.5195554 2.1578839 4.8023272 2.1327522 0.3200580 #> [1006] 12.4226055 12.1050863 1096.2231445 1066.9301758 129.4904938 #> [1011] 4.5963664 3.0736189 8.0031509 3.2705626 0.3757358 #> [1016] 15.2121391 2.8834486 15.9752741 1346.7353516 2.6217887 #> [1021] 1228.9621582 5.0895567 2.1218104 184.3674316 4.2164469 #> [1026] 2.8267379 6.7104831 3.8288674 3.0664554 4.4310689 #> [1031] 2268.6291504 1836.1269531 2.0746028 2.2918937 10.7542877 #> [1036] 51.3735046 6.6448908 6.1085730 1.4560728 2.8452797 #> [1041] 3.7901433 2.0456872 1.9614782 5.3406096 6.5233908 #> [1046] 5.8153443 4.9779243 5.2980742 1.9569403 3.0366473 #> [1051] 0.8441148 0.7282568 0.6270677 1.9153599 2.5157802 #> [1056] 2.5211849 1.3664742 16.0325813 1.9972137 1.1040767 #> [1061] 0.9441139 0.9234766 2.2210290 0.8783525 2.1501570 #> [1066] 8.6357822 NA 1.6162349 1.9563223 1.2261102 #> [1071] 5.9679408 2.4582469 3.3074541 0.6635520 3.4940929 #> [1076] 2.6760423 1.0429727 0.5086066 1.0268028 3.8812792 #> [1081] 3.5886321 3.9809752 7.7894588 0.8405986 1.1336366 #> [1086] 2.8971629 0.7070799 0.7151046 0.5353748 1.3802744 #> [1091] 4.1309824 4.8025975 8.7120161 2.2102430 10.5090933 #> [1096] 10.4218655 22.3232746 36.9990120 2.9090240 2.3153019 #> [1101] 76.6485138 2.9318345 1.6010859 5.8318458 2.6627228 #> [1106] 6.4075303 2.0914986 11.3002634 1.0663972 9.0038490 #> [1111] 7.7891731 1.4418688 4.8872490 13.7815018 7.2834721 #> [1116] 0.6722869 12.7788944 14.1886673 6.0767541 17.2682152 #> [1121] 5.8392038 3.2879653 25.1995487 27.0342846 11.1438723 #> [1126] 38.4615974 10.6467648 20.4387722 3.0112209 1.9950336 #> [1131] 10.1919136 1.5909361 4.7708578 1141.7640381 9.8121815 #> [1136] 22.5490570 3.3931487 9.8001604 4.6790090 1271.7685547 #> [1141] 2.8506472 1103.0401611 17.5955009 5.1776738 2.9927020 #> [1146] 2.1627703 3.1698050 NA 13.8667717 1411.4106445 #> [1151] 1272.9426270 21.3413105 0.8185354 2.8377655 2.0303440 #> [1156] 21.7762794 1345.3233643 1350.6333008 6.6278219 29.8857651 #> [1161] 52.9047775 1294.8477783 12.9526482 9.6068335 17.7135353 #> [1166] NA 2.6911139 3.7828991 0.7059131 5.9516506 #> [1171] 4.0300317 2.7630870 5.6403260 7.4636693 2.0741365 #> [1176] 5.1799192 6.4390368 9.8243055 1.5092793 4.3210769 #> [1181] 1.7446249 3.4029963 2283.2792969 3.9234891 6.9994988 #> [1186] 4.1006012 0.6282611 1.8591487 4.4599166 2.1398880 #> [1191] 2337.1853027 4.3932910 9.6464186 12.7156582 0.9086848 #> [1196] 9.3874264 3.2540348 2646.2402344 6.6778555 3.9801006 #> [1201] 21.6677666 1.3727722 2.5189867 7.1042595 10.0052004 #> [1206] 1.5813689 23.2121410 2.8682461 1.3422523 0.7672858 #> [1211] 0.6866859 3.6084216 18.3351460 0.8394666 1.9887234 #> [1216] 1.5026515 1.3683980 5.7951837 9.8654814 2.1221330 #> [1221] 2.1047983 3.0744431 1.9053514 2.6970651 2.0816550 #> [1226] 1.9742609 9.6418734 7.6057978 3.4838214 8.8084707 #> [1231] 6.6040335 3.2611005 9.0701380 3.0636346 1.7033354 #> [1236] 12.7065725 1.9277512 11.4872437 12.6639729 1.8488846 #> [1241] 4.4552321 4.2770810 9.8547640 3.8485291 2.1161973 #> [1246] 2.0724041 6.0630097 2.5432432 29.9757633 3.4243822 #> [1251] 1.5343714 7.8658175 1.2879468 6.8999977 6.3626080 #> [1256] 268.5536194 5.7748380 NA 5.2410469 2.0550699 #> [1261] 0.4435597 5.4935684 0.9196581 75.9311295 3.3142908 #> [1266] 80.4429626 5.9293828 2.2810714 2.8269784 20.1030636 #> [1271] 1.1432312 3.6678035 1.0070125 3.5375540 2.9908266 #> [1276] 22.7290974 2.3943624 0.9211383 1.9665295 0.8259042 #> [1281] 0.4845653 25.3855438 3.8617392 6.6030455 18.8038082 #> [1286] NA 0.5806934 3.3330538 101.8569031 14.4165783 #> [1291] 1.7161655 7.3081284 2.1098645 0.8144141 1.3382024 #> [1296] 1.4885535 0.8770674 0.6791099 1.6695246 1.2673935 #> [1301] 0.6891360 1.2439822 5.2793922 1.2573010 NA #> [1306] 3.7120969 4.9950824 11.5787373 1.9612808 10.3544693 #> [1311] 6.0420938 18.6085644 1.5667670 1.2138346 30.0845642 #> [1316] 19.6141224 3.2639980 3.6546156 29.6098766 2.8610103 #> [1321] 6.0040512 1.8776323 3.8169975 4.7191100 1.0195367 #> [1326] 3.8605018 8.1590776 2.8668685 12.0980616 5.0243416 #> [1331] 7.0915346 2.7560163 6.1319265 5.5243936 46.6120872 #> [1336] 24.7890339 6.4685655 9.1421661 10.3797007 10.7507782 #> [1341] 7.7589669 12.2742815 4.6532531 5.1379547 23.7994213 #> [1346] 29.3476200 4.0036497 7.5182543 11.9706621 63.0551071 #> [1351] 5.1469116 8.4730129 72.0657578 10.1063595 65.6397705 #> [1356] 4.1467509 13.0881023 27.2654285 96.3133926 108.4684830 #> [1361] 15.9769907 16.9430561 14.3318129 4.6791883 126.8739243 #> [1366] 6.6298981 18.2740936 28.1178570 8.4018116 24.9042740 #> [1371] 22.9308643 5.7845116 2804.5610352 6.1323233 7.0216298 #> [1376] 34.0006905 11.0745640 23.1465626 26.1845646 15.7390766 #> [1381] 6.2733459 11.7022743 4.5109916 3.0380044 72.1676025 #> [1386] 18.0594807 16.0637493 8.0370464 176.6657867 2181.4362793 #> [1391] 9.6984138 3978.9870605 8.6989155 11.3172474 39.0961494 #> [1396] 2588.9499512 3505.7983398 144.8855133 5.1680942 30.6885090 #> [1401] 6.6054115 5.6432614 2.7389083 53.9481773 62.0971260 #> [1406] 2972.6391602 161.4343109 35.4546394 11.2379074 13.3652372 #> [1411] 15.0986557 20.7111149 9.2977657 425.2767639 216.2778320 #> [1416] 7.9142838 5.0309882 1.0399815 1.0769179 4.5379925 #> [1421] 3.6899538 2.2575519 17.9379234 22.7302589 6.5185528 #> [1426] 19.6637669 0.2854209 7.1664414 9.3295479 1.1119181 #> [1431] 1.1998634 44.4294777 6.0005445 1.2984159 0.4181677 #> [1436] 1.3962787 0.8486760 0.6826237 1.3289268 41.6967010 #> [1441] 1.6696991 0.8142897 0.3997326 64.2423019 4.2105532 #> [1446] 8.1320543 0.8433636 21.3994884 0.6499675 1.6173933 #> [1451] 2.2819724 79.2927475 2.7942066 0.6122881 5.6340408 #> [1456] 2.3877366 2.5358839 1.6963638 2.8207321 1.6094570 #> [1461] 3.0496490 5.2695556 0.7497861 1.1942160 2.8949137 #> [1466] 1.8337013 7.7278204 3.0212984 4.6463079 1.1313710 #> [1471] 3.0398493 1.1938435 0.5559963 3.7946312 0.7459199 #> [1476] 2.6556878 4.8397417 2.1508582 4.1808691 1.3044889 #> [1481] 3.6563311 5.6848607 4.3057156 4.3253880 44.0154037 #> [1486] 6.8031969 1.0149941 16.5446339 50.2134972 1.4178553 #> [1491] 5.2461462 6.6964250 1.3668361 7.0547361 15.4979038 #> [1496] 2.5466137 12.0476017 16.9358387 4.2765665 3.0282452 #> [1501] 2.0438735 3.0750351 30.2993698 4.1311669 10.5620518 #> [1506] 6.3157725 2.0541127 6.4616790 52.7001801 6.5350013 #> [1511] 2.7538323 5.5697684 7.0785255 0.7346154 4.6684666 #> [1516] 2.3665750 2.1643167 13.1310358 11.3682957 1.0712550 #> [1521] 12.9957743 1371.8287354 1.3735292 4.6520715 20.4687824 #> [1526] 14.5587559 1770.5562744 2.6400170 15.1324883 1.9400562 #> [1531] 4.7408748 2.0517797 32.1368103 0.9072015 1766.3382568 #> [1536] 11.0576754 2.3649356 7.1545792 5.3592334 29.8745804 #> [1541] 99.2443008 1.9519557 3.5576828 5.4862013 19.1255341 #> [1546] 1.0205218 74.6288681 2.6257737 3.8454990 0.9508846 #> [1551] 15.9569130 3.9706428 6.0614076 0.9358777 0.4645265 #> [1556] 1.3660873 2.9063818 6.6953201 1.7190092 0.9622721 #> [1561] 1.7018661 11.3596716 3.0443096 0.6346511 10.0340395 #> [1566] 0.8095649 0.9709995 3.2444031 0.5028589 2.7934396 #> [1571] 6.8828177 0.5587204 1.6042945 1.3587892 0.8313419 #> [1576] 2.4558291 1.7974735 3.6726115 5.6037540 6.7877126 #> [1581] 3.6458204 0.8579472 8.0946331 12.1906815 1.5101539 #> [1586] 6.0351577 11.0641689 17.6339569 3.6026669 16.1998940 #> [1591] 2.8316128 4.9478583 27.5424156 7.0986490 3.9904847 #> [1596] 4.6039705 3.3738575 12.1051941 11.3188763 14.8368187 #> [1601] 9.5498314 1.9773377 13.8263979 23.9170589 13.4375019 #> [1606] 9.8440132 11.2628098 2.5026691 22.5849972 29.0189171 #> [1611] 18.8118534 22.0679207 4.0647068 2.0535538 1.5048116 #> [1616] 3.3824587 2.3311884 32.8195572 37.0816650 7.0685787 #> [1621] 5.5009451 5.8517952 4.9319654 3.4151902 4.2116370 #> [1626] 8.8043442 1099.1087646 5.3256183 5.2614517 480.0812378 #> [1631] 5.3612590 12.7172546 6.3167968 14.1994934 59.6927795 #> [1636] 964.6279297 1400.3564453 535.6882324 23.6954079 14.5343561 #> [1641] 2.9595783 17.3649712 1.0824900 1221.8245850 147.4770660 #> [1646] 683.7954712 6.1305389 4.9751444 15.9264107 18.4570618 #> [1651] 1083.5487061 191.7899017 875.8353271 577.2622681 71.0305328 #> [1656] 8.1075430 5.3227873 11.6976309 0.4594952 1.4792782 #> [1661] 1.6332765 4.2618947 6.4441838 2.9269114 130.0458374 #> [1666] 5.1534815 3.5288918 2.2328265 7.3872643 35.0871201 #> [1671] 164.8385925 41.0983658 3.6965251 3.6046982 34.9871025 #> [1676] 54.6165199 3.3092432 6.2893038 54.9078522 4.6468277 #> [1681] 5.5542288 52.0769882 7.5430121 11.7523575 32.7870789 #> [1686] 4.3187008 22.1579170 5.4699397 1.8834021 9.8157177 #> [1691] 3.3649621 10.4119244 12.9897251 3.0194745 20.3988075 #> [1696] 9.6839437 1.9245056 27.7328892 4.6774187 2.8958423 #> [1701] 5.1254649 25.3332367 15.3362989 5.6253791 9.0580263 #> [1706] 3.3217881 16.1069527 5.7460155 9.0998583 6.4395881 #> [1711] 27.5900745 11.9862118 10.4788322 4.7713022 7.4465909 #> [1716] 21.6194534 3.4900868 11.9859657 7.1533313 53.6382294 #> [1721] 22.4019108 3.4466097 11.8166838 31.7925739 7.1903763 #> [1726] 22.3436050 21.0166111 11.6625166 9.6446323 11.8060122 #> [1731] 10.7140808 20.5072823 5.8385706 12.4566240 27.2418690 #> [1736] 1374.2124023 5.0976796 8.5298624 8.9547720 14.1582394 #> [1741] 3.6345949 8.9698286 746.4771729 16.0491295 14.2799292 #> [1746] 12.4969416 16.1063213 17.6739025 13.8779955 5.8102989 #> [1751] 4.7912970 8.5829220 7.5092740 16.8982792 8.7955656 #> [1756] 27.1313457 10.5999660 102.9700699 5.2469325 78.4538498 #> [1761] 23.4321194 13.5085144 28.0264759 42.0644264 3.0340507 #> [1766] 16.6190434 1717.7260742 6.9299235 10.5656214 27.8841705 #> [1771] 17.4288807 47.0360756 5.2313685 49.5542450 4.6091428 #> [1776] 7.5845995 5.1649594 5.6527944 6.7112393 7.1952438 #> [1781] 2.8361075 936.4321899 10.8392658 300.9952393 3.7918711 #> [1786] 5.8666444 9.0892420 7.9013219 5.9726405 6.4315825 #> [1791] 6.7033081 174.0914154 9.4583406 13.8090487 25.1833706 #> [1796] 10.3936863 11.1641397 3.6089337 4.3211293 4.5236745 #> [1801] 5.9249415 19.1762638 44.9207954 1162.3734131 9.1217899 #> [1806] 6.2500715 14.8576088 9.4355440 27.3175831 75.4738541 #> [1811] 1927.7430420 10.6061239 2.5857298 5.2106519 16.0033913 #> [1816] 13.5474854 30.9249420 2882.4428711 37.9162636 75.5530014 #> [1821] 6.0951519 4.3891191 10.3061371 6.6429935 39.4176941 #> [1826] 10.0774698 83.8411789 21.2222996 NA 0.6372588 #> [1831] 3.5606251 2.5927734 3.2620273 2.3674390 1.8626410 #> [1836] 6.6079321 2.4800649 6.8728633 2.8025930 10.0381966 #> [1841] 4.8456726 89.1146164 4.3337107 3.8712926 42.9793968 #> [1846] 2.5299530 7.4297533 4.6089058 3.5378845 0.1817949 #> [1851] 1.1290787 1.5784779 1.1125787 2.0033450 NA #> [1856] 1.0376083 1.9011122 2.3181555 1.6446155 0.9089839 #> [1861] 0.4841611 0.6897894 0.7658206 0.6156495 1.4828655 #> [1866] 2.3340645 1.1662629 0.9815852 2.3534944 2.1499813 #> [1871] 0.7019742 0.3516256 3.2850077 5.8242555 NA #> [1876] 1.3007295 1.5015216 0.8093400 3.2225409 2.6426129 #> [1881] 2.3901305 2.9790335 2.9894137 5.2419791 4.8620076 #> [1886] 0.3997991 3.0470288 11.9397249 3.6320026 8.3058691 #> [1891] 1.3834330 4.1316576 3.7130520 3.9005911 16.1633472 #> [1896] 3.6801958 12.0339565 1.1500748 1.2219627 0.5826390 #> [1901] 3.3800447 5.2994637 2.6451149 2.7287869 3.1930273 #> [1906] 1.8436399 2.9893756 4.9069676 5.8526864 1.9956532 #> [1911] 5.7515755 9.3381653 3.7572572 0.4758977 0.5950958 #> [1916] 1.2651656 0.5604061 1.5873302 1.7309831 2.2026825 #> [1921] NA 0.8321332 3.1331923 1.8596388 4.0986276 #> [1926] 1.4462790 5.0948448 3.3446779 14.7490797 4.2720022 #> [1931] 2.3573306 12.4373245 5.4349809 5.5168352 7.1895194 #> [1936] 1.3353804 31.1978798 6.0550547 5.3862381 2.3742425 #> [1941] 1.6283454 3.8663564 2.5557170 3.9340308 4.8355684 #> [1946] 0.8258027 NA 1.6850734 8.2018566 2.8547313 #> [1951] 2.7901099 1.2237481 1.2317826 5.9977107 2.4985216 #> [1956] 5.4254308 10.2619724 3.6585343 0.7505842 1.0290449 #> [1961] 1.4102111 31.6295795 6.0977502 3.3116033 6.6416101 #> [1966] 13.4169693 2.0772371 2.5722609 1.4239205 1.1951129 #> [1971] 19.3541183 6.6528106 7.6534238 3.3320429 3.9984677 #> [1976] 2.1092513 8.5107756 2.7920604 28.8576584 1.6512991 #> [1981] 2.0430546 6.1738434 2.2872250 3.3046799 4.1366568 #> [1986] 2.0184140 3.4700344 2.1820960 9.8032455 9.3485680 #> [1991] 7.2345314 20.3594875 7.5089312 1627.1451416 5.3730831 #> [1996] 8.5319214 12.6467562 6.4055276 5.4178729 3.8174756 #> [2001] 60.1280174 6.4091296 14.2986145 13.2007456 17.6533527 #> [2006] 4.6876645 2218.6071777 5.9873571 5.4104090 13.5144920 #> [2011] 4.3813696 8.5980825 19.0352879 1989.9606934 6.5922198 #> [2016] 8.3580027 5.7576084 341.0995483 3.3168538 9.5687895 #> [2021] 9.9157639 8.6866083 366.3923645 6.9480758 10.2027311 #> [2026] 7.9508238 12.0425510 5.7334862 5.7009211 9.3929729 #> [2031] 4.2744284 16.8116989 3.3318050 61.5876274 3.6692767 #> [2036] 4.6599665 16.0338726 43.3646393 0.4666836 1.1231649 #> [2041] 3.3837605 5.3292937 3.6405241 9.7523746 0.9140767 #> [2046] 0.7435523 0.2535407 5.4856982 15.5203247 3.2470930 #> [2051] 2.7420650 0.6101449 1.0404911 2.7917345 6.6811185 #> [2056] 2.0745556 1.2540616 0.3098164 1.6586421 9.5700045 #> [2061] 0.7319268 12.7017021 0.6637144 1.5885706 0.8827127 #> [2066] 2.1940100 3.7667232 2.0905075 0.6379106 2.9787626 #> [2071] 0.4874143 0.3836070 0.5107485 1.1823709 1.2667042 #> [2076] 19.2034588 1.6550628 1.1661954 0.8966293 3.2779715 #> [2081] 11.0150242 1.6130922 26.5314026 2.5117977 2.3132839 #> [2086] 2.2919271 3.1338563 1.5114740 2.0381725 5.2738991 #> [2091] 2.9814677 3.5173035 2.9813018 1.8998176 7.4101906 #> [2096] 5.3717108 4.2854128 0.2399864 6.4908400 1.6760609 #> [2101] 4.9045634 3.0678418 2.1384492 9.3216219 10.4645767 #> [2106] 0.3764410 1.2218126 1.2995534 9.7801199 2.0047073 #> [2111] 26.3789768 1.0760976 0.9736537 2.0357609 1576.8568115 #> [2116] 1.4469386 3.0481942 1.6708410 0.9496741 2.6938272 #> [2121] 1.8960530 2.1988547 1.2718045 1.2236259 1.4919758 #> [2126] 4.3979073 71.3828812 2.0391872 2.2703087 2.6103971 #> [2131] 1.4898348 1.5168892 0.8818803 1.8848048 0.6037043 #> [2136] 1.8731611 7.1765389 1.9562593 11.7375755 1.6933267 #> [2141] 1.5986614 5.0060325 5.2257977 4.1671195 4.4332304 #> [2146] 6.8677626 2.4653215 6.3500257 10.9838686 6.4111762 #> [2151] 9.4890432 4.7053976 1.8102279 1.4213001 1.6444297 #> [2156] 1.9174886 0.4131429 1.5709261 3.1760740 1.0655589 #> [2161] 919.2457886 1.5643872 1.7901465 1.7823997 6.9229293 #> [2166] 2.2213833 0.8164910 6.7707281 1034.1815186 2.8209743 #> [2171] 0.6380021 1.1908475 2.2225995 NA 1.8188674 #> [2176] 2.1192210 1.1434188 1.2050375 1.7906495 3.5892394 #> [2181] 0.7533023 NA 1.4840194 2.2305763 2.4143374 #> [2186] 1.9114826 1.0137789 4.2369156 2.1006327 2.7787836 #> [2191] 0.9601986 8.1295986 7.2806950 1.1032010 2.3385823 #> [2196] 1.1522059 1.4659723 8.5681458 1.8708251 9.6687212 #> [2201] 5.7849174 NA 2.4449232 1.6775528 4.9673247 #> [2206] 1.8457032 11.6521568 5.6321864 0.9540480 12.1773853 #> [2211] 0.4559720 0.7230437 1.5481060 1.7013626 1.9925474 #> [2216] 4.0501847 1.5732721 2.9336040 1.2153755 2.3473213 #> [2221] 1.6044481 3.8102901 5.9565816 3.5146675 2.6926224 #> [2226] 4.9956584 7.3882804 31.3160343 1.3993325 6.2274776 #> [2231] 2.9698203 3.2010090 1.3510920 5.6216455 3.3691561 #> [2236] 2.7835443 0.4399868 2.5057735 5.0695376 0.6980689 #> [2241] 1.8963152 8.0071716 9.3238049 2.4393957 4.9562755 #> [2246] 2.4916747 1.4161593 1.7179910 2.8897645 2.1166553 #> [2251] 2.5877254 12.7337999 1.2360386 2.1893265 1.5300977 #> [2256] 3.0833626 8.4302454 4.9040179 10.9480925 2.1738741 #> [2261] 3.3114023 6.0667453 NA 0.6554648 3.5936801 #> [2266] 1.5739572 5.1975174 3.9125762 9.3439398 7.9241571 #> [2271] 3.9933949 4.6318932 8.3959627 0.7565725 2.3423707 #> [2276] 15.7967987 12.7200508 3.1725900 11.7995720 0.9761860 #> [2281] 1.1349560 1.9718618 4.9297872 7.0475721 2.8053823 #> [2286] 34.1454964 156.3358002 2.1250823 4.3354549 64.4767151 #> [2291] 278.9322815 0.7963252 3.8422236 61.7775192 190.2516785 #> [2296] 1.4124620 1.3479694 1.6552913 4.4471312 329.0337830 #> [2301] 2.3342044 2.1571195 0.9733863 2.4092717 4.8433948 #> [2306] 2.3092387 360.7164307 3.0873225 1.7288386 2.3073480 #> [2311] 0.5996385 5.3622589 1420.7687988 7.9223099 5.6030631 #> [2316] 0.6277632 0.8355366 0.4711815 1.3496840 0.8089792 #> [2321] 5.8526330 1.8503476 0.6572140 305.6041870 1.4397534 #> [2326] 0.8994330 277.0521240 2.2045338 NA NA #> [2331] 0.5602361 1.2226131 1.3568290 1.7129589 2.0047822 #> [2336] 1.7247094 6.7786064 2.6411271 1.9010485 1.7608452 #> [2341] 4.4309907 3.1676409 3.3830304 4.6565275 3.3298314 #> [2346] 1.5452514 3.5828693 1.7718617 0.8061830 1.2403909 #> [2351] 4.6554375 1.6074916 3.6399906 1.1538744 4.6306715 #> [2356] 22.4013309 4.1293302 6.8009396 32.1985893 9.7335100 #> [2361] 0.5418288 0.5632182 2.9177530 2.1166260 6.6263289 #> [2366] 2.1903484 6.9556012 3.3954957 3.9068611 1.8365928 #> [2371] 3.1866224 6.6193805 5.9870872 2.3148339 31.7243080 #> [2376] 1.7895136 3.5860963 1.8591824 77.3616867 3.4268165 #> [2381] 0.5249496 1.5734435 3.8141046 2.7002668 1096.7601318 #> [2386] 1496.8631592 3.2043941 1.8505754 587.6149292 1741.0694580 #> [2391] 885.2774048 23.7601643 594.6196899 0.4923916 29.5300331 #> [2396] 1.3024459 NA 0.7680741 0.8888112 2.1178827 #> [2401] 1.4857029 1.1276029 1.3496284 2.1555452 2.1827545 #> [2406] 1.2788655 1.2924441 0.9934639 5.3240347 1.0079803 #> [2411] 1.3528888 10.8723679 1.9321351 2.5913424 2.0170100 #> [2416] 2.6124203 25.0653572 0.7242321 2.9123745 1.8755200 #> [2421] 5.4409308 1.6049031 4.8650875 3.9305305 2.3677256 #> [2426] 2.1769772 6.9278378 0.9471752 11.2096748 8.1439409 #> [2431] 7.7992425 8.1538477 7.7033796 15.1453743 31.8052731 #> [2436] 18.0042858 1.2677478 5.5277863 2.1457639 3.4404881 #> [2441] 6.6042099 4.3178186 10.6584396 4.6253743 4.4684582 #> [2446] 9.8839989 0.4913557 4.2288108 2.3422270 220.2428894 #> [2451] 76.3024292 2.4397397 0.7708665 0.5308517 153.5867767 #> [2456] 0.7601256 5.8568654 3.3581190 1.1768376 1.9733516 #> [2461] 8.9577475 1.6991717 0.6544989 0.8063468 0.5237735 #> [2466] 1.2291242 0.4108943 11.5966806 1.5359516 0.5914992 #> [2471] 1.5501552 0.4674177 1.4722780 10.3540297 12.8971653 #> [2476] 76.4729843 3.3384745 8.8360243 0.8269219 0.8899398 #> [2481] 6.1822929 1.4949089 6.1136923 45.9732246 1.8630898 #> [2486] 0.4607324 2.4314377 NA 0.3267280 7.7629838 #> [2491] 0.9005343 6.4958630 0.6801585 1.1879852 13.1560583 #> [2496] 2.3879337 NA 0.7733446 1.1475980 3.0229218 #> [2501] 14.0746317 0.5247985 1.2050325 9.2619877 0.7634576 #> [2506] 1.0241749 1.0909539 5.3293109 2.7063551 3.4095821 #> [2511] 0.6897098 1.0274373 0.8178927 1.5089374 0.7430726 #> [2516] 1.1275156 21.9422588 1.3811653 3.5942285 1.6271605 #> [2521] 2.1611414 0.8879982 0.8763292 1.7225560 13.2923336 #> [2526] 3.3895564 21.7352753 0.4632308 1.5177442 1.9604896 #> [2531] 5.8416729 0.6393901 2.9566762 0.3774208 1.6599923 #> [2536] 3.0378304 2.7158394 0.6954392 1.9243698 1.4208319 #> [2541] 0.3644979 0.9764859 1.7312529 1.9927244 8.3358564 #> [2546] 0.3344689 1.5944563 1.4439087 2.7181752 0.9094949 #> [2551] 1.2030648 2.7429266 6.6508756 2.8126271 3.6208489 #> [2556] 6.5295534 0.3424659 0.5115961 0.5035965 1.0872059 #> [2561] 1.5785052 0.2461324 1.9896445 0.8427312 0.7660883 #> [2566] 2.3450923 2.4805903 0.8671566 0.6639645 0.5334827 #> [2571] 0.4702013 3.1127882 64.2761841 5.7723532 0.9449326 #> [2576] 9.8559513 1.5376849 0.6502208 0.8867813 0.9406697 #> [2581] 2.6839008 3.2349586 26.2348919 2.3463531 0.7232664 #> [2586] 0.5971866 2.7867749 1.2694967 5.0291767 1.4869373 #> [2591] 1.9182748 0.8268527 4.4961567 0.4737805 2.8711464 #> [2596] 3.6332841 1.5385498 4.7165794 1.2112534 2.5973957 #> [2601] 4.9447703 0.9545295 1.4072028 1.8630619 1.4024746 #> [2606] 0.5282810 1.8168713 4.9301190 0.1499837 0.7057289 #> [2611] 1.6758749 1.9225767 0.6456749 1.0736265 0.6631852 #> [2616] 2.0254166 0.8686433 2.9635856 2.8306408 0.6591658 #> [2621] 1.8536581 0.7700182 0.6434809 3.0102704 0.6942499 #> [2626] 2.7054408 6.5840912 0.4648814 2.2047083 0.8025916 #> [2631] 0.9868059 0.9812470 1.6068337 1.6466388 0.6577185 #> [2636] 3.3152702 0.3456087 1.4819642 1.6930362 0.6172115 #> [2641] 4.8450933 10.5450792 48.2902794 0.6500265 0.6208660 #> [2646] 0.6039580 0.9597225 0.3537683 0.8526208 0.2884314 #> [2651] 0.8374825 1.8498940 2.6492484 0.8956540 1.2795352 #> [2656] 3.1287794 2.0273194 3.7718840 1.8026490 0.7220110 #> [2661] 0.7175305 4.3183942 1.4981960 0.2836370 0.8527241 #> [2666] 3.5981882 0.3067524 1.3901409 2.7463164 2.1976302 #> [2671] 0.2309106 0.2099868 0.8203602 1.9904572 4.0084724 #> [2676] 0.5368133 0.4482878 1.4325606 2.3086529 0.4549935 #> [2681] 3.1426587 1.3987031 0.4663780 2.3534548 NA #> [2686] 3.8060784 0.4556686 1.3394214 1.1004189 2.4211915 #> [2691] 3.3820996 31.4883842 0.7637222 2.0601268 0.7897440 #> [2696] 1.1024669 1.4127746 0.7815835 0.3922873 2.3492901 #> [2701] 1.7412961 1.0913932 2.1832561 5.6013675 0.5410951 #> [2706] NA 1.5191215 8.5703373 1.4032021 2.8650708 #> [2711] 1.6290002 0.6252948 2.6510727 5.6316738 0.6707575 #> [2716] 1.2557933 2.8557181 6.8578634 0.6140221 4.2484360 #> [2721] 0.6619285 1.2980875 3.2068131 1.3282340 1.5175761 #> [2726] 2.3767309 0.8093471 0.6040459 0.6218860 1.4518211 #> [2731] 1.7191668 1.9510572 0.3967183 1.0216656 3.4807718 #> [2736] 12.6569872 1.2336719 11.7144327 0.6784623 1.0983104 #> [2741] 0.8703533 0.9070129 2.6424198 1.1471686 0.9019348 #> [2746] 2.5049481 11.4490557 0.5566154 1.9753987 2.3320930 #> [2751] 3.7091351 2.4257834 0.7362632 0.8419358 3.9386895 #> [2756] 0.9128963 1.6723500 1.3298150 0.6335756 0.6562991 #> [2761] 3.2722898 2.3044112 1.4757828 8.4148054 0.3076566 #> [2766] 1.2632453 0.8317384 6.0139632 2.7857358 1.4718702 #> [2771] 2.8902125 3.4636676 2.9858587 1.1537194 6.6131492 #> [2776] 0.2267639 0.5474497 0.4946014 1.2936714 1.6368855 #> [2781] 0.9594902 1.4098917 0.7878828 0.6673341 3.1816411 #> [2786] 1.2840652 2.6560736 19.9554462 1.0239617 1.8550906 #> [2791] 2.3586714 0.4221451 2.8507216 3.4885705 7.3413062 #> [2796] 35.7378654 1.4843854 0.8229836 1.9679027 0.9418428 #> [2801] 2.5392017 0.9196062 4.2101269 NA 0.8723121 #> [2806] 1.1009536 2.2867596 5.5058069 1.2713206 2.4941492 #> [2811] 1.5185130 2.7117639 4.5919437 5.1406364 2.8025935 #> [2816] 5.8709002 13.7791338 14.5640020 4.8297606 7.8658409 #> [2821] 6.8229294 27.7137413 5.3379407 14.4617805 4.4964433 #> [2826] 16.1921463 10.2128115 4.2068844 10.3527794 30.8382893 #> [2831] 6.8301725 9.5161114 46.6889000 5.9609809 13.2284927 #> [2836] 7.8532238 36.7056198 8.2213917 7.4940300 11.8976650 #> [2841] 13.4008360 19.2198009 2.2085142 16.2607841 27.6975002 #> [2846] 84.5502777 8.9375477 17.9089260 15.0652647 9.7659874 #> [2851] 20.4718914 10.5261488 102.4522476 17.9931507 11.4199753 #> [2856] 19.1676826 17.0927010 24.3487606 6.6103988 8.1302404 #> [2861] 9.6394157 30.0782166 10.6189022 3.9972832 13.7391968 #> [2866] 28.9560966 6.7734051 8.2172832 10.3078299 20.1655922 #> [2871] 18.3504696 2.8396056 27.5377102 4.3330150 4.9756093 #> [2876] 8.2070942 2.5828452 7.6423254 7.4956326 3.3020027 #> [2881] 8.2716713 10.5372095 5.9630933 5.2237558 9.0436430 #> [2886] 7.9005804 4.6265149 4.5348096 14.0217648 11.7508678 #> [2891] 5.1471868 11.1270819 7.9933724 12.3714352 NA #> [2896] 9.6415024 1.0363822 2.1618273 2.2038519 16.1064682 #> [2901] 6.1964874 5.3220701 1.6039859 98.4771194 4.0282149 #> [2906] 2.6477625 16.8007278 3.5877471 2.6565950 5.3537140 #> [2911] 39.1409950 3.9032741 51.0578613 14.7823324 23.7130947 #> [2916] 41.8512573 27.0040703 8.8542757 40.3777084 36.5384369 #> [2921] 6.2642756 10.2587223 25.8907166 44.1283989 16.7547779 #> [2926] 1.5664260 36.2730598 45.0348854 5.4926982 9.8852091 #> [2931] 38.9618721 45.9797630 NA 3.3837142 1.5297805 #> [2936] 2.0968738 4.4807029 0.6716859 4.6078916 2.3965619 #> [2941] 0.9893416 1.2310627 5.1445694 1.9888287 0.6328241 #> [2946] 0.5137627 5.9770460 0.9208446 1.4403317 4.3081975 #> [2951] 0.9803630 0.8477652 0.4548255 11.3158970 1.3294666 #> [2956] 1.6702332 4.7679958 0.8518687 1.8222345 2.7682319 #> [2961] 4.0749702 0.4489682 NA 0.6329405 1.6010697 #> [2966] 0.1622699 0.8471114 0.4407594 1.1682943 1.4405993 #> [2971] 2.0458810 6.8692994 2.7137775 1.1100407 0.3899231"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/chunkapply.html","id":null,"dir":"Reference","previous_headings":"","what":"Apply a function stepwise to chunks of data — chunkapply","title":"Apply a function stepwise to chunks of data — chunkapply","text":"chunkapply() splits x chunks applies function FUN stepwise chunks. Depending object called, function might reduce memory demand considerably, example full data single chunk needs loaded memory time (e.g., Spectra objects -disk similar backends).","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/chunkapply.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Apply a function stepwise to chunks of data — chunkapply","text":"","code":"chunkapply(x, FUN, ..., chunkSize = 1000L, chunks = factor())"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/chunkapply.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Apply a function stepwise to chunks of data — chunkapply","text":"x object FUN applied. Can object supports split. FUN function apply x. ... additional parameters FUN. chunkSize integer(1) defining size chunk x splitted. chunks optional factor length equal length(x) defining chunks x splitted.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/chunkapply.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Apply a function stepwise to chunks of data — chunkapply","text":"Depending FUN, cases vector/result object length equal length(x).","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/chunkapply.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Apply a function stepwise to chunks of data — chunkapply","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/chunkapply.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Apply a function stepwise to chunks of data — chunkapply","text":"","code":"## Apply a function (`sqrt`) to each element in `x`, processed in chunks of ## size 200. x <- rnorm(n = 1000, mean = 500) res <- chunkapply(x, sqrt, chunkSize = 200) length(res) #> [1] 1000 head(res) #> [1] 22.32935 22.36639 22.30611 22.36056 22.37457 22.38634 ## For such a calculation the vectorized `sqrt` would however be recommended system.time(sqrt(x)) #> user system elapsed #> 0.002 0.000 0.003 system.time(chunkapply(x, sqrt, chunkSize = 200)) #> user system elapsed #> 0.001 0.000 0.001 ## Simple example splitting a numeric vector into chunks of 200 and ## aggregating the values within the chunk using the `mean`. Due to the ## `unsplit` the result has the same length than the input with the mean ## value repeated. x <- 1:1000 res <- chunkapply(x, mean, chunkSize = 200) length(res) #> [1] 1000 head(res) #> [1] 100.5 100.5 100.5 100.5 100.5 100.5"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaks.html","id":null,"dir":"Reference","previous_headings":"","what":"Aggregating and combining mass peaks data — combinePeaks","title":"Aggregating and combining mass peaks data — combinePeaks","text":"addition aggregating content spectra variables (describe combineSpectra()) also possible aggregate combine mass peaks data individual spectra within Spectra. combinePeaks() function combines mass peaks within spectrum difference m/z values smaller maximal acceptable difference defined ppm tolerance. Parameters intensityFun mzFun allow define functions aggregate intensity m/z values group peaks. weighted = TRUE (default), m/z value combined peak calculated using intensity-weighted mean parameter mzFun ignored. MsCoreUtils::group() function used grouping mass peaks. Parameter msLevel. allows define selected MS levels peaks combined. function returns Spectra number spectra input object, possibly combined peaks within spectrum. Additional peak variables (\"mz\" \"intensity\") dropped (.e. values replaced NA) combined peaks unless constant across combined peaks. See also reduceSpectra() function select single representative mass peak peak group.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaks.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Aggregating and combining mass peaks data — combinePeaks","text":"","code":"# S4 method for class 'Spectra' combinePeaks( object, tolerance = 0, ppm = 20, intensityFun = base::mean, mzFun = base::mean, weighted = TRUE, msLevel. = uniqueMsLevels(object), ... )"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaks.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Aggregating and combining mass peaks data — combinePeaks","text":"object Spectra object. tolerance numeric(1) allowing define constant maximal accepted difference m/z values peaks grouped. Default tolerance = 0. ppm numeric(1) defining relative, m/z-dependent, maximal accepted difference m/z values peaks grouped. Default ppm = 20. intensityFun Function aggregate intensities peaks peak group single intensity value. mzFun Function aggregate m/z values mass peaks within peak group single m/z value. parameter ignored weighted = TRUE (default). weighted logical(1) whether m/z values peaks within peak group aggregated single m/z value using intensity-weighted mean. Defaults weighted = TRUE. msLevel. integer defining MS level(s) spectra function applied (defaults MS levels object. ... ignored.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaks.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Aggregating and combining mass peaks data — combinePeaks","text":"Sebastian Gibb, Johannes Rainer, Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaks.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Aggregating and combining mass peaks data — combinePeaks","text":"","code":"## Create a Spectra from mzML files and use the `MsBackendMzR` on-disk ## backend. sciex_file <- dir(system.file(\"sciex\", package = \"msdata\"), full.names = TRUE) sciex <- Spectra(sciex_file, backend = MsBackendMzR()) ## Combine mass peaks per spectrum with a difference in their m/z value ## that is smaller than 20 ppm. The intensity values of such peaks are ## combined by summing their values, while for the m/z values the median ## is reported sciex_comb <- combinePeaks(sciex, ppm = 20, intensityFun = sum, mzFun = median) ## Comparing the number of mass peaks before and after aggregation lengths(sciex) |> head() #> [1] 578 1529 1600 1664 1417 1602 lengths(sciex_comb) |> head() #> [1] 149 366 379 374 344 378 ## Plotting the first spectrum before and after aggregation par(mfrow = c(1, 2)) plotSpectra(sciex[2L]) plotSpectra(sciex_comb[2L]) ## Using `reduceSpectra()` to keep for each group of mass peaks with a ## difference in their m/z values < 20ppm the one with the highest intensity. sciex_red <- reduceSpectra(sciex, ppm = 20) ## Comparing the number of mass peaks before and after the operation lengths(sciex) |> head() #> [1] 578 1529 1600 1664 1417 1602 lengths(sciex_red) |> head() #> [1] 149 366 379 374 344 378"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaksData.html","id":null,"dir":"Reference","previous_headings":"","what":"Combine peaks with similar m/z across spectra — combinePeaksData","title":"Combine peaks with similar m/z across spectra — combinePeaksData","text":"combinePeaksData() aggregates provided peak matrices single peak matrix. Peaks grouped m/z values group() function MsCoreUtils package. brief, peaks provided spectra first ordered m/z consecutively grouped one group (pairwise) difference smaller specified parameter tolerance ppm (see group() grouping details examples). m/z intensity values resulting peak matrix calculated using mzFun intensityFun grouped m/z intensity values. Note grouped m/z intensity values used aggregation functions (mzFun intensityFun) number spectra. function supports also different strategies peak combinations can specified peaks parameter: peaks = \"union\" (default): report peaks input spectra. peaks = \"intersect\": keep peaks resulting peak matrix present >= minProp proportion input spectra. generate consensus representative spectra set e.g. fragment spectra measured precursor ion. special case possible report peaks resulting matrix peak groups contain peak one input spectra, can specified parameter main. Thus, e.g. main = 2 specified, (grouped) peaks peak second input matrix returned. Setting timeDomain TRUE causes grouping performed square root m/z values (assuming TOF instrument used create data).","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaksData.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Combine peaks with similar m/z across spectra — combinePeaksData","text":"","code":"combinePeaksData( x, intensityFun = base::mean, mzFun = base::mean, weighted = FALSE, tolerance = 0, ppm = 0, timeDomain = FALSE, peaks = c(\"union\", \"intersect\"), main = integer(), minProp = 0.5, ... )"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaksData.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Combine peaks with similar m/z across spectra — combinePeaksData","text":"x list peak matrices. intensityFun function used combine intensity values matching peaks. default mean intensity value returned. mzFun function used combine m/z values matching peaks. default mean m/z value returned. weighted logical(1) defining whether m/z values matching peaks calculated intensity-weighted average individuak m/z values. overrides parameter mzFun. tolerance numeric(1) defining (absolute) maximal accepted difference mass peaks group final peak. ppm numeric(1) defining m/z-relative maximal accepted difference mass peaks (expressed parts-per-million) group final peak. timeDomain logical(1) whether grouping mass peaks performed m/z values (timeDomain = FALSE) sqrt(mz) (timeDomain = TRUE). peaks character(1) specifying peaks combined. Can either \"peaks = \"union\" (default) peaks = \"intersect\". See function description details. main optional integer(1) force resulting peak list contain peaks present specified input spectrum. See description details. minProp numeric(1) `peaks = \"intersect\": minimal required proportion input spectra (peak matrices) mass peak present included consensus peak matrix. ... additional parameters mzFun intensityFun functions.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaksData.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Combine peaks with similar m/z across spectra — combinePeaksData","text":"Peaks matrix m/z intensity values representing aggregated values across provided peak matrices.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaksData.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Combine peaks with similar m/z across spectra — combinePeaksData","text":"general merging spectra, tolerance /ppm manually specified based precision MS instrument. Peaks spectra difference m/z smaller tolerance smaller ppm m/z grouped final peak. details combination consecutive spectra LC-MS run: m/z values ion consecutive scans (spectra) LC-MS run identical. Assuming random variation much smaller resolution MS instrument (.e. difference m/z values within single spectrum), m/z value groups defined across spectra containing m/z values main spectrum retained. Intensities m/z values falling within m/z groups aggregated using intensityFun mzFun, respectively. highly likely QTOF profile data collected timing circuit collects data points regular intervals time later converted m/z values based relationship t = k * sqrt(m/z). m/z scale thus non-linear m/z scattering (fact caused small variations time circuit) thus different lower upper m/z scale. m/z-intensity pairs consecutive scans combined therefore defined default square root m/z values. timeDomain = FALSE, actual m/z values used.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaksData.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Combine peaks with similar m/z across spectra — combinePeaksData","text":"Johannes Rainer","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combinePeaksData.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Combine peaks with similar m/z across spectra — combinePeaksData","text":"","code":"set.seed(123) mzs <- seq(1, 20, 0.1) ints1 <- abs(rnorm(length(mzs), 10)) ints1[11:20] <- c(15, 30, 90, 200, 500, 300, 100, 70, 40, 20) # add peak ints2 <- abs(rnorm(length(mzs), 10)) ints2[11:20] <- c(15, 30, 60, 120, 300, 200, 90, 60, 30, 23) ints3 <- abs(rnorm(length(mzs), 10)) ints3[11:20] <- c(13, 20, 50, 100, 200, 100, 80, 40, 30, 20) ## Create the peaks matrices p1 <- cbind(mz = mzs + rnorm(length(mzs), sd = 0.01), intensity = ints1) p2 <- cbind(mz = mzs + rnorm(length(mzs), sd = 0.01), intensity = ints2) p3 <- cbind(mz = mzs + rnorm(length(mzs), sd = 0.009), intensity = ints3) ## Combine the spectra. With `tolerance = 0` and `ppm = 0` only peaks with ## **identical** m/z are combined. The result will be a single spectrum ## containing the *union* of mass peaks from the individual input spectra. p <- combinePeaksData(list(p1, p2, p3)) ## Plot the spectra before and after combining par(mfrow = c(2, 1), mar = c(4.3, 4, 1, 1)) plot(p1[, 1], p1[, 2], xlim = range(mzs[5:25]), type = \"h\", col = \"red\") points(p2[, 1], p2[, 2], type = \"h\", col = \"green\") points(p3[, 1], p3[, 2], type = \"h\", col = \"blue\") plot(p[, 1], p[, 2], xlim = range(mzs[5:25]), type = \"h\", col = \"black\") ## The peaks were not merged, because their m/z differs too much. ## Combine spectra with `tolerance = 0.05`. This will merge all triplets. p <- combinePeaksData(list(p1, p2, p3), tolerance = 0.05) ## Plot the spectra before and after combining par(mfrow = c(2, 1), mar = c(4.3, 4, 1, 1)) plot(p1[, 1], p1[, 2], xlim = range(mzs[5:25]), type = \"h\", col = \"red\") points(p2[, 1], p2[, 2], type = \"h\", col = \"green\") points(p3[, 1], p3[, 2], type = \"h\", col = \"blue\") plot(p[, 1], p[, 2], xlim = range(mzs[5:25]), type = \"h\", col = \"black\") ## With `intensityFun = max` the maximal intensity per peak is reported. p <- combinePeaksData(list(p1, p2, p3), tolerance = 0.05, intensityFun = max) ## Create *consensus*/representative spectrum from a set of spectra p1 <- cbind(mz = c(12, 45, 64, 70), intensity = c(10, 20, 30, 40)) p2 <- cbind(mz = c(17, 45.1, 63.9, 70.2), intensity = c(11, 21, 31, 41)) p3 <- cbind(mz = c(12.1, 44.9, 63), intensity = c(12, 22, 32)) ## No mass peaks identical thus consensus peaks are empty combinePeaksData(list(p1, p2, p3), peaks = \"intersect\") #> mz intensity ## Reducing the minProp to 0.2. The consensus spectrum will contain all ## peaks combinePeaksData(list(p1, p2, p3), peaks = \"intersect\", minProp = 0.2) #> mz intensity #> [1,] 12.0 10 #> [2,] 12.1 12 #> [3,] 17.0 11 #> [4,] 44.9 22 #> [5,] 45.0 20 #> [6,] 45.1 21 #> [7,] 63.0 32 #> [8,] 63.9 31 #> [9,] 64.0 30 #> [10,] 70.0 40 #> [11,] 70.2 41 ## With a tolerance of 0.1 mass peaks can be matched across spectra combinePeaksData(list(p1, p2, p3), peaks = \"intersect\", tolerance = 0.1) #> mz intensity #> [1,] 12.05 11.0 #> [2,] 45.00 21.0 #> [3,] 63.95 30.5 ## Report the minimal m/z and intensity combinePeaksData(list(p1, p2, p3), peaks = \"intersect\", tolerance = 0.1, intensityFun = min, mzFun = min) #> mz intensity #> [1,] 12.0 10 #> [2,] 44.9 20 #> [3,] 63.9 30"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combineSpectra.html","id":null,"dir":"Reference","previous_headings":"","what":"Merging, aggregating and splitting Spectra — concatenateSpectra","title":"Merging, aggregating and splitting Spectra — concatenateSpectra","text":"Various functions availabe combine, aggregate split data one Spectra objects. : c() concatenateSpectra(): combines several Spectra objects single object. resulting Spectra contains data individual Spectra, .e. union spectra variables. Concatenation fail processing queue Spectra objects empty different backends used Spectra objects. cases suggested first change backends Spectra type backend (using setBackend() function eventually (needed) apply processing queue using applyProcessing() function. cbind2(): Appends multiple spectra variables data.frame, DataFrame matrix Spectra object . order values (rows) y match order spectra x. function allow replace existing spectra variables. cbind2() returns Spectra object appended spectra variables. controlled way adding spectra variables, see joinSpectraData() function. combineSpectra(): combines sets spectra (defined parameter f) single spectrum per set aggregating MS data (.e. peaks data matrices m/z intensity values mass peaks). spectra variable values first spectrum per set reported combined spectrum. peak matrices spectra per set combined using function specified parameter FUN uses default combinePeaksData() function. See documentation combinePeaksData() details aggregation peak data package vignette examples. sets spectra can specified parameter f expected factor vector length equal length Spectra specifying set spectrum belongs . function returns Spectra length equal unique levels f. optional parameter p allows define Spectra split potential parallel processing. default p = x$dataStorage hence per storage file parallel processing applied Spectra disk data representations (MsBackendMzR()). also prevents spectra different data files/samples combined (eventually use e.g. p = x$dataOrigin spectra variables defining originating samples spectrum). combining peaks data, eventual present processing steps applied (calling applyProcessing() Spectra). function replace original m/z intensity values Spectra hence can called Spectra read-backend. cases, backend changed writeable backend using setBackend() function (e.g. MsBackendMemory() backend). joinSpectraData(): Individual spectra variables can directly added $<- [[<- syntax. joinSpectraData() function allows merge DataFrame existing spectra data Spectra. function diverges merge() method two main ways: .x .y column names must length 1. variable names shared x y, spectra variables x modified. y variables appended suffix defined suffix.y. avoid modifying core spectra variables lead invalid object. Duplicated Spectra keys (.e. x[[.x]]) allowed. Duplicated keys DataFrame (.e y[[.y]]) throw warning last occurrence kept. explored ideally removed using QFeatures::reduceDataFrame(), PMS::reducePSMs() similar functions. general function allows append data.frame, DataFrame matrix see cbind2(). split(): splits Spectra object based parameter f list Spectra objects.","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combineSpectra.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Merging, aggregating and splitting Spectra — concatenateSpectra","text":"","code":"concatenateSpectra(x, ...) combineSpectra( x, f = x$dataStorage, p = x$dataStorage, FUN = combinePeaksData, ..., BPPARAM = bpparam() ) joinSpectraData(x, y, by.x = \"spectrumId\", by.y, suffix.y = \".y\") # S4 method for class 'Spectra' c(x, ...) # S4 method for class 'Spectra,dataframeOrDataFrameOrmatrix' cbind2(x, y, ...) # S4 method for class 'Spectra,ANY' split(x, f, drop = FALSE, ...)"},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combineSpectra.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Merging, aggregating and splitting Spectra — concatenateSpectra","text":"x Spectra object. ... Additional arguments. f split(): factor defining split x. See base::split() details. combineSpectra(): factor defining grouping spectra combined. Defaults x$dataStorage. p combineSpectra(): factor defining split input Spectra parallel processing. Defaults x$dataStorage, .e., depending used backend, per-file parallel processing performed. FUN combineSpectra(): function combine (peak matrices) spectra. Defaults combinePeaksData(). BPPARAM Parallel setup configuration. See bpparam() information. passed directly backendInitialize() method MsBackend. y joinSpectraData(): DataFrame spectra variables join/add. cbind2(): data.frame, DataFrame matrix. number rows order match number spectra x, respectively order. .x character(1) specifying spectra variable used merging. Default \"spectrumId\". .y character(1) specifying column used merging. Set .x missing. suffix.y character(1) specifying suffix used making names columns merged spectra variables unique. suffix used amend names(y), spectraVariables(x) remain unchanged. drop split(): considered.","code":""},{"path":[]},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combineSpectra.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Merging, aggregating and splitting Spectra — concatenateSpectra","text":"Sebastian Gibb, Johannes Rainer, Laurent Gatto","code":""},{"path":"https://rformassspectrometry.github.io/Spectra/reference/combineSpectra.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Merging, aggregating and splitting Spectra — concatenateSpectra","text":"","code":"## Create a Spectra providing a `DataFrame` containing a MS data. spd <- DataFrame(msLevel = c(1L, 2L), rtime = c(1.1, 1.2)) spd$mz <- list(c(100, 103.2, 104.3, 106.5), c(45.6, 120.4, 190.2)) spd$intensity <- list(c(200, 400, 34.2, 17), c(12.3, 15.2, 6.8)) s <- Spectra(spd) s #> MSn data (Spectra) with 2 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 1.1 NA #> 2 2 1.2 NA #> ... 16 more variables/columns. ## Create a second Spectra from mzML files and use the `MsBackendMzR` ## on-disk backend. sciex_file <- dir(system.file(\"sciex\", package = \"msdata\"), full.names = TRUE) sciex <- Spectra(sciex_file, backend = MsBackendMzR()) sciex #> MSn data (Spectra) with 1862 spectra in a MsBackendMzR backend: #> msLevel rtime scanIndex #> #> 1 1 0.280 1 #> 2 1 0.559 2 #> 3 1 0.838 3 #> 4 1 1.117 4 #> 5 1 1.396 5 #> ... ... ... ... #> 1858 1 258.636 927 #> 1859 1 258.915 928 #> 1860 1 259.194 929 #> 1861 1 259.473 930 #> 1862 1 259.752 931 #> ... 33 more variables/columns. #> #> file(s): #> 20171016_POOL_POS_1_105-134.mzML #> 20171016_POOL_POS_3_105-134.mzML ## Subset to the first 100 spectra to reduce running time of the examples sciex <- sciex[1:100] ## -------- COMBINE SPECTRA -------- ## Combining the `Spectra` object `s` with the MS data from `sciex`. ## Calling directly `c(s, sciex)` would result in an error because ## both backends use a different backend. We thus have to first change ## the backends to the same backend. We change the backend of the `sciex` ## `Spectra` to a `MsBackendMemory`, the backend used by `s`. sciex <- setBackend(sciex, MsBackendMemory()) ## Combine the two `Spectra` all <- c(s, sciex) all #> MSn data (Spectra) with 102 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 1.100 NA #> 2 2 1.200 NA #> 3 1 0.280 1 #> 4 1 0.559 2 #> 5 1 0.838 3 #> ... ... ... ... #> 98 1 26.786 96 #> 99 1 27.065 97 #> 100 1 27.344 98 #> 101 1 27.623 99 #> 102 1 27.902 100 #> ... 33 more variables/columns. #> Processing: #> Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:46:18 2024] #> Merge 2 Spectra into one [Mon Dec 9 10:46:18 2024] ## The new `Spectra` objects contains the union of spectra variables from ## both: spectraVariables(all) #> [1] \"msLevel\" \"rtime\" #> [3] \"acquisitionNum\" \"scanIndex\" #> [5] \"dataStorage\" \"dataOrigin\" #> [7] \"centroided\" \"smoothed\" #> [9] \"polarity\" \"precScanNum\" #> [11] \"precursorMz\" \"precursorIntensity\" #> [13] \"precursorCharge\" \"collisionEnergy\" #> [15] \"isolationWindowLowerMz\" \"isolationWindowTargetMz\" #> [17] \"isolationWindowUpperMz\" \"peaksCount\" #> [19] \"totIonCurrent\" \"basePeakMZ\" #> [21] \"basePeakIntensity\" \"ionisationEnergy\" #> [23] \"lowMZ\" \"highMZ\" #> [25] \"mergedScan\" \"mergedResultScanNum\" #> [27] \"mergedResultStartScanNum\" \"mergedResultEndScanNum\" #> [29] \"injectionTime\" \"filterString\" #> [31] \"spectrumId\" \"ionMobilityDriftTime\" #> [33] \"scanWindowLowerLimit\" \"scanWindowUpperLimit\" ## The spectra variables that were not present in `s`: setdiff(spectraVariables(all), spectraVariables(s)) #> [1] \"peaksCount\" \"totIonCurrent\" #> [3] \"basePeakMZ\" \"basePeakIntensity\" #> [5] \"ionisationEnergy\" \"lowMZ\" #> [7] \"highMZ\" \"mergedScan\" #> [9] \"mergedResultScanNum\" \"mergedResultStartScanNum\" #> [11] \"mergedResultEndScanNum\" \"injectionTime\" #> [13] \"filterString\" \"spectrumId\" #> [15] \"ionMobilityDriftTime\" \"scanWindowLowerLimit\" #> [17] \"scanWindowUpperLimit\" ## The values for these were filled with missing values for spectra from ## `s`: all$peaksCount |> head() #> [1] NA NA 578 1529 1600 1664 ## -------- AGGREGATE SPECTRA -------- ## Sets of spectra can be combined into a single, representative spectrum ## per set using `combineSpectra()`. This aggregates the peaks data (i.e. ## the spectra's m/z and intensity values) while using the values for all ## spectra variables from the first spectrum per set. Below we define the ## sets as all spectra measured in the *same second*, i.e. rounding their ## retention time to the next closer integer value. f <- round(rtime(sciex)) head(f) #> [1] 0 1 1 1 1 2 cmp <- combineSpectra(sciex, f = f) ## The length of `cmp` is now equal to the length of unique levels in `f`: length(cmp) #> [1] 29 ## The spectra variable value from the first spectrum per set is used in ## the representative/combined spectrum: cmp$rtime #> [1] 0.280 0.559 1.675 2.512 3.628 4.744 5.581 6.697 7.534 8.650 #> [11] 9.766 10.603 11.719 12.556 13.672 14.509 15.625 16.741 17.578 18.694 #> [21] 19.531 20.647 21.763 22.601 23.717 24.554 25.670 26.507 27.623 ## The peaks data was aggregated: the number of mass peaks of the first six ## spectra from the original `Spectra`: lengths(sciex) |> head() #> [1] 578 1529 1600 1664 1417 1602 ## and for the first aggreagated spectra: lengths(cmp) |> head() #> [1] 578 3928 3177 3597 3928 3190 ## The default peaks data aggregation method joins all mass peaks. See ## documentation of the `combinePeaksData()` function for more options. ## -------- SPLITTING DATA -------- ## A `Spectra` can be split into a `list` of `Spectra` objects using the ## `split()` function defining the sets into which the `Spectra` should ## be splitted into with parameter `f`. sciex_split <- split(sciex, f) length(sciex_split) #> [1] 29 sciex_split |> head() #> $`0` #> MSn data (Spectra) with 1 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 0.28 1 #> ... 33 more variables/columns. #> Processing: #> Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:46:18 2024] #> #> $`1` #> MSn data (Spectra) with 4 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 0.559 2 #> 2 1 0.838 3 #> 3 1 1.117 4 #> 4 1 1.396 5 #> ... 33 more variables/columns. #> Processing: #> Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:46:18 2024] #> #> $`2` #> MSn data (Spectra) with 3 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 1.675 6 #> 2 1 1.954 7 #> 3 1 2.233 8 #> ... 33 more variables/columns. #> Processing: #> Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:46:18 2024] #> #> $`3` #> MSn data (Spectra) with 4 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 2.512 9 #> 2 1 2.791 10 #> 3 1 3.070 11 #> 4 1 3.349 12 #> ... 33 more variables/columns. #> Processing: #> Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:46:18 2024] #> #> $`4` #> MSn data (Spectra) with 4 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 3.628 13 #> 2 1 3.907 14 #> 3 1 4.186 15 #> 4 1 4.465 16 #> ... 33 more variables/columns. #> Processing: #> Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:46:18 2024] #> #> $`5` #> MSn data (Spectra) with 3 spectra in a MsBackendMemory backend: #> msLevel rtime scanIndex #> #> 1 1 4.744 17 #> 2 1 5.023 18 #> 3 1 5.302 19 #> ... 33 more variables/columns. #> Processing: #> Switch backend from MsBackendMzR to MsBackendMemory [Mon Dec 9 10:46:18 2024] #> ## -------- ADDING SPECTRA DATA -------- ## Adding new spectra variables sciex1 <- filterDataOrigin(sciex, dataOrigin(sciex)[1]) spv <- DataFrame(spectrumId = sciex1$spectrumId[3:12], ## used for merging var1 = rnorm(10), var2 = sample(letters, 10)) spv #> DataFrame with 10 rows and 3 columns #> spectrumId var1 var2 #>