import_mona_sdf: Import compound and spectrum information from MoNa...

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

View source: R/createCompDbPackage.R

Description

Import compound and spectrum information from MoNa

import_mona_sdf allows to import compound and spectrum information from an SDF file from MoNa (Massbank of North America http://mona.fiehnlab.ucdavis.edu/). This function is a convenience function using the compound_tbl_sdf() and msms_spectra_mona() functions for data import but avoiding to read the SDF files twice.

Usage

1
import_mona_sdf(x, nonStop = TRUE)

Arguments

x

character(1) being the SDF file name.

nonStop

logical(1) wheter file content specific errors should only reported as warnings and not break the full import process.

Value

A list with elements "compound" and "msms_spectrum" containing data.frames with compound and MS/MS spectrum data, respectively.

Note

MoNa SDF files organize the data by individual spectra (i.e. each element is one spectrum) and individual compounds can not easily and consistently defined (i.e. not all entries have an InChI ID or other means to uniquely identify compounds). Thus, the function returns a highly redundant compount table. Feedback on how to reduce this redundancy would be highly welcome!

Author(s)

Johannes Rainer

See Also

compound_tbl_sdf() to read only the compound information.

msms_spectra_mona() to read only the spectrum data.

Examples

1
2
3
4
5
6
## Define the test file containing a small subset from MoNa
fl <- system.file("sdf/MoNa_export-All_Spectra_sub.sdf.gz",
    package = "CompoundDb")

## Import the data
res <- import_mona_sdf(fl)

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