Skip to content

Chromatogram Extraction

jcharkow edited this page Sep 28, 2022 · 2 revisions

1. Mapping Transitions to SWATHs

For a typical workflow in which transitions are only expected to be found in one SWATH, mapping is performed with selectSwathTransitions().
In PRM and PASEF, transitions may be found in more than one SWATH so alternative selection of SWATHs is performed directly in the performExtraction function

  1. PASEF -pasef: Expect SWATHs that may overlap across m/z and IM. If a transition is found in more than one SWATH, select the SWATH in which the transition is most centered across IM.
  2. PRM matching_window_only: Expect SWATHs that may overlap across m/z. If transition found in multiple SWATHs select the SWATH in which the transition is most centered across m/z

2. Preparing the Batches

Compounds/peptides in the library are split up into batches using selectCompoundsForBatch()). The maximum number of compounds in a batch is specified by batchSize. Each batch is a LightTargetedExperiment containing only compounds/peptides in the batch.

3. Perform Extraction

Extraction is performed batchwise using the MS1Extraction_() method for MS1 and directly in the performExtraction() method for MS2 however both call the same helper functions and will thus be discussed simultaneoulsy. Helper functions for preparing coordinates are found in the ChromatogramExtractor class and functions for extraction are found in the ChromatogramExtractorAlgorithm class.

  1. For each transition/precursor, compute the coordinates of extraction (prepareExtractionCoordinates_(), prepare_coordinates() - signature with LightTargetedExperiment)
    1. Coordinates consist of:
      1. rt_start = precursor_rt - (rt_extraction_window) / 2
      2. rt_end = precursor_rt + (rt_extraction_window) / 2
      3. Id
      4. m/z
      5. Ion Mobility (optional)
  2. Extract Chromatograms (extractChromatograms())
    1. Ensure that the coordinates are sorted by m/z
    2. For each spectrum:
      1. Fetch the m/z and intensity arrays and IM array (if present)
      2. For each transition coordinate:
        1. If the spectrum RT is in range of the transition coordinate RT, perfom extraction (no IM - extract_value_tophat(), with IM - extract_value_tophat())
          1. Compute the m/z range (bounds set in OpenSwath parameters using ppm/Th cutoff)
          2. Add all of the intensities within m/z range (and IM range if set)

4. Write Out Chromatogram

  1. Convert Chromatogram Ptr to MSChromatogram and add metainformation (return_chromatogram())
  2. Write out chromatogram