msms_spectra_mona: Import MS/MS spectra from MoNa

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/spectrum-import-functions.R

Description

msms_spectra_mona imports MS/MS spectra from a MoNa (Massbank of North America, http://mona.fiehnlab.ucdavis.edu/downloads) SDF file and returns the data as a data.frame.

Depending on the parameter collapsed, the returned data.frame is either collapsed, meaning that each row represents data from one spectrum, or expanded with one row for each m/z and intensity pair for each spectrum. Columns "mz" and "intensity" are of type list for collapsed = TRUE and numeric for collapsed = FALSE.

Usage

1
msms_spectra_mona(x, collapsed = TRUE)

Arguments

x

character(1): with the path to directory containing the xml files.

collapsed

logical(1) whether the returned data.frame should be collapsed or expanded. See description for more details.

Value

data.frame with as many rows as there are peaks and columns:

Note

The identifiers provided by MoNa are used as spectrum_id. Note also that the MoNa data is not normalized in the sense that each spectrum is associated to one compound and the compound data is partially redundant. Also, MoNa does not provide a splash for a spectrum, hence the corresponding column will only contain NA.

Author(s)

Johannes Rainer

See Also

createCompDb() for the function to create a CompDb database with compound annotation and spectrum data.

Other spectrum data import functions.: msms_spectra_hmdb()

Examples

1
2
3
4
5
6
7
8
9
## Define the test file containing the data
fl <- system.file("sdf/MoNa_export-All_Spectra_sub.sdf.gz",
    package = "CompoundDb")
## Import spectrum data from the SDF file with a subset of the MoNa data
msms_spectra_mona(fl)

## Import the data as an *expanded* data frame, i.e. with a row for each
## single m/z (intensity) value.
msms_spectra_mona(fl, collapsed = FALSE)

michaelwitting/CompoundDb documentation built on April 29, 2020, 8:42 p.m.