MS2extract Part 3 - Behind the curtains of importing MS/MS data


Daniel Quiroz & Jessica Cooperstone


September 27, 2023

Goal of this vignette

The main objective of this document is to explain in a detailed manner how we import and process MS/MS when you use import_mzxml().

This document is organized based on the main steps we take to import MS/MS data that are:

  • Calculating the theoretical precursor ion,
  • Filtering MS/MS scans for a given precursor ion and rt range, and
  • Finding the most intense MS/MS scan.

Calculating the theoretical precursor ion

One of the main inputs, besides the .mzML data, is the met_metadata data frame used in import_mzxml(). This data frame contains the minimum information to calculate the theoretical precursor ion m/z given the following information:

  • Chemical formula,
  • Ionization polarity, and
  • ppm (mass error)

This process can be depicted in the following image.

Here, we are going to use procyanidin A2 to demonstrate this process. (1) First, by using the Rdisop package, we calculate the theoretical monoisotopic mass. (2) Then, given an specific polarity (Positive or Negative), we add or subtract the mass of a proton to calculate the theoretical ion m/z. (3) Finally, we used the provided ppm value (10 ppm by default) to calculate the m/z range that will be used to filter scan that the precursor ion value falls within this range.

You can also calculate this ppm range with ppm_range()

ppm_range(mz = 575.12604, ppm = 10)
#> [1] 575.1203 575.1318

Filtering MS/MS scans

Using retention time region of interest

Although providing a retention time window is not mandatory, it is highly suggested to provide this information to have more control over the regions of the run that we look for the MS/MS scans. If you do not provide a specific rt ROI, this package will look for the most intense scan, even if that do not represent the desired scans from the provided metabolite.

Filtering using m/z range and rt ROI

Then, after calculating the theoretical m/z range, and knowing the rt ROI, we can look in the data for the MS/MS scans that have this information.

If MS2extract do not find at least one MS/MS scan within the given m/z range and rt ROI, it will stop.

In the following example, the scan in the first row does not meet these requirements, and it is discarded, while the second and third scan falls within these requirements, and are kept for the next steps.