@@ -71,14 +71,16 @@ Sources* vignette in this package for a general introduction to MS.
7171
7272## Installation
7373
74+ - This version of the tutorial bases on package versions available through
75+ ** Bioconductor release 3.19** .
7476- Get the [ docker image] ( https://hub.docker.com/r/jorainer/spectra_tutorials ) of
75- this tutorial with ` docker pull jorainer/spectra_tutorials:latest ` .
77+ this tutorial with ` docker pull jorainer/spectra_tutorials:RELEASE_3_19 ` .
7678- Start docker using
7779 ```
7880 docker run \
7981 -e PASSWORD=bioc \
8082 -p 8787:8787 \
81- jorainer/spectra_tutorials:latest
83+ jorainer/spectra_tutorials:RELEASE_3_19
8284 ```
8385- Enter ` http://localhost:8787 ` in a web browser and log in with username
8486 ` rstudio ` and password ` bioc ` .
@@ -195,7 +197,7 @@ with out input data frame, more variables are available by default for a
195197` Spectra ` object. These are called * core spectra variables* and they can
196198** always** be extracted from a ` Spectra ` object, even if they are not defined
197199(in which case missing values are returned). Spectra variables available from a
198- ` Spectra ` object can be listed with the ` spectraVariables ` function:
200+ ` Spectra ` object can be listed with the ` spectraVariables() ` function:
199201
200202``` {r}
201203#' List all available spectra variables
@@ -273,12 +275,13 @@ s$new_variable <- c("a", "b", "c")
273275spectraVariables(s)
274276```
275277
276- The full peak data can be extracted with the ` peaksData ` function, that returns
277- a ` list ` of two-dimensional arrays with the values of the peak variables. Each
278- list element represents the peak data from one spectrum, which is stored in a
279- e.g. ` matrix ` with columns being the peak variables and rows the respective
280- values for each peak. The number of rows of such peak variable arrays depends on
281- the number of mass peaks of each spectrum. This number can be extracted using ` lengths ` :
278+ The full peak data can be extracted with the ` peaksData() ` function, that
279+ returns a ` list ` of two-dimensional arrays with the values of the peak
280+ variables. Each list element represents the peak data from one spectrum, which
281+ is stored in a e.g. ` matrix ` with columns being the peak variables and rows the
282+ respective values for each peak. The number of rows of such peak variable arrays
283+ depends on the number of mass peaks of each spectrum. This number can be
284+ extracted using ` lengths() ` :
282285
283286``` {r}
284287#' Get the number of peaks per spectrum.
@@ -434,8 +437,8 @@ memory. As a third option we next store the full MS data into a SQL database by
434437using/changing to a ` MsBackendOfflineSql ` backend defined by the
435438` r Biocpkg("MsBackendSql") ` package.
436439
437- For the ` setBackend ` call we need to provide the connection information for the
438- database that should contain the data. This includes the database driver
440+ For the ` setBackend() ` call we need to provide the connection information for
441+ the database that should contain the data. This includes the database driver
439442(parameter ` drv ` , depending on the database system), the database name
440443(parameter ` dbname ` ) as well as eventual additional connection information like
441444the host, username, port or password. Which of these parameters are required
@@ -462,7 +465,7 @@ s_db <- setBackend(s_mzr, MsBackendOfflineSql(), drv = SQLite(),
462465```
463466
464467* Note* : a more efficient way to import MS data from data files into a SQL
465- database is the ` createMsBackendSqlDatabase ` from the * MsBackendSql*
468+ database is the ` createMsBackendSqlDatabase() ` from the * MsBackendSql*
466469package. Also, for larger data sets it is suggested to use more advanced and
467470powerful SQL database systems (e.g. MySQL/MariaDB SQL databases).
468471
@@ -484,7 +487,7 @@ experiments.
484487
485488We next evaluate the performance to extract spectra variables. We compare the
486489time needed to extract the retention times from the 3 ` Spectra ` objects using
487- the ` microbenchmark ` function. With ` register(SerialParam()) ` we globally
490+ the ` microbenchmark() ` function. With ` register(SerialParam()) ` we globally
488491disable parallel processing for * Spectra* to ensure the results to be
489492independent that.
490493
@@ -733,7 +736,7 @@ data, along with all of its parameters, is automatically added to an internal
733736directly for the ` Spectra ` class and backends thus do not have to implement
734737their own.
735738
736- When calling ` filterIntensity ` above, the data was actually not modified, but
739+ When calling ` filterIntensity() ` above, the data was actually not modified, but
737740the function to filter the peaks data was added to this processig queue. The
738741function along with all possibly defined parameters was added as a
739742` ProcessingStep ` object:
@@ -758,11 +761,11 @@ and all of its parameters with:
758761s_db@processingQueue[[1L]]@ARGS
759762```
760763
761- Each time peaks data is accessed (like with the ` intensity ` call in the example
762- below), the ` Spectra ` object will first request the * raw* peaks data from the
763- backend, check its own processing queue and, if that is not empty, apply each of
764- the contained cached processing steps to the peaks data before returning it to
765- the user.
764+ Each time peaks data is accessed (like with the ` intensity() ` call in the
765+ example below), the ` Spectra ` object will first request the * raw* peaks data
766+ from the backend, check its own processing queue and, if that is not empty,
767+ apply each of the contained cached processing steps to the peaks data before
768+ returning it to the user.
766769
767770``` {r}
768771#' Access intensity values and extract those of the 1st spectrum.
@@ -784,15 +787,15 @@ microbenchmark(
784787
785788Next to the number of common peaks data manipulation methods that are already
786789implemented for ` Spectra ` , and that all make use of this processing queue, there
787- is also the ` addProcessing ` function that allows to apply any user-provided
790+ is also the ` addProcessing() ` function that allows to apply any user-provided
788791function to the peaks data (using the same lazy evaluation mechanism). As a
789792simple example we define below a function that * scales* all intensities in a
790793spectrum such that the total intensity sum per spectrum is 1. Functions for
791- ` addProcessing ` are expected to take a peaks array as input and should again
794+ ` addProcessing() ` are expected to take a peaks array as input and should again
792795return a peaks array as their result. Note also that the ` ... ` in the function
793796definition below is required, because internally additional parameters, such as
794797the spectrum's MS level, are by default passed along to the function (see also
795- the ` addProcessing ` documentation entry in ` ?Spectra ` for more information and
798+ the ` addProcessing() ` documentation entry in ` ?Spectra ` for more information and
796799more advanced examples).
797800
798801``` {r}
@@ -822,7 +825,7 @@ such a scaling function should generally not be used for (quantitative) MS1 data
822825(as in our example here).
823826
824827Finally, since through this lazy evaluation mechanism we are not changing actual
825- peaks data, we can also * undo* data manipulations. A simple ` reset ` call on a
828+ peaks data, we can also * undo* data manipulations. A simple ` reset() ` call on a
826829` Spectra ` object will restore the data in the object to its initial state (in
827830fact it simply clears the processing queue).
828831
0 commit comments