Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
MapAlignmentAlgorithmIdentification Class Reference

A map alignment algorithm based on peptide identifications from MS2 spectra. More...

#include <OpenMS/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.h>

Inheritance diagram for MapAlignmentAlgorithmIdentification:
MapAlignmentAlgorithm DefaultParamHandler ProgressLogger

Public Member Functions

 MapAlignmentAlgorithmIdentification ()
 Default constructor. More...
 
virtual ~MapAlignmentAlgorithmIdentification ()
 Destructor. More...
 
virtual void alignPeakMaps (std::vector< MSExperiment<> > &, std::vector< TransformationDescription > &)
 Aligns peak maps. More...
 
virtual void alignFeatureMaps (std::vector< FeatureMap<> > &, std::vector< TransformationDescription > &)
 Aligns feature maps. More...
 
virtual void alignConsensusMaps (std::vector< ConsensusMap > &, std::vector< TransformationDescription > &)
 Aligns consensus maps. More...
 
virtual void alignPeptideIdentifications (std::vector< std::vector< PeptideIdentification > > &, std::vector< TransformationDescription > &)
 Aligns peptide identifications. More...
 
virtual void setReference (Size reference_index=0, const String &reference_file="")
 Defines a reference for the alignment. More...
 
template<typename MapType >
void alignMaps (std::vector< MapType > &maps, std::vector< TransformationDescription > &transformations)
 Align feature maps or consensus maps. More...
 
- Public Member Functions inherited from MapAlignmentAlgorithm
 MapAlignmentAlgorithm ()
 Default constructor. More...
 
virtual ~MapAlignmentAlgorithm ()
 Destructor. More...
 
virtual void alignCompactFeatureMaps (std::vector< std::vector< Peak2D > > &, std::vector< TransformationDescription > &)
 Aligns vectors of 2D peaks (memory efficient version of FeatureMap) 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...
 
virtual 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...
 
 ~ProgressLogger ()
 Destructor. 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 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 () const
 Ends the progress display. More...
 

Static Public Member Functions

static MapAlignmentAlgorithmcreate ()
 Creates a new instance of this class (for Factory) More...
 
static String getProductName ()
 Returns the product name (for the Factory) More...
 
- Static Public Member Functions inherited from MapAlignmentAlgorithm
static void fitModel (const String &model_type, const Param &params, std::vector< TransformationDescription > &trafos)
 Fits a model with given parameters to the transformations. More...
 
static void registerChildren ()
 Register all derived classes in this method. More...
 

Protected Types

typedef std::map< String,
DoubleList
SeqToList
 Type to store retention times given for individual peptide sequences. More...
 
typedef std::map< String,
DoubleReal
SeqToValue
 Type to store one representative retention time per peptide sequence. More...
 

Protected Member Functions

void computeMedians_ (SeqToList &rt_data, SeqToValue &medians, bool sorted=false)
 Compute the median retention time for each peptide sequence. More...
 
bool hasGoodHit_ (PeptideIdentification &peptide)
 Check if peptide ID contains a hit that passes the significance threshold score_threshold_ (list of peptide hits will be sorted) More...
 
void getRetentionTimes_ (std::vector< PeptideIdentification > &peptides, SeqToList &rt_data)
 Collect retention time data ("RT" MetaInfo) from peptide IDs. More...
 
void getRetentionTimes_ (MSExperiment<> &experiment, SeqToList &rt_data)
 Collect retention time data ("RT" MetaInfo) from peptide IDs annotated to spectra. More...
 
template<typename MapType >
void getRetentionTimes_ (MapType &features, SeqToList &rt_data)
 Collect retention time data ("RT" MetaInfo) from peptide IDs contained in feature maps or consensus maps. More...
 
void computeTransformations_ (std::vector< SeqToList > &rt_data, std::vector< TransformationDescription > &transforms, bool sorted=false)
 Compute retention time transformations from RT data grouped by peptide sequence. More...
 
void checkParameters_ (const Size runs)
 Check that parameter values are valid. More...
 
void getReference_ ()
 Get reference retention times. 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...
 

Protected Attributes

Size reference_index_
 Index of input file to use as reference (1-based!) More...
 
SeqToValue reference_
 Reference retention times (per peptide sequence) More...
 
DoubleReal score_threshold_
 Score threshold for peptide hits. More...
 
Size min_run_occur_
 Minimum number of runs a peptide must occur in. 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_
 
SignedSize begin_
 
SignedSize end_
 
SignedSize value_
 
QProgressDialog * dlg_
 
StopWatch stop_watch_
 
time_t last_invoke_
 

Private Member Functions

 MapAlignmentAlgorithmIdentification (const MapAlignmentAlgorithmIdentification &)
 Copy constructor intentionally not implemented -> private. More...
 
MapAlignmentAlgorithmIdentificationoperator= (const MapAlignmentAlgorithmIdentification &)
 Assignment operator intentionally not implemented -> private. More...
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD, GUI, NONE }
 Possible log types. More...
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

A map alignment algorithm based on peptide identifications from MS2 spectra.

PeptideIdentification instances are grouped by sequence of the respective best-scoring PeptideHit (provided the score is good enough) and retention time data is collected from the "RT" MetaInfo entries. ID groups with the same sequence in different maps represent points of correspondence between the maps and form the basis of the alignment.

Each map is aligned to a reference retention time scale. This time scale can either come from a reference file (reference parameter) or be computed as a consensus of the input maps (median retention times over all maps of the ID groups). The maps are then aligned to this scale as follows:
The median retention time of each ID group in a map is mapped to the reference retention time of this group. Cubic spline smoothing is used to convert this mapping to a smooth function. Retention times in the map are transformed to the consensus scale by applying this function.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
peptide_score_threshold float0  Score threshold for peptide hits to be used in the alignment.
Select a value that allows only 'high confidence' matches.
min_run_occur int2 min: 2Minimum number of runs (incl. reference, if any) a peptide must occur in to be used for the alignment.
Unless you have very few runs or identifications, increase this value to focus on more informative peptides.
max_rt_shift float0.5 min: 0Maximum realistic RT difference for a peptide (median per run vs. reference). Peptides with higher shifts (outliers) are not used to compute the alignment.
If 0, no limit (disable filter); if > 1, the final value in seconds; if <= 1, taken as a fraction of the range of the reference RT scale.
use_unassigned_peptides stringtrue true, falseShould unassigned peptide identifications be used when computing an alignment of feature maps? If 'false', only peptide IDs assigned to features will be used.
use_feature_rt stringfalse true, falseWhen aligning feature maps, don't use the retention time of a peptide identification directly; instead, use the retention time of the centroid of the feature (apex of the elution profile) that the peptide was matched to. If different identifications are matched to one feature, only the peptide closest to the centroid in RT is used.
Precludes 'use_unassigned_peptides'.

Note:

Member Typedef Documentation

typedef std::map<String, DoubleList> SeqToList
protected

Type to store retention times given for individual peptide sequences.

typedef std::map<String, DoubleReal> SeqToValue
protected

Type to store one representative retention time per peptide sequence.

Constructor & Destructor Documentation

Default constructor.

Destructor.

Copy constructor intentionally not implemented -> private.

Member Function Documentation

virtual void alignConsensusMaps ( std::vector< ConsensusMap > &  ,
std::vector< TransformationDescription > &   
)
virtual

Aligns consensus maps.

Exceptions
Exception::NotImplementedis thrown if an algorithm cannot align consensus maps

Reimplemented from MapAlignmentAlgorithm.

virtual void alignFeatureMaps ( std::vector< FeatureMap<> > &  ,
std::vector< TransformationDescription > &   
)
virtual

Aligns feature maps.

Exceptions
Exception::NotImplementedis thrown if an algorithm cannot align feature maps

Reimplemented from MapAlignmentAlgorithm.

void alignMaps ( std::vector< MapType > &  maps,
std::vector< TransformationDescription > &  transformations 
)
inline

Align feature maps or consensus maps.

Since the method of aligning feature and consensus maps is equal for this algorithm, alignFeatureMaps and alignConsensusMaps are only defined in conformance with the interface and forward to this method.

Parameters
mapsVector maps (FeatureMap or ConsensusMap) that should be aligned.
transformationsVector of TransformationDescription that will be computed.
virtual void alignPeakMaps ( std::vector< MSExperiment<> > &  ,
std::vector< TransformationDescription > &   
)
virtual

Aligns peak maps.

Exceptions
Exception::NotImplementedis thrown if an algorithm cannot align peak maps

Reimplemented from MapAlignmentAlgorithm.

virtual void alignPeptideIdentifications ( std::vector< std::vector< PeptideIdentification > > &  ,
std::vector< TransformationDescription > &   
)
virtual

Aligns peptide identifications.

Exceptions
Exception::NotImplementedis thrown if an algorithm cannot align peptide identifications

Reimplemented from MapAlignmentAlgorithm.

void checkParameters_ ( const Size  runs)
protected

Check that parameter values are valid.

Currently only 'min_run_occur' is checked.

Parameters
runsNumber of runs (input files) to be aligned
void computeMedians_ ( SeqToList rt_data,
SeqToValue medians,
bool  sorted = false 
)
protected

Compute the median retention time for each peptide sequence.

Parameters
rt_dataLists of RT values for diff. peptide sequences (input, will be sorted)
mediansMedian RT values for the peptide sequences (output)
sortedAre RT lists already sorted? (see median_)
Exceptions
Exception::IllegalArgumentif the input list is empty
void computeTransformations_ ( std::vector< SeqToList > &  rt_data,
std::vector< TransformationDescription > &  transforms,
bool  sorted = false 
)
protected

Compute retention time transformations from RT data grouped by peptide sequence.

Parameters
rt_dataLists of RT values for diff. peptide sequences, per dataset (input, will be sorted)
transformsResulting transformations, per dataset (output)
sortedAre RT lists already sorted? (see median_)
static MapAlignmentAlgorithm* create ( )
inlinestatic

Creates a new instance of this class (for Factory)

static String getProductName ( )
inlinestatic

Returns the product name (for the Factory)

void getReference_ ( )
protected

Get reference retention times.

If a reference file is supplied via the reference parameter, extract retention time information and store it in reference_.

void getRetentionTimes_ ( std::vector< PeptideIdentification > &  peptides,
SeqToList rt_data 
)
protected

Collect retention time data ("RT" MetaInfo) from peptide IDs.

Parameters
peptidesInput peptide IDs (lists of peptide hits will be sorted)
rt_dataLists of RT values for diff. peptide sequences (output)
void getRetentionTimes_ ( MSExperiment<> &  experiment,
SeqToList rt_data 
)
protected

Collect retention time data ("RT" MetaInfo) from peptide IDs annotated to spectra.

Parameters
experimentInput map for RT data
rt_dataLists of RT values for diff. peptide sequences (output)
void getRetentionTimes_ ( MapType &  features,
SeqToList rt_data 
)
protected

Collect retention time data ("RT" MetaInfo) from peptide IDs contained in feature maps or consensus maps.

The following global flags (mutually exclusive) influence the processing:
Depending on use_unassigned_peptides, unassigned peptide IDs are used in addition to IDs annotated to features.
Depending on use_feature_rt, feature retention times are used instead of peptide retention times.

Parameters
featuresInput features for RT data
rt_dataLists of RT values for diff. peptide sequences (output)
bool hasGoodHit_ ( PeptideIdentification peptide)
protected

Check if peptide ID contains a hit that passes the significance threshold score_threshold_ (list of peptide hits will be sorted)

Assignment operator intentionally not implemented -> private.

virtual void setReference ( Size  reference_index = 0,
const String reference_file = "" 
)
virtual

Defines a reference for the alignment.

Parameters
reference_indexIndex of input file to use as reference (1-based!)
reference_filePath to external reference file
Exceptions
Exception::InvalidParameteris thrown if the algorithm does not support references

Reimplemented from MapAlignmentAlgorithm.

Member Data Documentation

Size min_run_occur_
protected

Minimum number of runs a peptide must occur in.

SeqToValue reference_
protected

Reference retention times (per peptide sequence)

Size reference_index_
protected

Index of input file to use as reference (1-based!)

DoubleReal score_threshold_
protected

Score threshold for peptide hits.


OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:26 using doxygen 1.8.5