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-2013.
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: Stephan Aiche$
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 
77  virtual ~RawMSSignalSimulation();
79 
80  RawMSSignalSimulation & operator=(const RawMSSignalSimulation & source);
81 
85  void loadContaminants();
86 
88  void generateRawSignals(FeatureMapSim & features, MSSimExperiment & experiment, MSSimExperiment & experiment_ct, FeatureMapSim & contaminants);
89 
90 protected:
91 
92  enum IONIZATIONMETHOD {IM_ESI = 0, IM_MALDI = 1, IM_ALL = 2};
93  enum PROFILESHAPE {RT_RECTANGULAR, RT_GAUSSIAN};
94  enum RESOLUTIONMODEL {RES_CONSTANT, RES_LINEAR, RES_SQRT};
95 
96 
99 
101  void updateMembers_();
102 
104  void setDefaultParams_();
105 
113  void add1DSignal_(Feature & feature, MSSimExperiment & experiment, MSSimExperiment & experiment_ct);
114 
122  void add2DSignal_(Feature & feature, MSSimExperiment & experiment, MSSimExperiment & experiment_ct);
123 
134  void samplePeptideModel1D_(const IsotopeModel & iso,
135  const SimCoordinateType mz_start,
136  const SimCoordinateType mz_end,
137  MSSimExperiment & experiment,
138  MSSimExperiment & experiment_ct,
139  Feature & activeFeature);
140 
153  void samplePeptideModel2D_(const ProductModel<2> & pm,
154  const SimCoordinateType mz_start,
155  const SimCoordinateType mz_end,
156  SimCoordinateType rt_start,
157  SimCoordinateType rt_end,
158  MSSimExperiment & experiment,
159  MSSimExperiment & experiment_ct,
160  Feature & activeFeature);
161 
165  void chooseElutionProfile_(EGHModel * const elutionmodel, Feature & feature, const double scale, const DoubleReal rt_sampling_rate, const MSSimExperiment & experiment);
166 
170  void createContaminants_(FeatureMapSim & contaminants, MSSimExperiment & exp, MSSimExperiment & exp_ct);
171 
173  void addShotNoise_(MSSimExperiment & experiment, SimCoordinateType minimal_mz_measurement_limit, SimCoordinateType maximal_mz_measurement_limit);
174 
176  void addWhiteNoise_(MSSimExperiment & experiment);
177 
179  void addDetectorNoise_(MSSimExperiment & experiment);
180 
182  void addBaseLine_(MSSimExperiment & experiment, SimCoordinateType minimal_mz_measurement_limit);
183 
185  void getSamplingGrid_(std::vector<SimCoordinateType> & grid, const SimCoordinateType mz_min, const SimCoordinateType mz_max, const Int step_Da);
186 
188  void compressSignals_(MSSimExperiment & experiment);
189 
192 
197 
206  SimIntensityType getFeatureScaledIntensity_(const SimIntensityType feature_intensity, const SimIntensityType natural_scaling_factor);
207 
208 
220  DoubleReal getResolution_(const DoubleReal query_mz, const DoubleReal resolution, const RESOLUTIONMODEL model) const;
221 
225  DoubleReal getPeakWidth_(const DoubleReal mz, const bool is_gaussian) const;
226 
231 
232 
238  std::vector<SimCoordinateType> grid_;
239 
242 
244  {
247  DoubleReal rt_start, rt_end, intensity;
251  };
252 
253  std::vector<ContaminantInfo> contaminants_;
254 
258  std::vector<std::vector<double> > threaded_random_numbers_;
259 
265 
266  static const Size THREADED_RANDOM_NUMBER_POOL_SIZE_ = 500;
267 
269  };
270 
271 }
272 
273 #endif
A more convenient string class.
Definition: String.h:56
IONIZATIONMETHOD
Definition: RawMSSignalSimulation.h:92
RESOLUTIONMODEL res_model_
model of how resolution behaves with increasing m/z
Definition: RawMSSignalSimulation.h:234
Isotope distribution approximated using linear interpolation.
Definition: IsotopeModel.h:59
A container for features.
Definition: FeatureMap.h:111
Definition: RawMSSignalSimulation.h:93
std::vector< std::vector< double > > threaded_random_numbers_
Definition: RawMSSignalSimulation.h:258
RESOLUTIONMODEL
Definition: RawMSSignalSimulation.h:94
The class template is only implemented for D=2 because we use Peak2D here.
Definition: ProductModel.h:65
std::vector< SimCoordinateType > grid_
m/z sampling grid for all signals
Definition: RawMSSignalSimulation.h:238
std::vector< ContaminantInfo > contaminants_
Definition: RawMSSignalSimulation.h:253
Definition: RawMSSignalSimulation.h:243
Representation of an empirical formula.
Definition: EmpiricalFormula.h:78
SimCoordinateType mz_error_mean_
Mean of peak m/z error.
Definition: RawMSSignalSimulation.h:194
DoubleReal res_base_
base resolution at 400 Th
Definition: RawMSSignalSimulation.h:236
Int sampling_points_per_FWHM_
number of points sampled per peak&#39;s FWHM
Definition: RawMSSignalSimulation.h:191
IONIZATIONMETHOD im
Definition: RawMSSignalSimulation.h:250
Int q
Definition: RawMSSignalSimulation.h:248
EmpiricalFormula sf
Definition: RawMSSignalSimulation.h:246
PROFILESHAPE
Definition: RawMSSignalSimulation.h:93
Exponential-Gaussian hybrid distribution model for elution profiles.
Definition: EGHModel.h:56
SimRandomNumberGenerator const * rnd_gen_
Random number generator.
Definition: RawMSSignalSimulation.h:241
An LC-MS feature.
Definition: Feature.h:66
SimCoordinateType mz_error_stddev_
Standard deviation of peak m/z error.
Definition: RawMSSignalSimulation.h:196
bool contaminants_loaded_
Definition: RawMSSignalSimulation.h:268
Wrapper class for random number generators used by the simulation classes.
Definition: SimTypes.h:99
Peak2D::IntensityType SimIntensityType
Abundance of proteins/peptides.
Definition: SimTypes.h:62
Simulates MS signals for a given set of peptides.
Definition: RawMSSignalSimulation.h:61
DoubleReal rt_start
Definition: RawMSSignalSimulation.h:247
PROFILESHAPE shape
Definition: RawMSSignalSimulation.h:249
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:144
Base class for all classes that want to report their progess.
Definition: ProgressLogger.h:56
String name
Definition: RawMSSignalSimulation.h:245
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:90
SimIntensityType intensity_scale_
Scaling factor of peak intensities.
Definition: RawMSSignalSimulation.h:228
int Int
Signed integer type.
Definition: Types.h:100
SimIntensityType intensity_scale_stddev_
Standard deviation of peak intensity scaling.
Definition: RawMSSignalSimulation.h:230
std::vector< Size > threaded_random_numbers_index_
Definition: RawMSSignalSimulation.h:264

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:20 using doxygen 1.8.5