Reads mzXML files and extracts relevant MS2 spectra information.

read_mzxml(file, threads = 3, mode = c("inMemory", "onDisk"))

Arguments

file

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

threads

An integer, indicating the number of cores to use (default: 3).

mode

A character string, either "inMemory" or "onDisk" specifying the mode of reading data. Default is "inMemory".

Value

A list containing processed MS2 spectra information for each provided mzXML 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.

Examples

# Locate the example mzXML file in the installed package
file_path <- system.file("extdata", "example.mzXML", package = "masstools")
# Then use it in your function
result <- read_mzxml(file_path)
#> Reading MS2 data...
#> Processing...