Learn R Programming

metamorphr (version 0.2.0)

read_mgf: Read a MGF file into a tidy tibble

Description

MGF files allow the storage of MS/MS spectra. With this function they can be read into a tidy tibble. Each variable is stored in a column and each ion (observation) is stored in a separate row. MS/MS spectra are stored in a list column named MSn.
Please note that MGF files are software-specific so the variables and their names may vary. This function was developed with the GNPS file format exported from mzmine in mind.

Usage

read_mgf(file, show_progress = TRUE)

Value

A tidy tibble holding MS/MS spectra.

Arguments

file

The path to the MGF file.

show_progress

A logical indicating whether the progress of the import should be printed to the console. Only important for large MGF files.

Examples

Run this code
mgf_path <- system.file("extdata", "toy_mgf.mgf", package = "metamorphr")
read_mgf(mgf_path)

Run the code above in your browser using DataLab