Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
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-2015.
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_SIMTYPES_H
36 #define OPENMS_SIMULATION_SIMTYPES_H
37 
38 #include <vector>
39 #include <utility>
40 #include <map>
41 #include <utility>
42 #include <boost/shared_ptr.hpp>
43 
44 #include <boost/random/mersenne_twister.hpp>
45 
46 #include <OpenMS/KERNEL/Peak2D.h>
54 
55 
56 
57 namespace OpenMS
58 {
59 
60  namespace SimTypes
61  {
64 
67 
70 
73 
77  struct SimProtein
78  {
83 
88  entry(e),
89  meta(m)
90  {}
91  };
92 
94  typedef std::vector<SimProtein> SampleProteins;
95 
97  typedef std::vector<SampleProteins> SampleChannels;
98 
101 
103  typedef std::vector<FeatureMapSim> FeatureMapSimVector;
104 
107 
123  {
124 public:
125 
126  boost::random::mt19937_64& getBiologicalRng()
127  {
128  return biological_rng_;
129  }
130 
131  boost::random::mt19937_64& getTechnicalRng()
132  {
133  return technical_rng_;
134  }
135 
136  void setBiologicalRngSeed(unsigned long int seed)
137  {
138  biological_rng_.seed(seed);
139  }
140 
141  void setTechnicalRngSeed(unsigned long int seed)
142  {
143  technical_rng_.seed(seed);
144  }
145 
147  void initialize(bool biological_random, bool technical_random)
148  {
149  // use 0 as default seed to get reproducible experiments
150  if (biological_random)
151  {
152  biological_rng_ = boost::random::mt19937_64(std::time(0));
153  }
154  else
155  {
156  biological_rng_ = boost::random::mt19937_64(0);
157  }
158 
159  if (technical_random)
160  {
161  technical_rng_ = boost::random::mt19937_64(std::time(0));
162  }
163  else
164  {
165  technical_rng_ = boost::random::mt19937_64(0);
166  }
167  }
168 
169 private:
171  boost::random::mt19937_64 biological_rng_;
173  boost::random::mt19937_64 technical_rng_;
174 
175  };
176 
177  //Sim Shared Pointer type
178  typedef boost::shared_ptr<SimRandomNumberGenerator> MutableSimRandomNumberGeneratorPtr;
179 
180  }
181 
182 }
183 
184 #endif
Peak1D SimPointType
Raw data point.
Definition: SimTypes.h:72
boost::random::mt19937_64 & getTechnicalRng()
Definition: SimTypes.h:131
FeatureMap FeatureMapSim
Sim FeatureMap.
Definition: SimTypes.h:100
Wrapper class for random number generators used by the simulation classes.
Definition: SimTypes.h:122
A container for features.
Definition: FeatureMap.h:93
boost::shared_ptr< SimRandomNumberGenerator > MutableSimRandomNumberGeneratorPtr
Definition: SimTypes.h:178
std::vector< SimProtein > SampleProteins
Container for FASTAEntry & abundance information.
Definition: SimTypes.h:94
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
MetaInfoInterface meta
MetaInfoInterface holding the abundance information.
Definition: SimTypes.h:82
boost::random::mt19937_64 & getBiologicalRng()
Definition: SimTypes.h:126
Peak2D::IntensityType SimIntensityType
Abundance of proteins/peptides.
Definition: SimTypes.h:66
SimProtein(FASTAFile::FASTAEntry &e, MetaInfoInterface &m)
c'tor
Definition: SimTypes.h:87
FASTAFile::FASTAEntry entry
FASTAEntry holding the sequence information.
Definition: SimTypes.h:80
std::vector< SampleProteins > SampleChannels
Container for multiple channels of SampleProteins.
Definition: SimTypes.h:97
Peak2D::CoordinateType SimCoordinateType
Coordinate type in mz and rt dimension.
Definition: SimTypes.h:63
boost::random::mt19937_64 technical_rng_
random number generator for technical variability
Definition: SimTypes.h:173
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:55
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:56
Feature::ChargeType SimChargeType
Charge of a peptide.
Definition: SimTypes.h:69
std::vector< FeatureMapSim > FeatureMapSimVector
Sim FeatureMap Vector.
Definition: SimTypes.h:103
void initialize(bool biological_random, bool technical_random)
Initialize the RNGs.
Definition: SimTypes.h:147
void setTechnicalRngSeed(unsigned long int seed)
Definition: SimTypes.h:141
Plain data object holding sequence and abundance information on a single protein. ...
Definition: SimTypes.h:77
FASTA entry type (identifier, description and sequence)
Definition: FASTAFile.h:61
Int ChargeType
Type of charge values.
Definition: BaseFeature.h:65
void setBiologicalRngSeed(unsigned long int seed)
Definition: SimTypes.h:136
MSExperiment< SimPointType > MSSimExperiment
Sim MSExperiment type.
Definition: SimTypes.h:106
boost::random::mt19937_64 biological_rng_
random number generator for biological variability
Definition: SimTypes.h:171

OpenMS / TOPP release 2.0.0 Documentation generated on Sat May 16 2015 16:13:33 using doxygen 1.8.9.1