ProteoWizard
CwtPeakDetector.hpp
Go to the documentation of this file.
1 //
2 // $Id: CwtPeakDetector.hpp 6389 2014-06-13 19:46:19Z frenchwr $
3 //
4 //
5 // Original author: William French <william.r.french <a.t> vanderbilt.edu>
6 //
7 // Copyright 2008 Vanderbilt University - Nashville, TN 37232
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 //
21 
22 
23 #ifndef _CWTPEAKDETECTOR_HPP_
24 #define _CWTPEAKDETECTOR_HPP_
25 
26 // custom type for storing ridge line info
27 typedef struct {
28  int Col;
29  int Row;
30 } ridgeLine;
31 
32 
33 #include "PeakDetector.hpp"
34 
35 namespace pwiz {
36 namespace analysis {
37 
38 
40 {
41  CwtPeakDetector(double minSnr, int fixedPeaksKeep, double mzTol );
42 
43  virtual void detect(const std::vector<double>& x, const std::vector<double>& y,
44  std::vector<double>& xPeakValues, std::vector<double>& yPeakValues,
45  std::vector<Peak>* peaks = NULL);
46 
47  void getScales( const std::vector <double> &, const std::vector <double> &, std::vector <std::vector< std::vector<int> > > &, std::vector <double> &) const;
48  void calcCorrelation( const std::vector <double> &, const std::vector <double> &, const std::vector <std::vector<std::vector<int> > > &, const std::vector <double> &, std::vector < std::vector <double> > &) const;
49  void getPeakLines(const std::vector < std::vector <double> > &, const std::vector <double> &, std::vector <ridgeLine> &, std::vector <double> &) const;
50  void refinePeaks( const std::vector <double> &, const std::vector <double> &, const std::vector <ridgeLine> &, const std::vector <double> &, std::vector <double> &, std::vector <double> &, std::vector <double> &) const;
51 
52  private:
53  // parameters
54  double minSnr_;
56  double mzTol_;
57  int nScales;
58  std::vector<double> scalings; // how to scale the wavelet widths, unchanged once it's initialized
59 
60 };
61 
62 
63 } // namespace analysis
64 } // namespace pwiz
65 
66 // Helper functions used by detect. The client does not need to see these.
67 void ricker2d(const std::vector <double> &, const int, const int, const int, const double, const double, const double, std::vector <double> &);
68 int getColLowBound(const std::vector <double> &,const double);
69 int getColHighBound(const std::vector <double> &,const double);
70 double scoreAtPercentile( const double, const std::vector <double> &, const int );
71 double convertColToMZ( const std::vector <double> &, const int );
72 
73 #endif // _CWTPEAKDETECTOR_HPP_
int getColLowBound(const std::vector< double > &, const double)
double convertColToMZ(const std::vector< double > &, const int)
int getColHighBound(const std::vector< double > &, const double)
#define PWIZ_API_DECL
Definition: Export.hpp:32
void ricker2d(const std::vector< double > &, const int, const int, const int, const double, const double, const double, std::vector< double > &)
KernelTraitsBase< Kernel >::space_type::abscissa_type x
KernelTraitsBase< Kernel >::space_type::ordinate_type y
double scoreAtPercentile(const double, const std::vector< double > &, const int)
std::vector< double > scalings