Reads MGF files and extracts the relevant MS2 spectra information. This function is tailored for database-oriented analyses.

read_mgf4database(file)

Arguments

file

A character vector specifying the path(s) to the MGF file(s).

Value

A list containing processed MS2 spectra information for each provided MGF file. Each element of the list contains two components:

  • info: A data frame with columns for the name (composed of m/z and retention time), m/z, retention time, and file name.

  • spec: A data frame where each row represents a fragment ion peak, with columns for m/z and intensity values.

Empty spectra are removed from the output.

Examples

# Assuming 'sample.mgf' is the path to your MGF file.
# mgf_data <- read_mgf4database('sample.mgf')