Learn R Programming

OrgMassSpecR (version 0.5-3)

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 = "", 
            remove.placeholders = TRUE)

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.

remove.placeholders

TRUE or FALSE specifying if zero intensity peaks in the MSP file should be removed from the resulting data frame.

Value

A data frame with the following column names:

mz

the centroid m/z values.

intensity

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

See Also

ReadMspDirectory

Examples

Run this code
# NOT RUN {
ReadMspFile(paste(system.file(package = "OrgMassSpecR"), "/extdata/msp/pentaBDE.msp", sep = ""))
# }

Run the code above in your browser using DataLab