ProteoWizard
AMTDatabase.hpp
Go to the documentation of this file.
1 //
2 // $Id: AMTDatabase.hpp 1539 2009-11-19 20:12:28Z khoff $
3 //
4 //
5 // Original author: Kate Hoff <katherine.hoff@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 ///
24 /// AMTDatabase.hpp
25 ///
26 
27 #ifndef _AMTDATABASE_HPP_
28 #define _AMTDATABASE_HPP_
29 
30 #include "AMTContainer.hpp"
31 
32 namespace pwiz{
33 namespace eharmony{
34 
35 using namespace pwiz::data::peakdata;
36 
37 
39 {
40  AMTDatabase(const AMTContainer& amtContainer);
41 
42  virtual std::vector<SpectrumQuery> query(DfcPtr dfc, const WarpFunctionEnum& wfe, NormalDistributionSearch& nds, MSMSPipelineAnalysis& mspa_in, string outputDir="./amtdb_query",const int& roc=0, const double& threshold=0.75);
43 
45 
46 };
47 
49 {
50  IslandizedDatabase(boost::shared_ptr<AMTContainer> amtContainer);
51 
52  virtual std::vector<SpectrumQuery> query(DfcPtr dfc, const WarpFunctionEnum& wfe, NormalDistributionSearch& nds, MSMSPipelineAnalysis& mspa_in, string outputDir="./amtdb_query");
53 
54  struct Gaussian
55  {
56  Gaussian() : mu(make_pair(0,0)), sigma(make_pair(0,0)){}
57  Gaussian(const pair<pair<double,double>, pair<double,double> >& params) : mu(params.first), sigma(params.second){}
58  pair<double,double> mu;
59  pair<double,double> sigma;
60 
61  bool operator==(const Gaussian& that) const { return mu == that.mu && sigma == that.sigma;}
62  bool operator!=(const Gaussian& that) const { return !(*this == that);}
63 
64  };
65 
66  struct Island
67  {
68 
69  Island() : massMin(0), massMax(0), rtMin(0), rtMax(0) {}
70  double calculatePVal(const double& mz, const double& rt) const;
71 
72  double massMin;
73  double massMax;
74  double massMedian;
75  double massMean;
76 
77  double rtMin;
78  double rtMax;
79  double rtMedian;
80  double rtMean;
81 
82  double relativeArea;
83 
84  vector<boost::shared_ptr<SpectrumQuery> > spectrumQueries;
85  vector<Gaussian> gaussians;
86 
87  string id;
88 
89  };
90 
91  vector<Island> islands;
92  vector<string> uniquePeptides;
93 
94 };
95 
96 } // namespace eharmony
97 } // namespace pwiz
98 
99 #endif // _AMTDATABASE_HPP_