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
32namespace pwiz {
33namespace 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 {
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
#define PWIZ_API_DECL
Definition Export.hpp:32
PeakFinder implementation based on signal-to-noise ratio.
boost::shared_ptr< NoiseCalculator > noiseCalculator_
PeakFinder_SNR(boost::shared_ptr< NoiseCalculator > noiseCalculator, const Config &config=Config())
virtual void findPeaks(const math::OrderedPairContainerRef &pairs, std::vector< size_t > &resultIndices) const
interface for finding peaks in an array of ordered pairs
virtual void findPeaks(const math::OrderedPairContainerRef &pairs, std::vector< size_t > &resultIndices) const =0
wrapper class for accessing contiguous data as a container of OrderedPairs; note that it does not own...
Config(size_t _windowRadius=2, double _zValueThreshold=3, bool _preprocessWithLogarithm=true, std::ostream *_log=0)