ProteoWizard
PeakFitter.hpp
Go to the documentation of this file.
1 //
2 // $Id: PeakFitter.hpp 1191 2009-08-14 19:33:05Z chambm $
3 //
4 //
5 // Original author: Darren Kessner <darren@proteowizard.org>
6 //
7 // Copyright 2009 Center for Applied Molecular Medicine
8 // University of Southern California, Los Angeles, CA
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 // http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 // See the License for the specific language governing permissions and
20 // limitations under the License.
21 //
22 
23 #ifndef _PEAKFITTER_HPP_
24 #define _PEAKFITTER_HPP_
25 
26 
30 #include <vector>
31 
32 
33 namespace pwiz {
34 namespace analysis {
35 
36 
37 ///
38 /// interface for fitting peaks in an array of ordered pairs
39 ///
41 {
42  public:
43 
45 
46  virtual void fitPeak(const math::OrderedPairContainerRef& pairs,
47  size_t index,
48  Peak& result) const = 0;
49 
50  void fitPeaks(const math::OrderedPairContainerRef& pairs,
51  std::vector<size_t>& indices,
52  std::vector<Peak>& result) const;
53 
54  virtual ~PeakFitter(){}
55 };
56 
57 
58 ///
59 /// PeakFitter implementation based on fitting a parabola
60 ///
62 {
63  public:
64 
65  struct Config
66  {
67  size_t windowRadius;
68 
69  Config(size_t _windowRadius = 1)
70  : windowRadius(_windowRadius)
71  {}
72  };
73 
74  PeakFitter_Parabola(const Config& config = Config());
75 
76  virtual void fitPeak(const math::OrderedPairContainerRef& pairs,
77  size_t index,
78  Peak& result) const;
79 
80  private:
82 };
83 
84 
85 } // namespace analysis
86 } // namespace pwiz
87 
88 
89 #endif // _PEAKFITTER_HPP_
90