OpenMS
SpectrumAnnotator Class Reference

Annotates spectra from identifications and theoretical spectra or identifications from spectra and theoretical spectra matching with various options. More...

#include <OpenMS/CHEMISTRY/SpectrumAnnotator.h>

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

Public Member Functions

Constructors and Destructors
 SpectrumAnnotator ()
 default constructor More...
 
 SpectrumAnnotator (const SpectrumAnnotator &source)
 copy constructor More...
 
 ~SpectrumAnnotator () override
 destructor More...
 
SpectrumAnnotatoroperator= (const SpectrumAnnotator &tsg)
 assignment operator More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 

Available annotators

bool basic_statistics_
 
bool list_of_ions_matched_
 
bool max_series_
 
bool SN_statistics_
 
bool precursor_statistics_
 
unsigned topNmatch_fragmenterrors_
 
bool fragmenterror_statistics_
 
bool terminal_series_match_ratio_
 
static const boost::regex nt_regex_
 
static const boost::regex ct_regex_
 
static const boost::regex noloss_regex_
 
static const boost::regex seriesposition_regex_
 
void annotateMatches (PeakSpectrum &spec, const PeptideHit &ph, const TheoreticalSpectrumGenerator &tg, const SpectrumAlignment &sa) const
 Adds ion match annotation to the spec input spectrum. More...
 
void addIonMatchStatistics (PeptideIdentification &pi, MSSpectrum &spec, const TheoreticalSpectrumGenerator &tg, const SpectrumAlignment &sa) const
 Adds ion match statistics to pi PeptideIdentifcation. More...
 
void updateMembers_ () override
 overwrite More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Detailed Description

Annotates spectra from identifications and theoretical spectra or identifications from spectra and theoretical spectra matching with various options.

Constructor & Destructor Documentation

◆ SpectrumAnnotator() [1/2]

default constructor

◆ SpectrumAnnotator() [2/2]

SpectrumAnnotator ( const SpectrumAnnotator source)

copy constructor

◆ ~SpectrumAnnotator()

~SpectrumAnnotator ( )
override

destructor

Member Function Documentation

◆ addIonMatchStatistics()

void addIonMatchStatistics ( PeptideIdentification pi,
MSSpectrum spec,
const TheoreticalSpectrumGenerator tg,
const SpectrumAlignment sa 
) const

Adds ion match statistics to pi PeptideIdentifcation.

Parameters
piA spectrum identifications to be annotated, looking up matches from a spectrum and the theoretical spectrum inferred from the identifications sequence
specA PeakSpectrum containing the peaks from which the pi identifications are made
tgA TheoreticalSpectrumGenerator to infer the theoretical spectrum. Its own parameters define which ion types are referred
saA SpectrumAlignment to match the theoretical spectrum with the measured. Its own parameters define the match tolerance

The ion match statistics are added as UserParams to either the PeptideIdentification (parameters of the matching) and PeptideHit. The parameters of the TheoreticalSpectrumGenerator define the comprehensiveness of the available matching. The parameters of SpectrumAlignment define the matching tolerance. See the parameter section of this class for the available statistics.

◆ annotateMatches()

void annotateMatches ( PeakSpectrum spec,
const PeptideHit ph,
const TheoreticalSpectrumGenerator tg,
const SpectrumAlignment sa 
) const

Adds ion match annotation to the spec input spectrum.

Parameters
specA PeakSpectrum containing the peaks from which the pi identifications are made
phA spectrum identifications to be used for the annotation, looking up matches from a spectrum and the theoretical spectrum inferred from the identifications sequence
tgA TheoreticalSpectrumGenerator to infer the theoretical spectrum. Its own parameters define which ion types are referred
saA SpectrumAlignment to match the theoretical spectrum with the measured. Its own parameters define the match tolerance

The matches are added as DataArrays to the spectrum (Names: IonName and IonMatchError). The parameters of the TheoreticalSpectrumGenerator define the comprehensiveness of the available matching. The parameters of SpectrumAlignment define the matching tolerance. See the parameter section of this class for the available options.

◆ operator=()

SpectrumAnnotator& operator= ( const SpectrumAnnotator tsg)

assignment operator

◆ updateMembers_()

void updateMembers_ ( )
overridevirtual

overwrite

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ basic_statistics_

bool basic_statistics_
protected

◆ ct_regex_

const boost::regex ct_regex_
staticprotected

◆ fragmenterror_statistics_

bool fragmenterror_statistics_
protected

◆ list_of_ions_matched_

bool list_of_ions_matched_
protected

◆ max_series_

bool max_series_
protected

◆ noloss_regex_

const boost::regex noloss_regex_
staticprotected

◆ nt_regex_

const boost::regex nt_regex_
staticprotected

◆ precursor_statistics_

bool precursor_statistics_
protected

◆ seriesposition_regex_

const boost::regex seriesposition_regex_
staticprotected

◆ SN_statistics_

bool SN_statistics_
protected

◆ terminal_series_match_ratio_

bool terminal_series_match_ratio_
protected

◆ topNmatch_fragmenterrors_

unsigned topNmatch_fragmenterrors_
protected