ProteoWizard
PeakFinder.hpp
Go to the documentation of this file.
1 //
2 // $Id$
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 _PEAKFINDER_HPP_
24 #define _PEAKFINDER_HPP_
25 
26 
29 #include "boost/shared_ptr.hpp"
30 
31 
32 namespace pwiz {
33 namespace analysis {
34 
35 
36 ///
37 /// interface for finding peaks in an array of ordered pairs
38 ///
40 {
41  public:
42 
43  virtual void findPeaks(const math::OrderedPairContainerRef& pairs,
44  std::vector<size_t>& resultIndices) const = 0;
45  virtual ~PeakFinder(){}
46 };
47 
48 
49 ///
50 /// PeakFinder implementation based on signal-to-noise ratio
51 ///
53 {
54  public:
55 
56  struct Config
57  {
58  size_t windowRadius;
61  std::ostream* log;
62 
63  Config(size_t _windowRadius = 2,
64  double _zValueThreshold = 3,
65  bool _preprocessWithLogarithm = true,
66  std::ostream* _log = 0)
67  : windowRadius(_windowRadius),
68  zValueThreshold(_zValueThreshold),
69  preprocessWithLogarithm(_preprocessWithLogarithm),
70  log(_log)
71  {}
72  };
73 
74  PeakFinder_SNR(boost::shared_ptr<NoiseCalculator> noiseCalculator,
75  const Config& config = Config());
76 
77  virtual void findPeaks(const math::OrderedPairContainerRef& pairs,
78  std::vector<size_t>& resultIndices) const;
79 
80  private:
81  boost::shared_ptr<NoiseCalculator> noiseCalculator_;
83 };
84 
85 
86 } // namespace analysis
87 } // namespace pwiz
88 
89 
90 #endif // _PEAKFINDER_HPP_
91 
pwiz::analysis::PeakFinder_SNR::Config::windowRadius
size_t windowRadius
Definition: PeakFinder.hpp:58
pwiz::math::OrderedPairContainerRef
wrapper class for accessing contiguous data as a container of OrderedPairs; note that it does not own...
Definition: OrderedPair.hpp:84
Noise.hpp
pwiz
Definition: ChromatogramList_Filter.hpp:36
pwiz::analysis::PeakFinder_SNR::Config::preprocessWithLogarithm
bool preprocessWithLogarithm
Definition: PeakFinder.hpp:60
PWIZ_API_DECL
#define PWIZ_API_DECL
Definition: Export.hpp:32
pwiz::analysis::PeakFinder_SNR::Config::zValueThreshold
double zValueThreshold
Definition: PeakFinder.hpp:59
Export.hpp
pwiz::analysis::PeakFinder_SNR::noiseCalculator_
boost::shared_ptr< NoiseCalculator > noiseCalculator_
Definition: PeakFinder.hpp:81
pwiz::analysis::PeakFinder::findPeaks
virtual void findPeaks(const math::OrderedPairContainerRef &pairs, std::vector< size_t > &resultIndices) const =0
pwiz::analysis::PeakFinder::~PeakFinder
virtual ~PeakFinder()
Definition: PeakFinder.hpp:45
pwiz::analysis::PeakFinder_SNR::Config::log
std::ostream * log
Definition: PeakFinder.hpp:61
pwiz::analysis::PeakFinder_SNR::PeakFinder_SNR
PeakFinder_SNR(boost::shared_ptr< NoiseCalculator > noiseCalculator, const Config &config=Config())
pwiz::analysis::PeakFinder
interface for finding peaks in an array of ordered pairs
Definition: PeakFinder.hpp:40
pwiz::analysis::PeakFinder_SNR::findPeaks
virtual void findPeaks(const math::OrderedPairContainerRef &pairs, std::vector< size_t > &resultIndices) const
pwiz::analysis::PeakFinder_SNR::Config::Config
Config(size_t _windowRadius=2, double _zValueThreshold=3, bool _preprocessWithLogarithm=true, std::ostream *_log=0)
Definition: PeakFinder.hpp:63
pwiz::analysis::PeakFinder_SNR::Config
Definition: PeakFinder.hpp:57
pwiz::analysis::PeakFinder_SNR::config_
Config config_
Definition: PeakFinder.hpp:82
pwiz::analysis::PeakFinder_SNR
PeakFinder implementation based on signal-to-noise ratio.
Definition: PeakFinder.hpp:53