ProteoWizard
CwtPeakDetector.hpp
Go to the documentation of this file.
1//
2// $Id$
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
27typedef struct {
28 int Col;
29 int Row;
30} ridgeLine;
31
32
33#include "PeakDetector.hpp"
34
35namespace pwiz {
36namespace 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_;
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.
67void ricker2d(const std::vector <double> &, const int, const int, const int, const double, const double, const double, std::vector <double> &);
68int getColLowBound(const std::vector <double> &,const double);
69int getColHighBound(const std::vector <double> &,const double);
70double scoreAtPercentile( const double, const std::vector <double> &, const int );
71double convertColToMZ( const std::vector <double> &, const int );
72
73#endif // _CWTPEAKDETECTOR_HPP_
int getColLowBound(const std::vector< double > &, const double)
void ricker2d(const std::vector< double > &, const int, const int, const int, const double, const double, const double, std::vector< double > &)
double convertColToMZ(const std::vector< double > &, const int)
int getColHighBound(const std::vector< double > &, const double)
double scoreAtPercentile(const double, const std::vector< double > &, const int)
#define PWIZ_API_DECL
Definition Export.hpp:32
KernelTraitsBase< Kernel >::space_type::abscissa_type x
KernelTraitsBase< Kernel >::space_type::ordinate_type y
void getPeakLines(const std::vector< std::vector< double > > &, const std::vector< double > &, std::vector< ridgeLine > &, std::vector< double > &) const
virtual void detect(const std::vector< double > &x, const std::vector< double > &y, std::vector< double > &xPeakValues, std::vector< double > &yPeakValues, std::vector< Peak > *peaks=NULL)
find peaks in the signal profile described by the x and y vectors
void getScales(const std::vector< double > &, const std::vector< double > &, std::vector< std::vector< std::vector< int > > > &, std::vector< double > &) const
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
CwtPeakDetector(double minSnr, int fixedPeaksKeep, double mzTol)
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