OpenMS  2.4.0
SimTypes.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: Timo Sachsenberg$
32 // $Authors: Stephan Aiche, Chris Bielow$
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <vector>
38 #include <utility>
39 #include <map>
40 #include <utility>
41 #include <boost/shared_ptr.hpp>
42 
43 #include <boost/random/mersenne_twister.hpp>
44 
49 #include <OpenMS/KERNEL/Peak2D.h>
52 
53 namespace OpenMS
54 {
55 
56  namespace SimTypes
57  {
60 
63 
66 
69 
73  struct SimProtein
74  {
79 
84  entry(e),
85  meta(m)
86  {}
87  };
88 
90  typedef std::vector<SimProtein> SampleProteins;
91 
93  typedef std::vector<SampleProteins> SampleChannels;
94 
97 
99  typedef std::vector<FeatureMapSim> FeatureMapSimVector;
100 
103 
119  {
120 public:
121 
122  boost::random::mt19937_64& getBiologicalRng()
123  {
124  return biological_rng_;
125  }
126 
127  boost::random::mt19937_64& getTechnicalRng()
128  {
129  return technical_rng_;
130  }
131 
132  void setBiologicalRngSeed(unsigned long int seed)
133  {
134  biological_rng_.seed(seed);
135  }
136 
137  void setTechnicalRngSeed(unsigned long int seed)
138  {
139  technical_rng_.seed(seed);
140  }
141 
143  void initialize(bool biological_random, bool technical_random)
144  {
145  // use 0 as default seed to get reproducible experiments
146  if (biological_random)
147  {
148  biological_rng_ = boost::random::mt19937_64(std::time(nullptr));
149  }
150  else
151  {
152  biological_rng_ = boost::random::mt19937_64(0);
153  }
154 
155  if (technical_random)
156  {
157  technical_rng_ = boost::random::mt19937_64(std::time(nullptr));
158  }
159  else
160  {
161  technical_rng_ = boost::random::mt19937_64(0);
162  }
163  }
164 
165 private:
167  boost::random::mt19937_64 biological_rng_;
169  boost::random::mt19937_64 technical_rng_;
170 
171  };
172 
173  //Sim Shared Pointer type
174  typedef boost::shared_ptr<SimRandomNumberGenerator> MutableSimRandomNumberGeneratorPtr;
175 
176  }
177 
178 }
179 
Peak1D SimPointType
Raw data point.
Definition: SimTypes.h:68
boost::random::mt19937_64 & getTechnicalRng()
Definition: SimTypes.h:127
FeatureMap FeatureMapSim
Sim FeatureMap.
Definition: SimTypes.h:96
Int ChargeType
Type of charge values.
Definition: BaseFeature.h:64
Wrapper class for random number generators used by the simulation classes.
Definition: SimTypes.h:118
A container for features.
Definition: FeatureMap.h:93
boost::shared_ptr< SimRandomNumberGenerator > MutableSimRandomNumberGeneratorPtr
Definition: SimTypes.h:174
PeakMap MSSimExperiment
Sim MSExperiment type.
Definition: SimTypes.h:102
std::vector< SimProtein > SampleProteins
Container for FASTAEntry & abundance information.
Definition: SimTypes.h:90
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
MetaInfoInterface meta
MetaInfoInterface holding the abundance information.
Definition: SimTypes.h:78
boost::random::mt19937_64 & getBiologicalRng()
Definition: SimTypes.h:122
Peak2D::IntensityType SimIntensityType
Abundance of proteins/peptides.
Definition: SimTypes.h:62
SimProtein(FASTAFile::FASTAEntry &e, MetaInfoInterface &m)
c&#39;tor
Definition: SimTypes.h:83
FASTAFile::FASTAEntry entry
FASTAEntry holding the sequence information.
Definition: SimTypes.h:76
std::vector< SampleProteins > SampleChannels
Container for multiple channels of SampleProteins.
Definition: SimTypes.h:93
Peak2D::CoordinateType SimCoordinateType
Coordinate type in mz and rt dimension.
Definition: SimTypes.h:59
boost::random::mt19937_64 technical_rng_
random number generator for technical variability
Definition: SimTypes.h:169
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:54
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:55
Feature::ChargeType SimChargeType
Charge of a peptide.
Definition: SimTypes.h:65
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
std::vector< FeatureMapSim > FeatureMapSimVector
Sim FeatureMap Vector.
Definition: SimTypes.h:99
void initialize(bool biological_random, bool technical_random)
Initialize the RNGs.
Definition: SimTypes.h:143
void setTechnicalRngSeed(unsigned long int seed)
Definition: SimTypes.h:137
Plain data object holding sequence and abundance information on a single protein. ...
Definition: SimTypes.h:73
FASTA entry type (identifier, description and sequence)
Definition: FASTAFile.h:76
void setBiologicalRngSeed(unsigned long int seed)
Definition: SimTypes.h:132
boost::random::mt19937_64 biological_rng_
random number generator for biological variability
Definition: SimTypes.h:167