Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
PILISCrossValidation.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2015.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Andreas Bertsch $
32 // $Authors: Andreas Bertsch $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_ANALYSIS_ID_PILISCROSSVALIDATION_H
36 #define OPENMS_ANALYSIS_ID_PILISCROSSVALIDATION_H
37 
40 
41 #include <vector>
42 
43 namespace OpenMS
44 {
45  class PeakSpectrumCompareFunctor;
46  class PILISModel;
47 
48 
57  class OPENMS_DLLAPI PILISCrossValidation :
58  public DefaultParamHandler
59  {
60 
61 public:
62 
66  struct OPENMS_DLLAPI Peptide
67  {
68  Peptide();
69 
70  Peptide(const Peptide & rhs);
71 
72  virtual ~Peptide();
73 
74  Peptide & operator=(const Peptide & rhs);
75 
79 
80  std::vector<PeptideHit> hits;
81 
82  bool operator<(const Peptide & peptide) const;
83 
84  };
85 
89  struct OPENMS_DLLAPI Option
90  {
92  enum Type
93  {
94  INT = 0,
95  DOUBLE = 1,
96  BOOL = 2,
97  STRINGLIST = 3
98  };
99 
101  Option();
102 
104  Option(const Option & rhs);
105 
107  Option(Type t, double min, double max, double stepsize);
108 
110  Option & operator=(const Option & rhs);
111 
116  double dbl_min;
117  double dbl_max;
118  double dbl_stepsize;
119  };
120 
121 
127 
130 
132  virtual ~PILISCrossValidation();
133 
135  PILISCrossValidation & operator=(const PILISCrossValidation & rhs);
137 
141  void setOptions(const Map<String, Option> & rhs)
143  {
144  cv_options_ = rhs;
145  }
146 
148  void setOption(const String & name, const Option & option)
149  {
150  cv_options_[name] = option;
151  }
152 
154  void apply(Param & PILIS_param, const PILISModel & base_model, const std::vector<Peptide> & peptides);
155 
157  double scoreHits(const std::vector<std::vector<std::vector<RichPeakSpectrum> > > & sim_spectra, const std::vector<std::vector<RichPeakSpectrum> > & exp_spectra);
159 
160 protected:
161 
162  double scoreSpectra_(const RichPeakSpectrum & spec1, const RichPeakSpectrum & spec2);
163 
164  void partition_(std::vector<std::vector<Peptide> > & parts, const std::vector<Peptide> & source);
165 
166  void generateParameters_(const Param & param, const Map<String, Option> & options, std::vector<Param> & parameters);
167 
169 
170  void updateMembers_();
171 
173  };
174 }
175 
176 #endif
A more convenient string class.
Definition: String.h:57
double dbl_max
Definition: PILISCrossValidation.h:117
Int int_stepsize
Definition: PILISCrossValidation.h:115
double dbl_min
Definition: PILISCrossValidation.h:116
PeakSpectrumCompareFunctor * pscf_
Definition: PILISCrossValidation.h:172
Representation of a peptide/protein sequence.
Definition: AASequence.h:70
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Int charge
Definition: PILISCrossValidation.h:77
this struct represents a peptide spectrum pair
Definition: PILISCrossValidation.h:66
AASequence sequence
Definition: PILISCrossValidation.h:76
RichPeakSpectrum spec
Definition: PILISCrossValidation.h:78
Map< String, Option > cv_options_
Definition: PILISCrossValidation.h:168
Int int_min
Definition: PILISCrossValidation.h:113
This struct represents a cross validation option.
Definition: PILISCrossValidation.h:89
Type
Type of the parameters.
Definition: PILISCrossValidation.h:92
This class implements the simulation of the spectra from PILIS.
Definition: PILISModel.h:67
void setOption(const String &name, const Option &option)
sets a option to be used for the cross validation
Definition: PILISCrossValidation.h:148
Management and storage of parameters / INI files.
Definition: Param.h:75
Int int_max
Definition: PILISCrossValidation.h:114
double dbl_stepsize
Definition: PILISCrossValidation.h:118
Base class for compare functors of spectra, that return a similarity value for two spectra...
Definition: PeakSpectrumCompareFunctor.h:53
Type type
Definition: PILISCrossValidation.h:112
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
std::vector< PeptideHit > hits
Definition: PILISCrossValidation.h:80
int Int
Signed integer type.
Definition: Types.h:96
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:51
Implementation of a cross validation training for the PILIS model.
Definition: PILISCrossValidation.h:57

OpenMS / TOPP release 2.0.0 Documentation generated on Tue Nov 1 2016 16:34:46 using doxygen 1.8.11