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-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_SIMTYPES_H
36 #define OPENMS_SIMULATION_SIMTYPES_H
37 
38 #include <vector>
39 #include <utility>
40 #include <map>
41 #include <utility>
42 
43 #include <OpenMS/KERNEL/Peak2D.h>
51 
52 // GSL includes (random number generation)
53 #include <gsl/gsl_rng.h>
54 #include <gsl/gsl_randist.h>
55 
56 namespace OpenMS
57 {
60 
63 
66 
69 
71  class OPENMS_DLLAPI SampleProteins : public std::vector<std::pair<FASTAFile::FASTAEntry, MetaInfoInterface> > { };
72 
74  class OPENMS_DLLAPI SampleChannels : public std::vector<SampleProteins> { };
75 
78 
80  typedef std::vector<FeatureMapSim> FeatureMapSimVector;
81 
84 
100  {
102  gsl_rng * biological_rng;
104  gsl_rng * technical_rng;
105 
110  {
111  }
112 
120  {
121  }
122 
125  {
126  if (biological_rng != 0)
127  {
128  gsl_rng_free(biological_rng);
129  }
130 
131  if (technical_rng != 0)
132  {
133  gsl_rng_free(technical_rng);
134  }
135  }
136 
138 
141  {
142  this->biological_rng = source.biological_rng;
143  this->technical_rng = source.technical_rng;
144 
145  return *this;
146  }
147 
149  void initialize(bool biological_random, bool technical_random)
150  {
151  biological_rng = gsl_rng_alloc(gsl_rng_mt19937);
152  if (biological_random)
153  {
154  gsl_rng_set(biological_rng, time(0));
155  }
156  else // use gsl default seed to get reproducible experiments
157  {
158  gsl_rng_set(biological_rng, 0);
159  }
160 
161  technical_rng = gsl_rng_alloc(gsl_rng_mt19937);
162  if (technical_random)
163  {
164  gsl_rng_set(technical_rng, time(0));
165  }
166  else // use gsl default seed to get reproducible experiments
167  {
168  gsl_rng_set(technical_rng, 0);
169  }
170  }
171 
172  };
173 
174 }
175 
176 #endif
Feature::ChargeType SimChargeType
Charge of a peptide.
Definition: SimTypes.h:65
Peak1D SimPointType
Raw data point.
Definition: SimTypes.h:68
Real IntensityType
Intensity type.
Definition: Peak2D.h:63
void initialize(bool biological_random, bool technical_random)
Initialize the RNGs.
Definition: SimTypes.h:149
FeatureMap FeatureMapSim
Sim FeatureMap.
Definition: SimTypes.h:77
Int ChargeType
Type of charge values.
Definition: BaseFeature.h:64
#define NULL
Definition: IsotopeWaveletParallelFor.h:41
Container for multiple channels of SampleProteins.
Definition: SimTypes.h:74
Peak2D::CoordinateType SimCoordinateType
Coordinate type in mz and rt dimension.
Definition: SimTypes.h:59
~SimRandomNumberGenerator()
Destructor.
Definition: SimTypes.h:124
gsl_rng * biological_rng
GSL random number generator for biological variability.
Definition: SimTypes.h:102
A 1-dimensional raw data point or peak.
Definition: Peak1D.h:55
SimRandomNumberGenerator & operator=(const SimRandomNumberGenerator &source)
Assignment operator.
Definition: SimTypes.h:140
MSExperiment< SimPointType > MSSimExperiment
Sim MSExperiment type.
Definition: SimTypes.h:83
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
SimRandomNumberGenerator()
Default constructor.
Definition: SimTypes.h:107
Container for FASTAEntry &amp; abundance information.
Definition: SimTypes.h:71
gsl_rng * technical_rng
GSL random number generator for technical variability.
Definition: SimTypes.h:104
std::vector< FeatureMapSim > FeatureMapSimVector
Sim FeatureMap Vector.
Definition: SimTypes.h:80

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