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: Stephan Aiche$
25
// $Authors: Stephan Aiche$
26
// --------------------------------------------------------------------------
28
#include <OpenMS/CONCEPT/ClassTest.h>
30
///////////////////////////
31
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/TraceFitter.h>
32
#include <OpenMS/KERNEL/Peak1D.h>
33
///////////////////////////
35
using namespace OpenMS;
38
// dummy implementation for the test
39
template <class PeakType>
40
class DerivedTraceFitter
41
: public TraceFitter<PeakType>
46
void fit(FeatureFinderAlgorithmPickedHelperStructs::MassTraces<PeakType>&)
48
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
51
DoubleReal getLowerRTBound() const
53
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
56
DoubleReal getUpperRTBound() const
58
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
61
DoubleReal getHeight() const
63
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
66
DoubleReal getCenter() const
68
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
71
DoubleReal getFWHM() const
73
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
76
DoubleReal computeTheoretical(const FeatureFinderAlgorithmPickedHelperStructs::MassTrace<PeakType>&, Size)
78
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
81
bool checkMinimalRTSpan(const std::pair<double, double>&, const DoubleReal)
83
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
86
bool checkMaximalRTSpan(const DoubleReal)
88
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
91
DoubleReal getFeatureIntensityContribution()
93
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
96
String getGnuplotFormula(FeatureFinderAlgorithmPickedHelperStructs::MassTrace<PeakType> const &, const char, const DoubleReal, const DoubleReal)
98
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
101
void printState_(SignedSize, gsl_multifit_fdfsolver*)
103
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
106
void getOptimizedParameters_(gsl_multifit_fdfsolver*)
108
throw Exception::NotImplemented(__FILE__,__LINE__,__PRETTY_FUNCTION__);
113
START_TEST(TraceFitter, "$Id: TraceFitter_test.C 9385 2011-12-22 13:00:16Z aiche $")
115
/////////////////////////////////////////////////////////////
116
/////////////////////////////////////////////////////////////
118
TraceFitter<Peak1D>* ptr = 0;
119
TraceFitter<Peak1D>* nullPointer = 0;
120
START_SECTION(TraceFitter())
122
ptr = new DerivedTraceFitter<Peak1D>();
123
TEST_NOT_EQUAL(ptr, nullPointer)
127
START_SECTION(~TraceFitter())
133
START_SECTION((TraceFitter(const TraceFitter &source)))
136
// has no public members to check if copy has same proberties
140
START_SECTION((virtual TraceFitter& operator=(const TraceFitter &source)))
143
// has no public members to check if copy has same proberties
147
DerivedTraceFitter<Peak1D> trace_fitter;
148
START_SECTION((virtual void fit(FeatureFinderAlgorithmPickedHelperStructs::MassTraces< PeakType > &traces)=0))
150
FeatureFinderAlgorithmPickedHelperStructs::MassTraces<Peak1D> m;
151
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.fit(m))
155
START_SECTION((virtual DoubleReal getLowerRTBound() const ))
157
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.getLowerRTBound())
161
START_SECTION((virtual DoubleReal getUpperRTBound() const ))
163
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.getUpperRTBound())
167
START_SECTION((virtual DoubleReal getHeight() const ))
169
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.getHeight())
173
START_SECTION((virtual DoubleReal getCenter() const ))
175
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.getCenter())
179
START_SECTION((virtual DoubleReal computeTheoretical(const FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > &trace, Size k)=0))
181
FeatureFinderAlgorithmPickedHelperStructs::MassTrace<Peak1D> mt;
183
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.computeTheoretical(mt,i))
187
START_SECTION((virtual bool checkMinimalRTSpan(const std::pair< DoubleReal, DoubleReal > &rt_bounds, const DoubleReal min_rt_span)=0))
189
std::pair<DoubleReal, DoubleReal> p;
191
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.checkMinimalRTSpan(p,x))
195
START_SECTION((virtual bool checkMaximalRTSpan(const DoubleReal max_rt_span)=0))
198
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.checkMaximalRTSpan(x))
202
START_SECTION((virtual DoubleReal getFeatureIntensityContribution()))
204
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.getFeatureIntensityContribution())
208
START_SECTION((virtual String getGnuplotFormula(FeatureFinderAlgorithmPickedHelperStructs::MassTrace< PeakType > const &trace, const char function_name, const DoubleReal baseline, const DoubleReal rt_shift)=0))
210
FeatureFinderAlgorithmPickedHelperStructs::MassTrace<Peak1D> mt;
211
DoubleReal shift = 0.0;
212
DoubleReal baseline = 0.0;
214
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.getGnuplotFormula(mt, f, baseline, shift))
218
START_SECTION((virtual DoubleReal getFWHM() const))
220
TEST_EXCEPTION(Exception::NotImplemented, trace_fitter.getFWHM())
224
/////////////////////////////////////////////////////////////
225
/////////////////////////////////////////////////////////////