ProteoWizard
PeakDetectorNaive.hpp
Go to the documentation of this file.
1//
2// $Id$
3//
4//
5// Original author: Darren Kessner <darren@proteowizard.org>
6//
7// Copyright 2006 Louis Warschaw Prostate Cancer Center
8// Cedars Sinai Medical Center, Los Angeles, California 90048
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
24#ifndef _PEAKDETECTORNAIVE_HPP_
25#define _PEAKDETECTORNAIVE_HPP_
26
27
29#include "PeakDetector.hpp"
30#include <memory>
31
32
33namespace pwiz {
34namespace frequency {
35
36
37/// Naive implementation of the PeakDetector interface.
38///
39/// Reports peaks where:
40/// -# magnitude > noise*noiseFactor
41/// -# magnitude is increasing on [center-detectionRadius, center]
42/// -# magnitude is decreasing on [center, center+detectionRadius]
43///
44/// All peaks are reported as charge==1
45
47{
48 public:
49 /// create an instance.
50 static std::auto_ptr<PeakDetectorNaive> create(double noiseFactor = 5,
51 unsigned int detectionRadius = 2);
52
53 virtual double noiseFactor() const = 0;
54 virtual unsigned int detectionRadius() const = 0;
55
56 /// \name PeakDetector interface
57 //@{
58 virtual void findPeaks(const pwiz::data::FrequencyData& fd,
59 pwiz::data::peakdata::Scan& result) const = 0;
61 //@}
62};
63
64
65} // namespace frequency
66} // namespace pwiz
67
68
69#endif // _PEAKDETECTORNAIVE_HPP_
70
71
#define PWIZ_API_DECL
Definition Export.hpp:32
Class for binary storage of complex frequency data.
Interface for finding peaks in frequency data.
Naive implementation of the PeakDetector interface.
virtual void findPeaks(const pwiz::data::FrequencyData &fd, pwiz::data::peakdata::Scan &result) const =0
Find the peaks in the frequency data, filling in Scan structure.
virtual double noiseFactor() const =0
virtual unsigned int detectionRadius() const =0
static std::auto_ptr< PeakDetectorNaive > create(double noiseFactor=5, unsigned int detectionRadius=2)
create an instance.