readMsp: Reading MSP files

View source: R/functions-msp.R

readMspR Documentation

Reading MSP files

Description

The readMsp function imports the data from a file in MGF format reading all specified fields and returning the data as a DataFrame().

Usage

readMsp(f, msLevel = 2L, mapping = spectraVariableMapping(MsBackendMsp()), ...)

Arguments

f

character(1) with the path to an MSP file.

msLevel

numeric(1) with the MS level. Default is 2. This value will be reported as the spectra's MS level unless the source MSP file defines the MS level.

mapping

named character vector to rename MSP fields to spectra variables (see spectraVariableMapping()). This allows to correctly import also custom fields or data from files with different MSP flavors.

...

Additional parameters, currently ignored.

Value

A DataFrame with each row containing the data from one spectrum in the MSP file. m/z and intensity values are available in columns "mz" and "intensity" in a list representation.

Author(s)

Laurent Gatto, Steffen Neumann, Johannes Rainer

Examples


fls <- dir(system.file("extdata", package = "MsBackendMsp"),
    full.names = TRUE, pattern = "msp$")[1L]

readMsp(fls)

rformassspectrometry/MsBackendMsp documentation built on March 20, 2023, 9:45 a.m.