MsBackendHmdbXml: MS data backend for HMDB xml files

View source: R/MsBackendHmdbXml.R

MsBackendHmdbXmlR Documentation

MS data backend for HMDB xml files

Description

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.

Usage

## S4 method for signature '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(s)

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)
be

be$msLevel
be$compound_id

rformassspectrometry/MsBackendHmdbXml documentation built on May 22, 2022, 2:46 a.m.