Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
RawMSSignalSimulation.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-2017.
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: Timo Sachsenberg$
32 // $Authors: Stephan Aiche, Chris Bielow$
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_SIMULATION_RAWMSSIGNALSIMULATION_H
36 #define OPENMS_SIMULATION_RAWMSSIGNALSIMULATION_H
37 
40 
43 
45 
46 namespace OpenMS
47 {
48 
49  class IsotopeModel;
50 
61  class OPENMS_DLLAPI RawMSSignalSimulation :
62  public DefaultParamHandler,
63  public ProgressLogger
64  {
65 
66 public:
72 
75 
78 
80  virtual ~RawMSSignalSimulation();
82 
83  RawMSSignalSimulation& operator=(const RawMSSignalSimulation& source);
84 
88  void loadContaminants();
89 
91  void generateRawSignals(SimTypes::FeatureMapSim& features,
92  SimTypes::MSSimExperiment& experiment,
93  SimTypes::MSSimExperiment& experiment_ct,
94  SimTypes::FeatureMapSim& contaminants);
95 
96 protected:
97 
98  enum IONIZATIONMETHOD {IM_ESI = 0, IM_MALDI = 1, IM_ALL = 2};
99  enum PROFILESHAPE {RT_RECTANGULAR, RT_GAUSSIAN};
100  enum RESOLUTIONMODEL {RES_CONSTANT, RES_LINEAR, RES_SQRT};
101 
103  void updateMembers_();
104 
106  void setDefaultParams_();
107 
115  void add1DSignal_(Feature& feature, SimTypes::MSSimExperiment& experiment, SimTypes::MSSimExperiment& experiment_ct);
116 
124  void add2DSignal_(Feature& feature, SimTypes::MSSimExperiment& experiment, SimTypes::MSSimExperiment& experiment_ct);
125 
136  void samplePeptideModel1D_(const IsotopeModel& iso,
137  const SimTypes::SimCoordinateType mz_start,
138  const SimTypes::SimCoordinateType mz_end,
139  SimTypes::MSSimExperiment& experiment,
140  SimTypes::MSSimExperiment& experiment_ct,
141  Feature& activeFeature);
142 
155  void samplePeptideModel2D_(const ProductModel<2>& pm,
156  const SimTypes::SimCoordinateType mz_start,
157  const SimTypes::SimCoordinateType mz_end,
160  SimTypes::MSSimExperiment& experiment,
161  SimTypes::MSSimExperiment& experiment_ct,
162  Feature& activeFeature);
163 
167  void chooseElutionProfile_(EGHModel* const elutionmodel,
168  Feature& feature,
169  const double scale,
170  const double rt_sampling_rate,
171  const SimTypes::MSSimExperiment& experiment);
172 
176  void createContaminants_(SimTypes::FeatureMapSim& contaminants, SimTypes::MSSimExperiment& exp, SimTypes::MSSimExperiment& exp_ct);
177 
179  void addShotNoise_(SimTypes::MSSimExperiment& experiment, SimTypes::SimCoordinateType minimal_mz_measurement_limit, SimTypes::SimCoordinateType maximal_mz_measurement_limit);
180 
182  void addWhiteNoise_(SimTypes::MSSimExperiment& experiment);
183 
185  void addDetectorNoise_(SimTypes::MSSimExperiment& experiment);
186 
188  void addBaseLine_(SimTypes::MSSimExperiment& experiment, SimTypes::SimCoordinateType minimal_mz_measurement_limit);
189 
191  void getSamplingGrid_(std::vector<SimTypes::SimCoordinateType>& grid,
192  const SimTypes::SimCoordinateType mz_min,
193  const SimTypes::SimCoordinateType mz_max,
194  const Int step_Da);
195 
197  void compressSignals_(SimTypes::MSSimExperiment& experiment);
198 
201 
206 
215  SimTypes::SimIntensityType getFeatureScaledIntensity_(const SimTypes::SimIntensityType feature_intensity,
216  const SimTypes::SimIntensityType natural_scaling_factor);
217 
218 
230  double getResolution_(const double query_mz, const double resolution, const RESOLUTIONMODEL model) const;
231 
235  double getPeakWidth_(const double mz, const bool is_gaussian) const;
236 
241 
242 
246  double res_base_;
248  std::vector<SimTypes::SimCoordinateType> grid_;
249 
252 
254  {
257  double rt_start, rt_end, intensity;
261  };
262 
263  std::vector<ContaminantInfo> contaminants_;
264 
268  std::vector<std::vector<double> > threaded_random_numbers_;
269 
275 
276  static const Size THREADED_RANDOM_NUMBER_POOL_SIZE_ = 500;
277 
279  };
280 
281 }
282 
283 #endif
SimTypes::MutableSimRandomNumberGeneratorPtr rnd_gen_
Random number generator.
Definition: RawMSSignalSimulation.h:251
A more convenient string class.
Definition: String.h:57
IONIZATIONMETHOD
Definition: RawMSSignalSimulation.h:98
double res_base_
base resolution at 400 Th
Definition: RawMSSignalSimulation.h:246
RESOLUTIONMODEL res_model_
model of how resolution behaves with increasing m/z
Definition: RawMSSignalSimulation.h:244
Isotope distribution approximated using linear interpolation.
Definition: IsotopeModel.h:59
A container for features.
Definition: FeatureMap.h:94
Definition: RawMSSignalSimulation.h:99
std::vector< std::vector< double > > threaded_random_numbers_
Definition: RawMSSignalSimulation.h:268
boost::shared_ptr< SimRandomNumberGenerator > MutableSimRandomNumberGeneratorPtr
Definition: SimTypes.h:175
SimTypes::SimCoordinateType mz_error_mean_
Mean of peak m/z error.
Definition: RawMSSignalSimulation.h:203
RESOLUTIONMODEL
Definition: RawMSSignalSimulation.h:100
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
The class template is only implemented for D=2 because we use Peak2D here.
Definition: ProductModel.h:65
std::vector< ContaminantInfo > contaminants_
Definition: RawMSSignalSimulation.h:263
SimTypes::SimCoordinateType mz_error_stddev_
Standard deviation of peak m/z error.
Definition: RawMSSignalSimulation.h:205
Definition: RawMSSignalSimulation.h:253
std::vector< SimTypes::SimCoordinateType > grid_
m/z sampling grid for all signals
Definition: RawMSSignalSimulation.h:248
Representation of an empirical formula.
Definition: EmpiricalFormula.h:80
SimTypes::SimIntensityType intensity_scale_
Scaling factor of peak intensities.
Definition: RawMSSignalSimulation.h:238
double rt_start
Definition: RawMSSignalSimulation.h:257
Int sampling_points_per_FWHM_
number of points sampled per peak&#39;s FWHM
Definition: RawMSSignalSimulation.h:200
IONIZATIONMETHOD im
Definition: RawMSSignalSimulation.h:260
Int q
Definition: RawMSSignalSimulation.h:258
EmpiricalFormula sf
Definition: RawMSSignalSimulation.h:256
PROFILESHAPE
Definition: RawMSSignalSimulation.h:99
Exponential-Gaussian hybrid distribution model for elution profiles.
Definition: EGHModel.h:56
An LC-MS feature.
Definition: Feature.h:70
bool contaminants_loaded_
Definition: RawMSSignalSimulation.h:278
Simulates MS signals for a given set of peptides.
Definition: RawMSSignalSimulation.h:61
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:82
PROFILESHAPE shape
Definition: RawMSSignalSimulation.h:259
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
String name
Definition: RawMSSignalSimulation.h:255
SimTypes::SimIntensityType intensity_scale_stddev_
Standard deviation of peak intensity scaling.
Definition: RawMSSignalSimulation.h:240
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
int Int
Signed integer type.
Definition: Types.h:103
std::vector< Size > threaded_random_numbers_index_
Definition: RawMSSignalSimulation.h:274

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:03 using doxygen 1.8.13