This function reads Mass Spectrometry (MS) data in MGF format from experimental files, extracts the MS2 spectra, and returns them in a structured format.
read_mgf_experiment(file, threads = 3)
A list where each element contains the MS2 spectra and related metadata for each entry in the MGF file. Each entry includes:
A data frame with metadata (such as m/z, retention time, etc.) for each spectrum.
A data frame containing the `mz` and `intensity` values of the MS2 spectrum.
The function parses MGF files from experimental data, extracting both the metadata and the MS2 spectra, and organizes the data into a structured format for further analysis. Parallel processing is supported to improve efficiency when handling large datasets.
if (FALSE) { # \dontrun{
# Read MGF data from experimental files
mgf_data <- read_mgf_experiment(file = c("path/to/mgf1.mgf", "path/to/mgf2.mgf"))
} # }