OpenMS
MasstraceCorrelator Class Reference

Correlates individual masstraces found in mass spectrometric maps. More...

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

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

Public Types

typedef std::vector< std::pair< double, double > > MasstracePointsType
 
- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 

Public Member Functions

 MasstraceCorrelator ()
 
 ~MasstraceCorrelator () override
 
void createPseudoSpectra (const ConsensusMap &map, MSExperiment &pseudo_spectra, Size min_peak_nr, double min_correlation, int max_lag, double max_rt_apex_difference)
 
void scoreHullpoints (const MasstracePointsType &hull_points1, const MasstracePointsType &hull_points2, int &lag, double &lag_intensity, double &pearson_score, const double min_corr, const int max_lag, const double mindiff=0.1)
 
void createConsensusMapCache (const ConsensusMap &map, std::vector< MasstracePointsType > &feature_points, std::vector< std::pair< double, double > > &max_intensities, std::vector< double > &rt_cache)
 
- 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...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void setLogger (ProgressLoggerImpl *logger)
 Sets the logger to be used for progress logging. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress (UInt64 bytes_processed=0) const
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Protected Member Functions

void matchMassTraces_ (const MasstracePointsType &hull_points1, const MasstracePointsType &hull_points2, std::vector< double > &vec1, std::vector< double > &vec2, double mindiff, double padEnds=true)
 Match up two mass traces with potentially missing values. More...
 
- Protected Member Functions inherited from DefaultParamHandler
virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. 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 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...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

Correlates individual masstraces found in mass spectrometric maps.

The MasstraceCorrelator offers several functions to correlate individual mass traces using the normalized Cross-Correlation and pearson scoring of the OpenSWATH module.

Member Typedef Documentation

◆ MasstracePointsType

typedef std::vector<std::pair<double, double> > MasstracePointsType

Constructor & Destructor Documentation

◆ MasstraceCorrelator()

◆ ~MasstraceCorrelator()

~MasstraceCorrelator ( )
override

Member Function Documentation

◆ createConsensusMapCache()

void createConsensusMapCache ( const ConsensusMap map,
std::vector< MasstracePointsType > &  feature_points,
std::vector< std::pair< double, double > > &  max_intensities,
std::vector< double > &  rt_cache 
)

◆ createPseudoSpectra()

void createPseudoSpectra ( const ConsensusMap map,
MSExperiment pseudo_spectra,
Size  min_peak_nr,
double  min_correlation,
int  max_lag,
double  max_rt_apex_difference 
)

Compute pseudo-spectra from a set of (MS2) masstraces

This function will take a set of masstraces (consensus map) as input and produce a vector of pseudo spectra as output (pseudo_spectra result vector).

It basically makes an all-vs-all comparison of all masstraces against each other and scores them on how similar they are in their mass traces.

This assumes that the consensus feature is only from one (SWATH) map This assumes that the consensus map is sorted by intensity

◆ matchMassTraces_()

void matchMassTraces_ ( const MasstracePointsType hull_points1,
const MasstracePointsType hull_points2,
std::vector< double > &  vec1,
std::vector< double > &  vec2,
double  mindiff,
double  padEnds = true 
)
protected

Match up two mass traces with potentially missing values.

To compute correlations on masstraces, they need to have the same length and matching points. This function matches two masstraces by RT and identifies points that are the same in retention time (see mindiff parameter) and matches them. If no match is found, a missing value is assumed and they are filled with zeros. Thus, if the two retention times are less than mindiff apart, the two entries are considered to be equal, otherwise one is assumed to be zero).

This is useful for matching mass traces that are not of the exact same length and/or have missing values.

Parameters
hull_points1The first input mass trace
hull_points2The second input mass trace
vec1The intensities of the first mass trace with matched-up points
vec2The intensities of the second mass trace with matched-up points
mindiffThe minimal difference in RT for points to match up
padEndsWhether to pad ends with zeros

◆ scoreHullpoints()

void scoreHullpoints ( const MasstracePointsType hull_points1,
const MasstracePointsType hull_points2,
int &  lag,
double &  lag_intensity,
double &  pearson_score,
const double  min_corr,
const int  max_lag,
const double  mindiff = 0.1 
)