readMgf: Reading MGF files The 'readMgf' function imports the data...

Description Usage Arguments Value Author(s) Examples

View source: R/functions-mgf.R

Description

Reading MGF files

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

Usage

1
readMgf(f, msLevel = 2L, mapping = spectraVariableMapping(), ...)

Arguments

f

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

msLevel

numeric(1) with the MS level. Default is 2.

mapping

named character vector to rename mgf fields to spectra variables.

...

Additional parameters, currently ignored.

Value

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

Author(s)

Laurent Gatto, Johannes Rainer

Examples

1
2
3
4
fls <- dir(system.file("extdata", package = "MsBackendMgf"),
    full.names = TRUE, pattern = "mgf$")[1L]

readMgf(fls)

michaelwitting/MsBackendMgf documentation built on April 28, 2021, 5:15 a.m.