ReadMspFile: Read in a MSP Formatted Mass Spectrum
Description
Reads in a .msp file and makes a data frame of m/z values and intensities.
Usage
ReadMspFile(file, skip = 2, comment.char = "")
Arguments
file
character string. The .msp filename. Include the path to the filename if necessary.
skip
integer. The number of lines at the top of the input file to skip before reading. Passed internally to read.table.
comment.char
a character vector of length one containing a single character or an empty string. Use "" to turn off the interpretation of comments altogether. Passed internally to read.table.
Value
A data frame with the following column names:
mzthe centroid m/z values.
intensitythe respective intensities.
Details
MSP is a National Institute of Standards and Technology (NIST) ASCII format for centroid spectra. This format is exported by some instrument software.
The spectral file does not need to have the extension .msp.