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

Dispatching chromatogram handler that picks SRM/MRM or DIA at runtime based on the input maps. More...

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

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

Public Member Functions

 DefaultChromHandler ()
 Default constructor; eagerly constructs the inner SRM/MRM and DIA handlers.
 
 ~DefaultChromHandler () override
 Destructor.
 
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
 Collect iRT chromatograms by delegating to the SRM/MRM or DIA handler.
 
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 and map analytical transition chromatograms via the SRM/MRM or DIA handler.
 
- Public Member Functions inherited from IChromatogramHandler
 IChromatogramHandler ()=default
 
virtual ~IChromatogramHandler ()=default
 

Private Attributes

std::unique_ptr< MRMChromHandlermrm_
 Inner SRM/MRM handler; selected when all input maps are chromatogram-only.
 
std::unique_ptr< DIAChromHandlerdia_
 Inner DIA handler; selected when at least one input map carries MS1 or spectra.
 

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

Dispatching chromatogram handler that picks SRM/MRM or DIA at runtime based on the input maps.

Wraps an MRMChromHandler and a DIAChromHandler and forwards each call to whichever is appropriate for the supplied SWATH maps. The mode is decided on every call by inspecting swath_maps:

  • If every map is chromatogram-only (neither flagged as MS1 nor carrying any spectra), the call is routed to the SRM/MRM handler.
  • Otherwise (any map flagged ms1 or carrying at least one spectrum), the call is routed to the DIA handler.

SRM/MRM error handling: when the SRM/MRM path raises Exception::IllegalArgument (typically "no chromatograms mapped to transitions" — common for chromatogram-only inputs whose precursor/product m/z don't match the supplied transition list), the exception is logged as a warning and an empty vector is returned. All other exceptions, and any exception raised on the DIA path, propagate to the caller.

Construction is cheap (default-constructs both inner handlers up front); no input data is inspected until the first call.

Constructor & Destructor Documentation

◆ DefaultChromHandler()

Default constructor; eagerly constructs the inner SRM/MRM and DIA handlers.

◆ ~DefaultChromHandler()

~DefaultChromHandler ( )
override

Destructor.

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

Collect iRT chromatograms by delegating to the SRM/MRM or DIA handler.

Routing rule: SRM/MRM if every swath_maps entry is chromatogram-only (neither ms1 nor any spectra), DIA otherwise. On the SRM/MRM path, Exception::IllegalArgument ("no chromatograms mapped") is logged and converted to an empty result; all other exceptions propagate unchanged.

Parameters
[in]swath_mapsInput maps (mixed-mode allowed; the per-map check decides routing).
[in]irt_transitionsiRT transition list used for mapping.
[in]mrm_mapping_paramParameters forwarded to the MRMMapping step.
[in]cpChromatogram-extraction parameters (windows, RT range, etc.).
[in]trafoOptional RT transformation applied to iRT transitions.
[in]pasefIf true, enable PASEF/ion-mobility-aware mapping in the delegate.
[in]load_into_memoryIf true, materialise on-disk data before extraction.
Returns
Mapped iRT chromatograms (empty on the recoverable SRM/MRM "no mapping" case).
Exceptions
Exception::BaseExceptionPropagated for non-recoverable SRM/MRM delegate failures and all DIA-path exceptions.
Note
On the SRM/MRM path, Exception::IllegalArgument ("no chromatograms mapped") is logged and converted to an empty result.

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 and map analytical transition chromatograms via the SRM/MRM or DIA handler.

Routing rule and error handling are identical to collectIrtChromatogramsForIrt(): SRM/MRM for chromatogram-only inputs (where Exception::IllegalArgument is downgraded to an empty result), DIA otherwise (all exceptions propagate).

Parameters
[in]swath_mapsInput maps (mixed-mode allowed; the per-map check decides routing).
[in]transition_expAnalytical transition list to map against.
[in]cpChromatogram-extraction parameters.
[in]mrm_mapping_paramParameters forwarded to the MRMMapping step.
Returns
Mapped, filtered chromatograms ready for downstream scoring.
Exceptions
Exception::BaseExceptionPropagated for non-recoverable SRM/MRM delegate failures and all DIA-path exceptions.
Note
On the SRM/MRM path, Exception::IllegalArgument ("no chromatograms mapped") is logged and converted to an empty result.

Implements IChromatogramHandler.

Member Data Documentation

◆ dia_

std::unique_ptr<DIAChromHandler> dia_
private

Inner DIA handler; selected when at least one input map carries MS1 or spectra.

◆ mrm_

std::unique_ptr<MRMChromHandler> mrm_
private

Inner SRM/MRM handler; selected when all input maps are chromatogram-only.