OpenMS  2.4.0
IonizationSimulation.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-2018.
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: Chris Bielow$
32 // $Authors: Stephan Aiche, Chris Bielow$
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
42 
43 // STL includes
44 #include <set>
45 
46 namespace OpenMS
47 {
48 
63  class OPENMS_DLLAPI IonizationSimulation :
64  public DefaultParamHandler,
65  public ProgressLogger
66  {
67 
68 public:
70  typedef enum
71  {
73  ESI
74  } IonizationType;
75 
78 
84 
87 
89  ~IonizationSimulation() override;
91 
93  IonizationSimulation& operator=(const IonizationSimulation& source);
94 
105  void ionize(SimTypes::FeatureMapSim& features, ConsensusMap& charge_consensus, SimTypes::MSSimExperiment& experiment);
106 
107 private:
108  class CompareCmpByEF_;
109 
111  void ionizeEsi_(SimTypes::FeatureMapSim&, ConsensusMap& charge_consensus);
112 
114  void ionizeMaldi_(SimTypes::FeatureMapSim&, ConsensusMap& charge_consensus);
115 
117  inline bool isFeatureValid_(const Feature& feature);
118 
120  void setFeatureProperties_(Feature& f,
121  const double& adduct_mass,
122  const String& adduct_formula,
123  const SimTypes::SimChargeType charge,
124  const SimTypes::SimIntensityType new_intensity,
125  const Size parent_index);
126 
128  void setDefaultParams_();
129 
131  void updateMembers_() override;
132 
138  UInt countIonizedResidues_(const AASequence&) const;
139 
140 
141  // Members //
142 
145 
146  /*
147  @brief List of residues that are counted as basic during execution of countBasicResidues_
148 */
149  std::set<String> basic_residues_;
150 
155 
159  std::vector<double> esi_impurity_probabilities_;
160 
161 
166 
171 
175  std::vector<double> maldi_probabilities_;
176 
181 
182 protected:
185  };
186 
187 }
188 
189 
SimTypes::SimCoordinateType maximal_mz_measurement_limit_
Maximum m/z detected by mass analyser.
Definition: IonizationSimulation.h:178
SimTypes::MutableSimRandomNumberGeneratorPtr rnd_gen_
Random number generator.
Definition: IonizationSimulation.h:184
A more convenient string class.
Definition: String.h:57
Simulates Protein ionization.
Definition: IonizationSimulation.h:63
double esi_probability_
Probability for the binomial distribution of ESI charge states.
Definition: IonizationSimulation.h:154
A container for features.
Definition: FeatureMap.h:93
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
IonizationType
possible ionization methods
Definition: IonizationSimulation.h:70
boost::shared_ptr< SimRandomNumberGenerator > MutableSimRandomNumberGeneratorPtr
Definition: SimTypes.h:174
A container for consensus elements.
Definition: ConsensusMap.h:75
Representation of a peptide/protein sequence.
Definition: AASequence.h:107
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
SimTypes::SimCoordinateType minimal_mz_measurement_limit_
Minimum m/z detected by mass analyser.
Definition: IonizationSimulation.h:180
std::vector< Adduct > AdductsType
Definition: Adduct.h:48
Size max_adduct_charge_
Maximal charge that any impure adduct from parameter list has.
Definition: IonizationSimulation.h:170
std::vector< double > esi_impurity_probabilities_
Discrete distribution of impure charge adducts like Na+, K+, Ca++ etc besides the usual H+...
Definition: IonizationSimulation.h:159
std::set< String > basic_residues_
Definition: IonizationSimulation.h:149
Adduct::AdductsType esi_adducts_
Corresponding table to esi_impurity_probabilities_ holding the actual element and its charge...
Definition: IonizationSimulation.h:165
std::vector< double > maldi_probabilities_
Preprocessed table of discrete distribution (MALDI charges)
Definition: IonizationSimulation.h:175
An LC-MS feature.
Definition: Feature.h:70
IonizationType ionization_type_
ESI or MALDI ionization.
Definition: IonizationSimulation.h:144
Feature::ChargeType SimChargeType
Charge of a peptide.
Definition: SimTypes.h:65
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
Definition: IonizationSimulation.h:72