Description Usage Arguments Details Value Author(s) Examples
Writes all spectra in the OrgMassSpecR data frame format to a single text file in NIST MSP format. The MSP files can be imported into the NIST MS Search program to make a custom seachable library.
1 | WriteMspFile(spectra, metadata, filename = "library.msp", comment = "")
|
spectra |
data frame containing the mass spectra. |
metadata |
data frame containing the metadata. |
filename |
character string. Name (including path if needed) of the MSP text file. |
comment |
charater string applied to the COMMENT field of the MSP file. The comment is applied to all spectra. |
The spectra and metadata data frame format is
specified in the help files for the LibraryReport
functions
in the spectral library packages, for example see
SpecLibExample::LibraryReport
. The spectra data frame must
contain at least columns: filename
, mz
, and
intensity
. The metadata data frame must contain at least columns: filename
and compound
.
The NAME field for each spectrum in the MSP file is assigned
based on compound
in the metadata data frame.
Newlines are CR+LF since the NIST MS Search program is Windows based.
An MSP file is written using a file
connection.
Nathan G. Dodder
1 2 3 4 5 6 7 8 9 | ## Example using SpecLibExample package
## Not run:
library(SpecLibExample)
WriteMspFile(spectra = spec,
metadata = meta,
comment = "example output")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.