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()
object | Instance of |
---|---|
files |
|
nonStop |
|
... | Currently ignored. |
BPPARAM | Parameter object defining the parallel processing setup to
import data in parallel. Defaults to |
Johannes Rainer
## 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)#>#>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 2be$compound_id#> [1] "HMDB0000001" "HMDB0000001" "HMDB0004370" "HMDB0006719"