readMgf {MsBackendMgf}R Documentation

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().

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

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


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

readMgf(fls)

[Package MsBackendMgf version 1.1.3 Index]