The MsBackendHmdbXml class supports import of MS/MS spectra data from xml files from The Human Metabolome Database HMDB. After initial import, the full MS data is kept in memory. MsBackendHmdbXml extends the MsBackendDataFrame() backend directly and supports thus the applyProcessing() function to make data manipulations persistent. The backend does however not support export of MS2 data to xml files in HMDB format.

New objects are created with the MsBackendHmdbXml function. The backendInitialize method has to be subsequently called to initialize the object and import MS/MS data from (one or more) xml files from HMDB. Optional parameter nonStop allows to specify whether the import returns with an error if one of the xml files lacks required data, such as mz and intensity values (default nonStop = FALSE), or whether only affected file(s) is(are) skipped and a warning is shown (nonStop = TRUE). Note that any other error (such as xml import error) will abort import regardless of parameter nonStop.

# S4 method for MsBackendHmdbXml
backendInitialize(object, files, nonStop = FALSE, ..., BPPARAM = bpparam())

MsBackendHmdbXml()

Arguments

object

Instance of MsBackendHmdbXml class.

files

character with the (full) file name(s) of the HMDB xml file(s) from which MS/MS data should be imported.

nonStop

logical(1) whether import should be stopped if an xml file does not contain all required fields. Defaults to nonStop = FALSE.

...

Currently ignored.

BPPARAM

Parameter object defining the parallel processing setup to import data in parallel. Defaults to BPPARAM = bpparam(). See bpparam() for more information.

Author

Johannes Rainer

Examples

## Create an MsBackendHmdbXml backend and import data from test xml files. fls <- dir(system.file("xml", package = "MsBackendHmdb"), full.names = TRUE, pattern = "xml$") be <- backendInitialize(MsBackendHmdbXml(), fls)
#> Start data import from 4 files ...
#> done
be
#> MsBackendHmdbXml with 4 spectra #> msLevel rtime scanIndex #> <integer> <numeric> <integer> #> 1 2 NA NA #> 2 2 NA NA #> 3 2 NA NA #> 4 2 NA NA #> ... 21 more variables/columns.
be$msLevel
#> [1] 2 2 2 2
be$compound_id
#> [1] "HMDB0000001" "HMDB0000001" "HMDB0004370" "HMDB0006719"