ReadMspFile {OrgMassSpecR} | R Documentation |
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 = "",
remove.placeholders = TRUE)
Arguments
file |
character string. The |
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. |
remove.placeholders |
TRUE or FALSE specifying if zero intensity peaks in the MSP file should be removed from the resulting data frame. |
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
.
Value
A data frame with the following column names:
mz |
the centroid m/z values. |
intensity |
the respective intensities. |
Author(s)
Nathan G. Dodder
See Also
Examples
ReadMspFile(paste(system.file(package = "OrgMassSpecR"), "/extdata/msp/pentaBDE.msp", sep = ""))