OpenMS  2.8.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-2021.
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 
91 
94 
105  void ionize(SimTypes::FeatureMapSim& features, ConsensusMap& charge_consensus, SimTypes::MSSimExperiment& experiment);
106 
107 private:
108  class CompareCmpByEF_;
109 
112 
115 
117  inline bool isFeatureValid_(const Feature& feature) const;
118 
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 
129 
131  void updateMembers_() override;
132 
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 
Representation of a peptide/protein sequence.
Definition: AASequence.h:112
std::vector< Adduct > AdductsType
Definition: Adduct.h:48
A container for consensus elements.
Definition: ConsensusMap.h:90
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:93
A container for features.
Definition: FeatureMap.h:106
An LC-MS feature.
Definition: Feature.h:72
Simulates Protein ionization.
Definition: IonizationSimulation.h:66
IonizationType ionization_type_
ESI or MALDI ionization.
Definition: IonizationSimulation.h:144
Size max_adduct_charge_
Maximal charge that any impure adduct from parameter list has.
Definition: IonizationSimulation.h:170
void setFeatureProperties_(Feature &f, const double &adduct_mass, const String &adduct_formula, const SimTypes::SimChargeType charge, const SimTypes::SimIntensityType new_intensity, const Size parent_index)
set meta values, mz etc after adducts are ready
double esi_probability_
Probability for the binomial distribution of ESI charge states.
Definition: IonizationSimulation.h:154
void setDefaultParams_()
set defaults
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
~IonizationSimulation() override
Destructor.
void ionize(SimTypes::FeatureMapSim &features, ConsensusMap &charge_consensus, SimTypes::MSSimExperiment &experiment)
Ionize all peptide features inside the Feature-Map.
void ionizeEsi_(SimTypes::FeatureMapSim &, ConsensusMap &charge_consensus)
ionize using ESI
IonizationType
possible ionization methods
Definition: IonizationSimulation.h:71
@ MALDI
Definition: IonizationSimulation.h:72
UInt countIonizedResidues_(const AASequence &) const
counts all basic residues inside the amino acid sequence to give an upper bound on the maximal charge...
IonizationSimulation & operator=(const IonizationSimulation &source)
Assignment operator.
SimTypes::SimCoordinateType maximal_mz_measurement_limit_
Maximum m/z detected by mass analyser.
Definition: IonizationSimulation.h:178
IonizationSimulation(const IonizationSimulation &source)
Copy constructor.
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
std::set< String > basic_residues_
Definition: IonizationSimulation.h:149
void updateMembers_() override
Synchronize members with param class.
SimTypes::MutableSimRandomNumberGeneratorPtr rnd_gen_
Random number generator.
Definition: IonizationSimulation.h:184
void ionizeMaldi_(SimTypes::FeatureMapSim &, ConsensusMap &charge_consensus)
ionize using MALDI
IonizationSimulation()
Default constructor.
SimTypes::SimCoordinateType minimal_mz_measurement_limit_
Minimum m/z detected by mass analyser.
Definition: IonizationSimulation.h:180
IonizationSimulation(SimTypes::MutableSimRandomNumberGeneratorPtr)
bool isFeatureValid_(const Feature &feature) const
check if feature is within mz bounds of detector
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:73
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:53
A more convenient string class.
Definition: String.h:60
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
boost::shared_ptr< SimRandomNumberGenerator > MutableSimRandomNumberGeneratorPtr
Definition: SimTypes.h:174
Peak2D::IntensityType SimIntensityType
Abundance of proteins/peptides.
Definition: SimTypes.h:62
Peak2D::CoordinateType SimCoordinateType
Coordinate type in mz and rt dimension.
Definition: SimTypes.h:59
Feature::ChargeType SimChargeType
Charge of a peptide.
Definition: SimTypes.h:65
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47