Description Usage Arguments Value Note Author(s) See Also Examples
View source: R/spectrum-import-functions.R
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
.
1 | msms_spectra_mona(x, collapsed = TRUE)
|
x |
|
collapsed |
|
data.frame
with as many rows as there are peaks and columns:
spectrum_id (integer
): an arbitrary, unique ID for each spectrum.
original_spectrum_id (character
): The ID from the spectrum as specified
in the MoNa SDF.
compound_id (character
): the compound ID the spectrum is associated
with.
polarity (integer
): 0 for negative, 1 for positive, NA
for not set.
collision_energy (character
): collision energy voltage.
predicted (logical
): whether the spectrum is predicted or experimentally
verified.
splash (character
): NA
since SPLASH (SPectraL hASH) keys are not
provided.
instrument_type (character
): the type of MS instrument on which the
spectrum was measured.
instrument (character
): the MS instrument.
precursor_mz (numeric
): precursor m/z.
mz (numeric
or list
of numeric
): m/z values of the spectrum.
intensity (numeric
or list
of numeric
): intensity of the spectrum.
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
.
Johannes Rainer
createCompDb()
for the function to create a CompDb database with
compound annotation and spectrum data.
Other spectrum data import functions.:
msms_spectra_hmdb()
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.