| OpenMS 2.5.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-2020.
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
37 #include <OpenMS/CONCEPT/ProgressLogger.h>
38 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
39 #include <OpenMS/DATASTRUCTURES/Adduct.h>
40 #include <OpenMS/SIMULATION/SimTypes.h>
41 #include <OpenMS/KERNEL/ConsensusMap.h>
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 {
72 MALDI,
73 ESI
74 } IonizationType;
75
77 IonizationSimulation();
78
82 explicit IonizationSimulation(SimTypes::MutableSimRandomNumberGeneratorPtr);
84
86 IonizationSimulation(const IonizationSimulation& source);
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
144 IonizationType ionization_type_;
145
146 /*
147 @brief List of residues that are counted as basic during execution of countBasicResidues_
148 */
149 std::set<String> basic_residues_;
150
154 double esi_probability_;
155
159 std::vector<double> esi_impurity_probabilities_;
160
161
165 Adduct::AdductsType esi_adducts_;
166
170 Size max_adduct_charge_;
171
175 std::vector<double> maldi_probabilities_;
176
178 SimTypes::SimCoordinateType maximal_mz_measurement_limit_;
180 SimTypes::SimCoordinateType minimal_mz_measurement_limit_;
181
182 protected:
184 SimTypes::MutableSimRandomNumberGeneratorPtr rnd_gen_;
185 };
186
187 }
188
189
OpenMS::Feature
An LC-MS feature.
Definition: Feature.h:70
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::IonizationSimulation::max_adduct_charge_
Size max_adduct_charge_
Maximal charge that any impure adduct from parameter list has.
Definition: IonizationSimulation.h:170
OpenMS::IonizationSimulation::maldi_probabilities_
std::vector< double > maldi_probabilities_
Preprocessed table of discrete distribution (MALDI charges)
Definition: IonizationSimulation.h:175
Adduct.h
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
SimTypes.h
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::IonizationSimulation::minimal_mz_measurement_limit_
SimTypes::SimCoordinateType minimal_mz_measurement_limit_
Minimum m/z detected by mass analyser.
Definition: IonizationSimulation.h:180
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:95
OpenMS::IonizationSimulation::MALDI
Definition: IonizationSimulation.h:72
OpenMS::IonizationSimulation::esi_impurity_probabilities_
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
ConsensusMap.h
OpenMS::IonizationSimulation::basic_residues_
std::set< String > basic_residues_
Definition: IonizationSimulation.h:149
OpenMS::AASequence
Representation of a peptide/protein sequence.
Definition: AASequence.h:113
OpenMS::IonizationSimulation::maximal_mz_measurement_limit_
SimTypes::SimCoordinateType maximal_mz_measurement_limit_
Maximum m/z detected by mass analyser.
Definition: IonizationSimulation.h:178
OpenMS::IonizationSimulation::IonizationType
IonizationType
possible ionization methods
Definition: IonizationSimulation.h:70
ProgressLogger.h
OpenMS::IonizationSimulation::esi_adducts_
Adduct::AdductsType esi_adducts_
Corresponding table to esi_impurity_probabilities_ holding the actual element and its charge...
Definition: IonizationSimulation.h:165
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::IonizationSimulation::rnd_gen_
SimTypes::MutableSimRandomNumberGeneratorPtr rnd_gen_
Random number generator.
Definition: IonizationSimulation.h:184
OpenMS::IonizationSimulation
Simulates Protein ionization.
Definition: IonizationSimulation.h:63
OpenMS::ProgressLogger
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
OpenMS::IonizationSimulation::ionization_type_
IonizationType ionization_type_
ESI or MALDI ionization.
Definition: IonizationSimulation.h:144
DefaultParamHandler.h
OpenMS::UInt
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
double
float
int
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:79
OpenMS::Adduct::AdductsType
std::vector< Adduct > AdductsType
Definition: Adduct.h:48
OpenMS::SimTypes::MutableSimRandomNumberGeneratorPtr
boost::shared_ptr< SimRandomNumberGenerator > MutableSimRandomNumberGeneratorPtr
Definition: SimTypes.h:174
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::IonizationSimulation::esi_probability_
double esi_probability_
Probability for the binomial distribution of ESI charge states.
Definition: IonizationSimulation.h:154