OpenMS
Loading...
Searching...
No Matches
DIAChromHandler Class Reference

IChromatogramHandler implementation for DIA / SWATH / PRM / PASEF-DIA acquisitions, where chromatograms are extracted from full-scan MS2 data rather than being directly acquired as SRM/MRM traces. More...

#include <OpenMS/ANALYSIS/TARGETED/DIAChromHandler.h>

Inheritance diagram for DIAChromHandler:
[legend]
Collaboration diagram for DIAChromHandler:
[legend]

Public Member Functions

 DIAChromHandler ()=default
 
 ~DIAChromHandler () override=default
 
std::vector< MSChromatogramcollectIrtChromatogramsForIrt (const std::vector< OpenSwath::SwathMap > &swath_maps, const OpenSwath::LightTargetedExperiment &irt_transitions, const Param &mrm_mapping_param, const ChromExtractParams &cp, const TransformationDescription &trafo=TransformationDescription(), bool pasef=false, bool load_into_memory=false) override
 Extract chromatograms for the iRT calibration transitions from each non-MS1 SWATH map.
 
std::vector< MSChromatogramextractAndMapChromatogramsForTransitions (const std::vector< OpenSwath::SwathMap > &swath_maps, const OpenSwath::LightTargetedExperiment &transition_exp, const ChromExtractParams &cp, const Param &mrm_mapping_param) override
 Extract chromatograms for the analytical transitions from each non-MS1 SWATH map.
 
- Public Member Functions inherited from IChromatogramHandler
 IChromatogramHandler ()=default
 
virtual ~IChromatogramHandler ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from IChromatogramHandler
static std::unique_ptr< IChromatogramHandlercreateDefault ()
 Factory: create the default handler (currently SRM/MRM-based)
 

Detailed Description

IChromatogramHandler implementation for DIA / SWATH / PRM / PASEF-DIA acquisitions, where chromatograms are extracted from full-scan MS2 data rather than being directly acquired as SRM/MRM traces.

DIAChromHandler is the DIA-shaped sibling of MRMChromHandler. The two implement the same IChromatogramHandler interface but differ in where their chromatograms come from:

  • MRMChromHandler selects pre-acquired SRM/MRM chromatograms that were stored alongside the spectra and maps them to the target transitions.
  • DIAChromHandler extracts new chromatograms from full-scan MS2 (SWATH) data using ChromatogramExtractor. Mapping back to transitions is handled implicitly by ChromatogramExtractor::return_chromatogram, which assigns the transition native IDs to the extracted traces; the mrm_mapping_param argument of either method is therefore silently ignored.

DefaultChromHandler is a thin dispatcher that owns one of each and forwards to whichever variant matches the run's acquisition mode.

PASEF support

Both override methods accept a pasef flag. When set, the handler performs an extra precursor-matching pass that requires every transition to carry a valid precursor IM value (via LightTransition::getPrecursorIM); transitions are then routed to the SWATH window whose IM range covers their precursor (see OpenSwathHelper::selectSwathTransitionsPasef). Without the flag the standard m/z-only window selection is used.

In-memory acceleration

When load_into_memory is true the swath maps are wrapped in SpectrumAccessOpenMSInMemory before extraction, eliminating repeated disk I/O at the cost of holding the spectra in RAM for the duration of the call. Recommended for iRT calibration on small iRT-transition lists.

See also
IChromatogramHandler
MRMChromHandler
DefaultChromHandler
ChromatogramExtractor

Constructor & Destructor Documentation

◆ DIAChromHandler()

DIAChromHandler ( )
default

◆ ~DIAChromHandler()

~DIAChromHandler ( )
overridedefault

Member Function Documentation

◆ collectIrtChromatogramsForIrt()

std::vector< MSChromatogram > collectIrtChromatogramsForIrt ( const std::vector< OpenSwath::SwathMap > &  swath_maps,
const OpenSwath::LightTargetedExperiment irt_transitions,
const Param mrm_mapping_param,
const ChromExtractParams cp,
const TransformationDescription trafo = TransformationDescription(),
bool  pasef = false,
bool  load_into_memory = false 
)
overridevirtual

Extract chromatograms for the iRT calibration transitions from each non-MS1 SWATH map.

Per-map workflow:

  • MS1 maps are skipped.
  • In PASEF mode (pasef true), every transition is required to carry a valid precursor IM and OpenSwathHelper::selectSwathTransitionsPasef picks one map per transition by matching precursor IM/m/z.
  • Otherwise, OpenSwathHelper::selectSwathTransitions picks the transitions whose precursor m/z falls into the map's [lower, upper] window.
  • If no transitions match but the map is chromatogram-only (zero spectra, non-zero chromatograms), the full irt_transitions list is used as fallback so that native-ID matching against pre-acquired chromatograms can still happen.
  • The RT trafo is inverted and applied to the per-coordinate start/end times when cp.rt_extraction_window >= 0.
  • Chromatograms are extracted via ChromatogramExtractor::extractChromatograms and materialised by ChromatogramExtractor::return_chromatogram, which also assigns the transition native IDs (so a separate MRMMapping pass is not needed).
  • Per-chromatogram TIC is checked; chromatograms with TIC == 0 (empty extraction window) are dropped and logged.

The outer loop over swath maps is OpenMP-parallel; the result vector is updated under a critical section.

Parameters
[in]swath_mapsList of SWATH maps to extract from (MS1 maps are skipped).
[in]irt_transitionsiRT calibration transitions (precursor and product info).
[in]mrm_mapping_paramCurrently unused (no MRMMapping pass is run); kept only to satisfy the IChromatogramHandler interface.
[in]cpChromatogram extraction parameters (window widths, RT range, etc.).
[in]trafoRT transformation; default is identity. Inverted before being applied to extraction coordinates.
[in]pasefIf true, route transitions to maps by precursor IM in addition to m/z; every transition must have a valid getPrecursorIM value.
[in]load_into_memoryIf true, wrap each map in SpectrumAccessOpenMSInMemory before extracting.
Returns
Non-empty (TIC > 0) iRT chromatograms in extraction order.
Exceptions
Exception::InvalidParameterwhen pasef is true and any iRT transition has getPrecursorIM == -1.

Implements IChromatogramHandler.

◆ extractAndMapChromatogramsForTransitions()

std::vector< MSChromatogram > extractAndMapChromatogramsForTransitions ( const std::vector< OpenSwath::SwathMap > &  swath_maps,
const OpenSwath::LightTargetedExperiment transition_exp,
const ChromExtractParams cp,
const Param mrm_mapping_param 
)
overridevirtual

Extract chromatograms for the analytical transitions from each non-MS1 SWATH map.

For every non-MS1 swath map with a non-null spectrum-access pointer, the entire transition_exp is handed to ChromatogramExtractor::prepare_coordinates (no per-window precursor-m/z filtering is performed here), the chromatograms are extracted via ChromatogramExtractor::extractChromatograms, then ChromatogramExtractor::return_chromatogram populates them and assigns native IDs from the transition list directly. Extraction failures (any std::exception thrown by the extractor) on a single map are caught and logged at DEBUG, then the loop continues with the next map.

Mapping to transitions is therefore done implicitly via the native IDs assigned by ChromatogramExtractor — no separate MRMMapping pass is run, and the result is the concatenation of everything extracted (no per-map filtering down to a "mapped subset" either).

Parameters
[in]swath_mapsList of SWATH maps to extract from. MS1 maps and maps with a null sptr are skipped.
[in]transition_expAnalytical transition list (passed in full to every non-skipped map).
[in]cpChromatogram extraction parameters (window widths, RT range, etc.).
[in]mrm_mapping_paramCurrently unused (no MRMMapping pass is run in the DIA handler); kept only to satisfy the IChromatogramHandler interface.
Returns
All extracted chromatograms with their native IDs set by ChromatogramExtractor::return_chromatogram.

Implements IChromatogramHandler.