import_mona_sdf: Import compound and spectrum information from MoNa

View source: R/createCompDbPackage.R

import_mona_sdfR Documentation

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 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.


import_mona_sdf(x, nonStop = TRUE)



character(1) being the SDF file name.


logical(1) whether file content specific errors should only reported as warnings and not break the full import process. The value of this parameter is passed to parameter skipErrors of the read.SDFset() function.


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


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 compound table. Feedback on how to reduce this redundancy would be highly welcome!


Johannes Rainer

See Also

compound_tbl_sdf() to read only the compound information.

msms_spectra_mona() to read only the spectrum data.


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

EuracBiomedicalResearch/CompoundDb documentation built on July 21, 2024, 2:03 a.m.