1
// -*- mode: C++; tab-width: 2; -*-
4
// --------------------------------------------------------------------------
5
// OpenMS Mass Spectrometry Framework
6
// --------------------------------------------------------------------------
7
// Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
9
// This library is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU Lesser General Public
11
// License as published by the Free Software Foundation; either
12
// version 2.1 of the License, or (at your option) any later version
14
// This library is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
// Lesser General Public License for more details
19
// You should have received a copy of the GNU Lesser General Public
20
// License along with this library; if not, write to the Free Software
21
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
// --------------------------------------------------------------------------
24
// $Maintainer: Clemens Groepl $
25
// $Authors: Marc Sturm, Clemens Groepl $
26
// --------------------------------------------------------------------------
28
#ifndef OPENMS_ANALYSIS_MAPMATCHING_MAPALIGNMENTALGORITHM_H
29
#define OPENMS_ANALYSIS_MAPMATCHING_MAPALIGNMENTALGORITHM_H
31
#include <OpenMS/ANALYSIS/MAPMATCHING/TransformationDescription.h>
32
#include <OpenMS/CONCEPT/Exception.h>
33
#include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
34
#include <OpenMS/CONCEPT/ProgressLogger.h>
35
#include <OpenMS/KERNEL/ConsensusMap.h>
36
#include <OpenMS/KERNEL/FeatureMap.h>
37
#include <OpenMS/KERNEL/MSExperiment.h>
43
@brief Base class for all map-alignment algorithms
45
It takes two or more maps and corrects for retention time distortions.
47
The input maps are transformed and the transformation description is returned.
49
@improvement The maps should not be all loaded before the algorithm - in order to save memory e.g. in the star-wise approach (Clemens)
51
class OPENMS_DLLAPI MapAlignmentAlgorithm
52
: public DefaultParamHandler,
56
/// Default constructor
57
MapAlignmentAlgorithm();
60
virtual ~MapAlignmentAlgorithm();
63
@brief Aligns peak maps
65
@exception Exception::NotImplemented is thrown if an algorithm cannot align peak maps
67
virtual void alignPeakMaps(std::vector< MSExperiment<> >&, std::vector<TransformationDescription>&);
70
@brief Aligns feature maps
72
@exception Exception::NotImplemented is thrown if an algorithm cannot align feature maps
74
virtual void alignFeatureMaps(std::vector< FeatureMap<> >&, std::vector<TransformationDescription>&);
77
@brief Aligns consensus maps
79
@exception Exception::NotImplemented is thrown if an algorithm cannot align consensus maps
81
virtual void alignConsensusMaps(std::vector<ConsensusMap>&, std::vector<TransformationDescription>&);
84
@brief Aligns peptide identifications
86
@exception Exception::NotImplemented is thrown if an algorithm cannot align peptide identifications
88
virtual void alignPeptideIdentifications(std::vector< std::vector< PeptideIdentification > >&, std::vector<TransformationDescription>&);
91
@brief Defines a reference for the alignment
93
@param reference_index Index of input file to use as reference (1-based!)
94
@param reference_file Path to external reference file
96
@exception Exception::InvalidParameter is thrown if the algorithm does not support references
98
virtual void setReference(Size reference_index=0, const String& reference_file="");
100
/// Applies the <i>given</i> transformations to peak maps
101
static void transformPeakMaps( std::vector< MSExperiment<> >& maps, const std::vector<TransformationDescription>& given_trafos );
103
/// Applies the <i>given</i> transformations to feature maps
104
static void transformFeatureMaps( std::vector< FeatureMap<> >& maps, const std::vector<TransformationDescription>& given_trafos );
106
/// Applies the <i>given</i> transformations to consensus maps
107
static void transformConsensusMaps( std::vector<ConsensusMap>& maps, const std::vector<TransformationDescription>& given_trafos );
109
/// Applies the <i>given</i> transformations to peptide identifications
110
static void transformPeptideIdentifications( std::vector< std::vector< PeptideIdentification > >& maps, const std::vector<TransformationDescription>& given_trafos );
113
/// Applies the <i>given</i> transformations to a single peak map
114
static void transformSinglePeakMap( MSExperiment<>& msexp, const TransformationDescription& trafo );
116
/// Applies the <i>given</i> transformations to a single feature map
117
static void transformSingleFeatureMap( FeatureMap<>& fmap, const TransformationDescription& trafo );
119
/// Applies the <i>given</i> transformations to a single consensus map
120
static void transformSingleConsensusMap( ConsensusMap& cmap, const TransformationDescription& trafo );
122
/// Applies the <i>given</i> transformations to a single peptide identification
123
static void transformSinglePeptideIdentification( std::vector< PeptideIdentification >& pepids, const TransformationDescription& trafo );
127
@brief Fits a model with given parameters to the transformations
129
This will not alter transformations of reference files (transformation type "identity").
131
static void fitModel(const String& model_type, const Param& params, std::vector<TransformationDescription>& trafos);
133
/// Register all derived classes in this method
134
static void registerChildren();
139
/// apply a transformation to a feature
140
static void applyToFeature_(Feature& feature,
141
const TransformationDescription& trafo);
143
/// apply a transformation to a basic feature
144
static void applyToBaseFeature_(BaseFeature& feature,
145
const TransformationDescription& trafo);
147
/// apply a transformation to a consensus feature
148
static void applyToConsensusFeature_(ConsensusFeature& feature, const
149
TransformationDescription& trafo);
152
/// Copy constructor is not implemented -> private
153
MapAlignmentAlgorithm(const MapAlignmentAlgorithm& );
154
/// Assignment operator is not implemented -> private
155
MapAlignmentAlgorithm& operator=(const MapAlignmentAlgorithm& );
159
} // namespace OpenMS
161
#endif // OPENMS_ANALYSIS_MAPMATCHING_MAPALIGNMENTALGORITHM_H