Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
PILISModel.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 
36 #ifndef OPENMS_ANALYSIS_ID_PILISMODEL_H
37 #define OPENMS_ANALYSIS_ID_PILISMODEL_H
38 
39 #include <vector>
42 #include <OpenMS/CONCEPT/Types.h>
47 #include <OpenMS/FORMAT/TextFile.h>
50 
51 
52 namespace OpenMS
53 {
54  class AASequence;
55 
67  class OPENMS_DLLAPI PILISModel :
68  public DefaultParamHandler
69  {
70 public:
71 
75  PILISModel();
77 
79  PILISModel(const PILISModel & model);
80 
82  virtual ~PILISModel();
84 
86  PILISModel & operator=(const PILISModel & mode);
87 
91  void train(const RichPeakSpectrum &, const AASequence & peptide, UInt charge);
93 
97  void readFromFile(const String & filename);
98 
100  void writeGraphMLFile(const String & filename);
101 
105  void writeToFile(const String & filename);
106 
107  //
108  void init(bool generate_models = true);
109 
111  void getSpectrum(RichPeakSpectrum & spec, const AASequence & peptide, UInt charge);
112 
114  void evaluate();
116 
117 protected:
118 
120  bool getInitialTransitionProbabilities_(std::vector<double> & bb_init,
121  std::vector<double> & cr_init,
122  std::vector<double> & sc_init,
123  double & precursor_init,
124  const std::vector<double> & bb_charges,
125  const std::vector<double> & sc_charges,
126  const AASequence & peptide);
127 
128  double getAvailableBackboneCharge_(const AASequence & ion, Residue::ResidueType res_type, int charge);
129 
131  void addPeaks_(double mz, int charge, double mz_offset, double intensity, RichPeakSpectrum & spectrum, const IsotopeDistribution & id, const String & name);
132 
134  void parseHMMModel_(const TextFile::ConstIterator & begin, const TextFile::ConstIterator & end, HiddenMarkovModel & hmm, Param & param);
135 
137  void writeParameters_(std::ostream & os, const Param & param);
138 
141 
144 
147 
149  bool valid_;
150 
153 
156 
159 
161 
164 
167 
170 
173 
174  void updateMembers_();
175  };
176 }
177 #endif
PILISNeutralLossModel b_ion_losses_cr_
Definition: PILISModel.h:165
A more convenient string class.
Definition: String.h:57
PILISNeutralLossModel b2_ion_losses_cr_
Definition: PILISModel.h:168
Map< double, std::vector< RichPeak1D > > peaks_
stores the peaks of a spectrum
Definition: PILISModel.h:152
This class implements the simulation of the spectra from PILIS.
Definition: PILISNeutralLossModel.h:62
PILISNeutralLossModel b_ion_losses_cd_
Definition: PILISModel.h:166
PILISNeutralLossModel b2_ion_losses_cd_
Definition: PILISModel.h:169
PILISNeutralLossModel y_ion_losses_cd_
Definition: PILISModel.h:172
A proton distribution model to calculate the proton distribution over charged peptides.
Definition: ProtonDistributionModel.h:71
Isotope distribution class.
Definition: IsotopeDistribution.h:61
Generates theoretical spectra with various options.
Definition: TheoreticalSpectrumGenerator.h:53
Representation of a peptide/protein sequence.
Definition: AASequence.h:70
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
PILISNeutralLossModel y_ion_losses_cr_
Definition: PILISModel.h:171
HiddenMarkovModel hmm_
base model used
Definition: PILISModel.h:140
std::vector< String >::const_iterator ConstIterator
Non-mutable iterator.
Definition: TextFile.h:57
This class implements the simulation of the spectra from PILIS.
Definition: PILISModel.h:67
Aligns the peaks of two spectra.
Definition: SpectrumAlignment.h:62
ResidueType
Definition: Residue.h:359
TheoreticalSpectrumGenerator tsg_
theoretical spectrum generator (needed for training/aligning and spectrum intensity extraction) ...
Definition: PILISModel.h:146
Management and storage of parameters / INI files.
Definition: Param.h:75
ProtonDistributionModel prot_dist_
proton distribution model
Definition: PILISModel.h:143
PILISNeutralLossModel precursor_model_cr_
precursor model used
Definition: PILISModel.h:158
SpectrumAlignment spectra_aligner_
the alignment algorithm used
Definition: PILISModel.h:155
PILISNeutralLossModel precursor_model_cd_
Definition: PILISModel.h:160
Hidden Markov Model implementation of PILIS.
Definition: HiddenMarkovModel.h:134
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
bool valid_
true if the instance is valid
Definition: PILISModel.h:149
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:51
PILISNeutralLossModel a_ion_losses_cd_
Definition: PILISModel.h:163
PILISNeutralLossModel a_ion_losses_cr_
Definition: PILISModel.h:162

OpenMS / TOPP release 2.0.0 Documentation generated on Sat May 16 2015 16:13:30 using doxygen 1.8.9.1