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

Scoring of an spectrum given library intensities of a transition group. More...

#include <OpenMS/ANALYSIS/OPENSWATH/DIAPrescoring.h>

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

Classes

struct  TransitionGroupTheoreticalSpectrumCache
 Cached transition-group-specific theoretical spectrum used by the DIA prescore. More...
 

Public Member Functions

 DiaPrescore ()
 
 DiaPrescore (double dia_extract_window, int nr_isotopes=4, int nr_charges=4)
 
void defineDefaults ()
 
void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method.
 
void score (const SpectrumSequence &spec, const std::vector< OpenSwath::LightTransition > &lt, const RangeMobility &im_range, double &dotprod, double &manhattan) const
 Score one or more observed spectra for a transition group.
 
void buildTheoreticalSpectrum (const std::vector< OpenSwath::LightTransition > &lt, TransitionGroupTheoreticalSpectrumCache &theoretical_spectrum_cache) const
 Build the theoretical DIA isotope spectrum cache for repeated scoring.
 
void operator() (const OpenSwath::SpectrumAccessPtr &swath_ptr, OpenSwath::LightTargetedExperiment &transition_exp_used, const RangeMobility &range_im, OpenSwath::IDataFrameWriter *ivw) const
 Compute Manhattan and dot-product scores for all spectra accessible through the SpectrumAccessPtr.
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const std::string &name)
 Constructor with name that is displayed in error messages.
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor.
 
virtual ~DefaultParamHandler ()
 Destructor.
 
DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator.
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator.
 
void setParameters (const Param &param)
 Sets the parameters.
 
const ParamgetParameters () const
 Non-mutable access to the parameters.
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters.
 
const std::string & getName () const
 Non-mutable access to the name.
 
void setName (const std::string &name)
 Mutable access to the name.
 
const std::vector< std::string > & getSubsections () const
 Non-mutable access to the registered subsections.
 

Static Public Member Functions

static void scorePrepared (const SpectrumSequence &spec, const TransitionGroupTheoreticalSpectrumCache &theoretical_spectrum_cache, double dia_extract_window, const RangeMobility &im_range, double &dotprod, double &manhattan)
 Score an observed spectrum sequence against a precomputed theoretical DIA spectrum.
 
- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const std::string &key_prefix="")
 Writes all parameters to meta values.
 

Private Attributes

double dia_extract_window_
 
int nr_isotopes_
 
int nr_charges_
 

Additional Inherited Members

- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor.
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters.
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes!
 
std::vector< std::string > subsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes!
 
std::string error_name_
 Name that is displayed in error messages during the parameter checking.
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;.
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;.
 

Detailed Description

Scoring of an spectrum given library intensities of a transition group.

In DIA (data independent acquisition) / SWATH analysis, at each chromatographic point a full MS2 spectrum is recorded. This class allows to compute a number of scores based on the full MS2 spectrum available. The scores are the following:

See also class DIAScoring.

Simulate theoretical spectrum from library intensities of transition group and compute manhattan distance and dotprod score between spectrum intensities and simulated spectrum.

Constructor & Destructor Documentation

◆ DiaPrescore() [1/2]

◆ DiaPrescore() [2/2]

DiaPrescore ( double  dia_extract_window,
int  nr_isotopes = 4,
int  nr_charges = 4 
)

Member Function Documentation

◆ buildTheoreticalSpectrum()

void buildTheoreticalSpectrum ( const std::vector< OpenSwath::LightTransition > &  lt,
TransitionGroupTheoreticalSpectrumCache theoretical_spectrum_cache 
) const

Build the theoretical DIA isotope spectrum cache for repeated scoring.

The transition-group-specific theoretical spectrum cache depends only on the transition group and DiaPrescore parameters, not on the observed spectrum.

Parameters
[in]ltLibrary transitions for the transition group
[out]theoretical_spectrum_cachePrecomputed theoretical spectrum cache

◆ defineDefaults()

void defineDefaults ( )

◆ operator()()

void operator() ( const OpenSwath::SpectrumAccessPtr swath_ptr,
OpenSwath::LightTargetedExperiment transition_exp_used,
const RangeMobility range_im,
OpenSwath::IDataFrameWriter ivw 
) const

Compute Manhattan and dot-product scores for all spectra accessible through the SpectrumAccessPtr.

Scores all transition groups in the LightTargetedExperiment against the spectra provided by swath_ptr and writes the per-spectrum score vectors to ivw.

◆ score()

void score ( const SpectrumSequence spec,
const std::vector< OpenSwath::LightTransition > &  lt,
const RangeMobility im_range,
double &  dotprod,
double &  manhattan 
) const

Score one or more observed spectra for a transition group.

Builds the transition-group-specific theoretical spectrum cache from the library intensities and compares it against the observed spectrum sequence. The input may contain multiple adjacent MS2 spectra / frames around the apex or a single pre-merged spectrum, depending on the upstream merge mode.

◆ scorePrepared()

static void scorePrepared ( const SpectrumSequence spec,
const TransitionGroupTheoreticalSpectrumCache theoretical_spectrum_cache,
double  dia_extract_window,
const RangeMobility im_range,
double &  dotprod,
double &  manhattan 
)
static

Score an observed spectrum sequence against a precomputed theoretical DIA spectrum.

The observed input may be a single merged spectrum or multiple spectra / frames around the feature apex, depending on the configured spectrum addition mode.

Parameters
[in]specObserved spectrum sequence around the feature apex
[in]theoretical_spectrum_cachePrecomputed theoretical spectrum cache
[in]dia_extract_windowDIA extraction window in Th
[in]im_rangeIon mobility extraction range
[out]dotprodDot product score
[out]manhattanManhattan distance score

◆ updateMembers_()

void updateMembers_ ( )
overridevirtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ dia_extract_window_

double dia_extract_window_
private

◆ nr_charges_

int nr_charges_
private

◆ nr_isotopes_

int nr_isotopes_
private