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-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_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 
50 #include <OpenMS/KERNEL/Peak2D.h>
53 
54 namespace OpenMS
55 {
56 
57  namespace SimTypes
58  {
61 
64 
67 
70 
74  struct SimProtein
75  {
80 
85  entry(e),
86  meta(m)
87  {}
88  };
89 
91  typedef std::vector<SimProtein> SampleProteins;
92 
94  typedef std::vector<SampleProteins> SampleChannels;
95 
98 
100  typedef std::vector<FeatureMapSim> FeatureMapSimVector;
101 
104 
120  {
121 public:
122 
123  boost::random::mt19937_64& getBiologicalRng()
124  {
125  return biological_rng_;
126  }
127 
128  boost::random::mt19937_64& getTechnicalRng()
129  {
130  return technical_rng_;
131  }
132 
133  void setBiologicalRngSeed(unsigned long int seed)
134  {
135  biological_rng_.seed(seed);
136  }
137 
138  void setTechnicalRngSeed(unsigned long int seed)
139  {
140  technical_rng_.seed(seed);
141  }
142 
144  void initialize(bool biological_random, bool technical_random)
145  {
146  // use 0 as default seed to get reproducible experiments
147  if (biological_random)
148  {
149  biological_rng_ = boost::random::mt19937_64(std::time(0));
150  }
151  else
152  {
153  biological_rng_ = boost::random::mt19937_64(0);
154  }
155 
156  if (technical_random)
157  {
158  technical_rng_ = boost::random::mt19937_64(std::time(0));
159  }
160  else
161  {
162  technical_rng_ = boost::random::mt19937_64(0);
163  }
164  }
165 
166 private:
168  boost::random::mt19937_64 biological_rng_;
170  boost::random::mt19937_64 technical_rng_;
171 
172  };
173 
174  //Sim Shared Pointer type
175  typedef boost::shared_ptr<SimRandomNumberGenerator> MutableSimRandomNumberGeneratorPtr;
176 
177  }
178 
179 }
180 
181 #endif
Peak1D SimPointType
Raw data point.
Definition: SimTypes.h:69
boost::random::mt19937_64 & getTechnicalRng()
Definition: SimTypes.h:128
FeatureMap FeatureMapSim
Sim FeatureMap.
Definition: SimTypes.h:97
Int ChargeType
Type of charge values.
Definition: BaseFeature.h:65
Wrapper class for random number generators used by the simulation classes.
Definition: SimTypes.h:119
A container for features.
Definition: FeatureMap.h:94
boost::shared_ptr< SimRandomNumberGenerator > MutableSimRandomNumberGeneratorPtr
Definition: SimTypes.h:175
PeakMap MSSimExperiment
Sim MSExperiment type.
Definition: SimTypes.h:103
std::vector< SimProtein > SampleProteins
Container for FASTAEntry & abundance information.
Definition: SimTypes.h:91
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
MetaInfoInterface meta
MetaInfoInterface holding the abundance information.
Definition: SimTypes.h:79
boost::random::mt19937_64 & getBiologicalRng()
Definition: SimTypes.h:123
Peak2D::IntensityType SimIntensityType
Abundance of proteins/peptides.
Definition: SimTypes.h:63
SimProtein(FASTAFile::FASTAEntry &e, MetaInfoInterface &m)
c&#39;tor
Definition: SimTypes.h:84
FASTAFile::FASTAEntry entry
FASTAEntry holding the sequence information.
Definition: SimTypes.h:77
std::vector< SampleProteins > SampleChannels
Container for multiple channels of SampleProteins.
Definition: SimTypes.h:94
Peak2D::CoordinateType SimCoordinateType
Coordinate type in mz and rt dimension.
Definition: SimTypes.h:60
boost::random::mt19937_64 technical_rng_
random number generator for technical variability
Definition: SimTypes.h:170
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:66
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:82
std::vector< FeatureMapSim > FeatureMapSimVector
Sim FeatureMap Vector.
Definition: SimTypes.h:100
void initialize(bool biological_random, bool technical_random)
Initialize the RNGs.
Definition: SimTypes.h:144
void setTechnicalRngSeed(unsigned long int seed)
Definition: SimTypes.h:138
Plain data object holding sequence and abundance information on a single protein. ...
Definition: SimTypes.h:74
FASTA entry type (identifier, description and sequence)
Definition: FASTAFile.h:74
void setBiologicalRngSeed(unsigned long int seed)
Definition: SimTypes.h:133
boost::random::mt19937_64 biological_rng_
random number generator for biological variability
Definition: SimTypes.h:168

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