Nemo  2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
TProtoQuanti Class Reference

TProtoQuanti. More...

#include <ttquanti.h>

+ Inheritance diagram for TProtoQuanti:
+ Collaboration diagram for TProtoQuanti:

Public Member Functions

 TProtoQuanti ()
 
 TProtoQuanti (const TProtoQuanti &T)
 
virtual ~TProtoQuanti ()
 
unsigned int get_nb_traits ()
 
unsigned int get_nb_locus ()
 
unsigned int get_seq_length ()
 
vector< double > get_env_var ()
 
vector< double > get_heritability ()
 
unsigned int get_h2_setTime ()
 
bool get_h2_isBroad ()
 
double get_trait_var (unsigned int trait)
 
double get_mutation_correlation ()
 
unsigned int get_allele_model ()
 
double ** get_allele_values () const
 
double get_init_value (unsigned int i)
 
TTQuantiSHget_stater ()
 
void set_eVarianceSD (unsigned int trait, double SD)
 
void set_init_values (const double *values, unsigned int nval)
 
void set_trait_value_func_ptr (bool withVe)
 
double set_trait_value_VE (const TTQuanti *ind, const unsigned int trait)
 
double set_trait_value_noVE (const TTQuanti *ind, const unsigned int trait)
 
double set_genotype_value_additive (const double **sequ, const unsigned int trait)
 
double set_genotype_value_dominance (const double **sequ, const unsigned int trait)
 
double get_genotype (const double a1, const double a2, const unsigned int locus, const unsigned int trait)
 
double get_genotype_dominance_h (double a1, double a2, double h)
 
double get_genotype_dominance_k (double a1, double a2, double k)
 
unsigned int get_dominance_model ()
 
double get_dominance (unsigned int locus, unsigned int trait)
 
TMatrix get_dominance_effects ()
 
bool setMutationParameters ()
 
bool setDominanceParameters ()
 
void reset_mutation_pointers ()
 
bool setDiallelicMutationModel ()
 
bool setContinuousMutationModel ()
 
void set_mutation_matrix_decomposition ()
 
double * getMutationEffectMultivariateGaussian (unsigned int loc)
 
double * getMutationEffectBivariateGaussian (unsigned int loc)
 
double * getMutationEffectUnivariateGaussian (unsigned int loc)
 
double * getMutationEffectUnivariateDiallelic (unsigned int loc)
 
double * getMutationEffectBivariateDiallelic (unsigned int loc)
 
void inherit (sex_t SEX, double *seq, const double **parent)
 
void inherit_free (sex_t SEX, double *seq, const double **parent)
 
void inherit_low (sex_t SEX, double *seq, const double **parent)
 
void mutate (TTQuanti *ind)
 
void mutate_nill (TTQuanti *ind)
 
void mutate_noHC (TTQuanti *ind)
 
void mutate_HC (TTQuanti *ind)
 
void mutate_diallelic_HC (TTQuanti *ind)
 
virtual void reset ()
 
virtual TTQuantihatch ()
 
virtual TProtoQuanticlone ()
 
virtual trait_t get_type () const
 
virtual bool setParameters ()
 
virtual void loadFileServices (FileServices *loader)
 
virtual void loadStatServices (StatServices *loader)
 
virtual bool resetParameterFromSource (std::string param, SimComponent *cmpt)
 
virtual void store_data (BinaryStorageBuffer *saver)
 
virtual bool retrieve_data (BinaryStorageBuffer *reader)
 
- Public Member Functions inherited from TTProtoWithMap
 TTProtoWithMap ()
 
 TTProtoWithMap (const TTProtoWithMap &TP)
 
virtual ~TTProtoWithMap ()
 
void setMapIndex (unsigned int idx)
 
unsigned int getMapIndex ()
 
bool setGeneticMapParameters (string prefix)
 
void addGeneticMapParameters (string prefix)
 
bool setRecombinationMapRandom ()
 
bool setRecombinationMapNonRandom (vector< vector< double > > *lociPositions)
 
bool setRecombinationMapFixed ()
 
bool setNumLociPerChromosome (string param_name)
 
void reset_recombination_pointers ()
 
void registerGeneticMap ()
 
void unregisterFromGeneticMap ()
 
bool areGeneticMapParamSet (string prefix)
 
bool isRecombinationFree (string prefix)
 
void recordRandomMap ()
 
virtual void reset ()
 
- Public Member Functions inherited from TraitPrototype
virtual void reset ()=0
 Called at the end of a simulation to reset the Traits' prototypes (e.g. More...
 
virtual TTraithatch ()=0
 Creates the trait of which it is the prototype, called by IndFactory::makePrototype(). More...
 
virtual TraitPrototypeclone ()=0
 Returns a copy of itself. More...
 
virtual trait_t get_type () const =0
 Type accessor. More...
 
virtual void set_index (int idx)
 Sets the traits index. More...
 
virtual int get_index ()
 Index getter. More...
 
- Public Member Functions inherited from StorableComponent
virtual void store_data (BinaryStorageBuffer *saver)=0
 Interface to store the component data (e.g. gene values) into a binary buffer. More...
 
virtual bool retrieve_data (BinaryStorageBuffer *reader)=0
 Interface to retrieve the same data from the binary buffer. More...
 
virtual ~StorableComponent ()
 
- Public Member Functions inherited from SimComponent
 SimComponent ()
 
virtual ~SimComponent ()
 
virtual void loadUpdaters (UpdaterServices *loader)
 Loads the parameters and component updater onto the updater manager. More...
 
virtual void set_paramset (ParamSet *paramset)
 Sets the ParamSet member. More...
 
virtual void set_paramset (std::string name, bool required, SimComponent *owner)
 Sets a new ParamSet and name it. More...
 
virtual void set_paramsetFromCopy (const ParamSet &PSet)
 Reset the set of parameters from a another set. More...
 
virtual ParamSetget_paramset ()
 ParamSet accessor. More...
 
virtual void add_parameter (Param *param)
 Interface to add a parameter to the set. More...
 
virtual void add_parameter (std::string Name, param_t Type, bool isRequired, bool isBounded, double low_bnd, double up_bnd)
 Interface to add a parameter to the set. More...
 
virtual void add_parameter (std::string Name, param_t Type, bool isRequired, bool isBounded, double low_bnd, double up_bnd, ParamUpdaterBase *updater)
 Interface to add a parameter and its updater to the set. More...
 
virtual Paramget_parameter (std::string name)
 Param getter. More...
 
virtual double get_parameter_value (std::string name)
 Param value getter. More...
 
virtual string get_name ()
 Returnd the name of the ParamSet, i.e. More...
 
virtual bool has_parameter (std::string name)
 Param getter. More...
 

Private Attributes

unsigned int _nb_locus
 Total number of loci, for all traits. More...
 
unsigned int _nb_traits
 Number of traits. More...
 
unsigned int _seq_length
 Total number of loci, same as _nb_locus. More...
 
unsigned int _allele_model
 
double ** _allele_value
 
double * _init_value
 
double * _phenotypes
 
TMatrix_mutation_matrix
 
gsl_matrix * _gsl_mutation_matrix
 
gsl_matrix * _evect
 
gsl_vector * _eval
 
gsl_vector * _effects_multivar
 
gsl_vector * _ws
 
double _genomic_mutation_rate
 
double _mutation_correlation
 
double * _mutation_sigma
 
double _effects_bivar [2]
 
unsigned int _doInitMutation
 
unsigned int _dominance_model
 
TMatrix _dominance_sd
 
TMatrix _dominance_effects
 
bool _dominance_is_constant
 
bool * _all_chooser
 
size_t _locusByteSize
 
size_t _sizeofLocusType
 
vector< double > _eVariance
 
vector< double > _h2
 
unsigned int _h2_setTime
 
bool _h2_isBroad
 
void(TProtoQuanti::* _inherit_fun_ptr )(sex_t, double *, const double **)
 
void(TProtoQuanti::* _mutation_func_ptr )(TTQuanti *)
 
double *(TProtoQuanti::* _getMutationValues )(unsigned int)
 
double(TProtoQuanti::* _getGenotypeWithDominance )(double, double, double)
 
double(TProtoQuanti::* _set_trait_value_func_ptr )(const TTQuanti *, const unsigned int)
 
double(TProtoQuanti::* _set_genotype_func_ptr )(const double **, const unsigned int)
 
TTQuantiSH_stats
 
TTQuantiFH_writer
 
TTQuantiFH_reader
 
TTQFreqExtractor_freqExtractor
 

Friends

class TTQuanti
 

Additional Inherited Members

- Static Public Member Functions inherited from TTProtoWithMap
static void recombine (unsigned long indID)
 
- Static Public Attributes inherited from TTProtoWithMap
static GeneticMap _map
 
- Protected Attributes inherited from TTProtoWithMap
unsigned int _mapIndex
 
double _totRecombEventsMean
 
double _recombRate
 
double _mapResolution
 
unsigned int _numChromosome
 
unsigned int _numLoci
 
double * _recombRatePerChrmsm
 
unsigned int_numLociPerChrmsm
 
unsigned int_chrsmLength
 
unsigned int_lociMapPositions
 
- Protected Attributes inherited from TraitPrototype
int _index
 The trait index in the Individual traits table. More...
 
- Protected Attributes inherited from SimComponent
ParamSet_paramSet
 The parameters container. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ TProtoQuanti() [1/2]

TProtoQuanti::TProtoQuanti ( )
60 :
61 _nb_locus(0),
62 _nb_traits(0),
63 _seq_length(0),
68 _evect(0),
69 _eval(0),
71 _ws(0),
75 _init_value(0),
76 _phenotypes(0),
78 _h2_setTime(0),
79 _h2_isBroad(0),
83 _all_chooser(0),
85 _sizeofLocusType(sizeof(double)),
86 _eVariance(0),
93 _stats(0),
94 _writer(0),
95 _reader(0),
97{
98 set_paramset("quantitative_trait", false, this);
99
100 add_parameter("quanti_traits",INT,true,false,0,0);
101 add_parameter("quanti_loci",INT,true,false,0,0);
102 add_parameter("quanti_allele_model",STR,false,false,0,0);
103 add_parameter("quanti_allele_value",DBL,false,false,0,0);
104 add_parameter("quanti_init_value",MAT,false,false,0,0);
105 add_parameter("quanti_init_model",INT,false,true,0,4);
106
107 add_parameter("quanti_environmental_variance",DBL,false,false,0,0);
108 add_parameter("quanti_heritability", DBL, false, false, 0, 0);
109 add_parameter("quanti_heritability_setTime",INT, false, false, 0,0);
110 add_parameter("quanti_heritability_isBroad",BOOL, false, false, 0,0);
111
112 add_parameter("quanti_mutation_rate",DBL,true,true,0,1, 0);
113 add_parameter("quanti_mutation_variance",DBL,false,false,0,0, 0);
114 add_parameter("quanti_mutation_correlation",DBL,false,false,0,0, 0);
115 add_parameter("quanti_mutation_matrix",MAT,false,false,0,0, 0);
116
117 add_parameter("quanti_dominance_model", INT, false, true, 0, 1, 0);
118 add_parameter("quanti_dominance_mean", DBL, false, false, 0, 0, 0);
119 add_parameter("quanti_dominance_sd", DBL, false, false, 0, 0, 0);
120 add_parameter("quanti_dominance_effects", DBL, false, false, 0, 0, 0);
121
122 //genetic map parameters:
124
125 add_parameter("quanti_output",STR,false,false,0,0);
126 add_parameter("quanti_logtime",INT,false,false,0,0);
127 add_parameter("quanti_dir",STR,false,false,0,0);
128
129 add_parameter("quanti_freq_output",BOOL,false,false,0,0);
130 add_parameter("quanti_freq_logtime",INT,false,false,0,0);
131}
virtual void set_paramset(ParamSet *paramset)
Sets the ParamSet member.
Definition: simcomponent.h:86
virtual void add_parameter(Param *param)
Interface to add a parameter to the set.
Definition: simcomponent.h:112
vector< double > _eVariance
Definition: ttquanti.h:230
unsigned int _allele_model
Definition: ttquanti.h:203
TMatrix _dominance_sd
Definition: ttquanti.h:221
size_t _sizeofLocusType
Definition: ttquanti.h:228
unsigned int _doInitMutation
Definition: ttquanti.h:219
gsl_vector * _effects_multivar
Definition: ttquanti.h:213
void(TProtoQuanti::* _inherit_fun_ptr)(sex_t, double *, const double **)
Definition: ttquanti.h:235
unsigned int _dominance_model
Definition: ttquanti.h:220
double *(TProtoQuanti::* _getMutationValues)(unsigned int)
Definition: ttquanti.h:237
bool _h2_isBroad
Definition: ttquanti.h:233
TTQuantiFH * _reader
Definition: ttquanti.h:246
gsl_vector * _eval
Definition: ttquanti.h:212
unsigned int _h2_setTime
Definition: ttquanti.h:232
unsigned int _seq_length
Total number of loci, same as _nb_locus.
Definition: ttquanti.h:202
gsl_matrix * _gsl_mutation_matrix
Definition: ttquanti.h:210
double * _phenotypes
Definition: ttquanti.h:206
bool _dominance_is_constant
Definition: ttquanti.h:223
TTQuantiSH * _stats
Definition: ttquanti.h:244
void(TProtoQuanti::* _mutation_func_ptr)(TTQuanti *)
Definition: ttquanti.h:236
double _genomic_mutation_rate
Definition: ttquanti.h:215
bool * _all_chooser
Definition: ttquanti.h:226
double(TProtoQuanti::* _getGenotypeWithDominance)(double, double, double)
Definition: ttquanti.h:238
unsigned int _nb_traits
Number of traits.
Definition: ttquanti.h:200
size_t _locusByteSize
Definition: ttquanti.h:227
gsl_matrix * _evect
Definition: ttquanti.h:211
double(TProtoQuanti::* _set_trait_value_func_ptr)(const TTQuanti *, const unsigned int)
Definition: ttquanti.h:239
gsl_vector * _ws
Definition: ttquanti.h:214
double _mutation_correlation
Definition: ttquanti.h:216
double * _init_value
Definition: ttquanti.h:205
TTQuantiFH * _writer
Definition: ttquanti.h:245
unsigned int _nb_locus
Total number of loci, for all traits.
Definition: ttquanti.h:198
TMatrix * _mutation_matrix
Definition: ttquanti.h:209
double * _mutation_sigma
Definition: ttquanti.h:217
double(TProtoQuanti::* _set_genotype_func_ptr)(const double **, const unsigned int)
Definition: ttquanti.h:240
double ** _allele_value
Definition: ttquanti.h:204
TTQFreqExtractor * _freqExtractor
Definition: ttquanti.h:247
void addGeneticMapParameters(string prefix)
Definition: ttrait_with_map.cc:77
@ DBL
Definition: types.h:78
@ MAT
Definition: types.h:78
@ BOOL
Definition: types.h:78
@ STR
Definition: types.h:78
@ INT
Definition: types.h:78

References SimComponent::add_parameter(), TTProtoWithMap::addGeneticMapParameters(), BOOL, DBL, INT, MAT, SimComponent::set_paramset(), and STR.

Referenced by clone().

+ Here is the caller graph for this function:

◆ TProtoQuanti() [2/2]

TProtoQuanti::TProtoQuanti ( const TProtoQuanti T)
135 :
142 _evect(0),
143 _eval(0),
145 _ws(0),
149 _init_value(0),
150 _phenotypes(0),
151 _h2_setTime(0),
152 _h2_isBroad(0),
157 _allele_value(0),
158 _all_chooser(0),
160 _sizeofLocusType(sizeof(double)),
161 _eVariance(0),
168 _stats(0),
169 _writer(0),
170 _reader(0),
172{
173 _locusByteSize = T._nb_traits * sizeof(double);
174 _paramSet = new ParamSet( *(T._paramSet) ) ;
175}
Parameters container, implemented in each SimComponent.
Definition: param.h:206
ParamSet * _paramSet
The parameters container.
Definition: simcomponent.h:48

References _locusByteSize, _nb_traits, and SimComponent::_paramSet.

◆ ~TProtoQuanti()

TProtoQuanti::~TProtoQuanti ( )
virtual
180{
182
183 if(_stats != NULL){delete _stats; _stats = NULL;}
184 if(_writer != NULL){delete _writer; _writer = NULL;}
185 if(_reader) delete _reader;
186 if(_freqExtractor != NULL){delete _freqExtractor; _freqExtractor = NULL;}
187 if(_all_chooser) {delete [] _all_chooser; _all_chooser = NULL;}
188 if(_init_value) {delete[] _init_value;_init_value = NULL;}
189}
void reset_mutation_pointers()
Definition: ttquanti.cc:971

References _all_chooser, _freqExtractor, _init_value, _reader, _stats, _writer, and reset_mutation_pointers().

Member Function Documentation

◆ clone()

virtual TProtoQuanti * TProtoQuanti::clone ( )
inlinevirtual

Implements TraitPrototype.

178{return new TProtoQuanti(*this);}
TProtoQuanti()
Definition: ttquanti.cc:60

References TProtoQuanti().

◆ get_allele_model()

unsigned int TProtoQuanti::get_allele_model ( )
inline
130{return _allele_model;}

References _allele_model.

Referenced by LCE_QuantiInit::setParameters(), and TTQuantiFH::write_PLINK().

+ Here is the caller graph for this function:

◆ get_allele_values()

double ** TProtoQuanti::get_allele_values ( ) const
inline

◆ get_dominance()

double TProtoQuanti::get_dominance ( unsigned int  locus,
unsigned int  trait 
)
inline
148 {return _dominance_effects.get(trait, locus); }
double get(unsigned int i, unsigned int j)
Accessor to element at row i and column j.
Definition: tmatrix.h:147
TMatrix _dominance_effects
Definition: ttquanti.h:222

References _dominance_effects, and TMatrix::get().

Referenced by get_genotype(), TTQuantiSH::getVaWithDominance(), set_genotype_value_dominance(), and TTQuantiFH::write_TABLE().

+ Here is the caller graph for this function:

◆ get_dominance_effects()

TMatrix TProtoQuanti::get_dominance_effects ( )
inline
149{return _dominance_effects;}

References _dominance_effects.

◆ get_dominance_model()

unsigned int TProtoQuanti::get_dominance_model ( )
inline

◆ get_env_var()

vector< double > TProtoQuanti::get_env_var ( )
inline
124{return _eVariance;}

References _eVariance.

Referenced by TTQuantiFH::FHread(), TTQuantiSH::init(), and TTQuantiFH::write_TABLE().

+ Here is the caller graph for this function:

◆ get_genotype()

double TProtoQuanti::get_genotype ( const double  a1,
const double  a2,
const unsigned int  locus,
const unsigned int  trait 
)
1107{
1108 return (this->*_getGenotypeWithDominance)( a1 , a2, get_dominance(locus, trait));
1109}
double get_dominance(unsigned int locus, unsigned int trait)
Definition: ttquanti.h:147

References _getGenotypeWithDominance, and get_dominance().

Referenced by TTQuantiSH::getVaWithDominance().

+ Here is the caller graph for this function:

◆ get_genotype_dominance_h()

double TProtoQuanti::get_genotype_dominance_h ( double  a1,
double  a2,
double  h 
)
inline
1085{
1086 if(a1<a2) return 2*((1-h)*a1 + h*a2);
1087 return 2*((1-h)*a2 + h*a1);
1088}

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ get_genotype_dominance_k()

double TProtoQuanti::get_genotype_dominance_k ( double  a1,
double  a2,
double  k 
)
inline
1102{
1103 return a1 + a2 + k*abs(a2-a1);
1104}

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ get_h2_isBroad()

bool TProtoQuanti::get_h2_isBroad ( )
inline
127{return _h2_isBroad;}

References _h2_isBroad.

Referenced by TTQuantiSH::getVaWithDominance().

+ Here is the caller graph for this function:

◆ get_h2_setTime()

unsigned int TProtoQuanti::get_h2_setTime ( )
inline
126{return _h2_setTime;}

References _h2_setTime.

Referenced by LCE_Breed_Quanti::setVefromVa().

+ Here is the caller graph for this function:

◆ get_heritability()

vector< double > TProtoQuanti::get_heritability ( )
inline
125{return _h2;}
vector< double > _h2
Definition: ttquanti.h:231

References _h2.

Referenced by LCE_QuantiModifier::execute(), TTQuantiSH::init(), LCE_Breed_Quanti::NonWrightFisherPopulation(), and LCE_Breed_Quanti::WrightFisherPopulation().

+ Here is the caller graph for this function:

◆ get_init_value()

double TProtoQuanti::get_init_value ( unsigned int  i)
inline
132{return _init_value[i]; }

References _init_value.

◆ get_mutation_correlation()

double TProtoQuanti::get_mutation_correlation ( )
inline
129{return _mutation_correlation;}

References _mutation_correlation.

◆ get_nb_locus()

◆ get_nb_traits()

◆ get_seq_length()

unsigned int TProtoQuanti::get_seq_length ( )
inline
123{return _seq_length;}

References _seq_length.

◆ get_stater()

TTQuantiSH * TProtoQuanti::get_stater ( )
inline
133{return _stats;}

References _stats.

Referenced by LCE_QuantiModifier::setVefromVa(), and LCE_Breed_Quanti::setVefromVa().

+ Here is the caller graph for this function:

◆ get_trait_var()

double TProtoQuanti::get_trait_var ( unsigned int  trait)
inline
128{return _mutation_matrix->get(trait, trait);}

References _mutation_matrix, and TMatrix::get().

◆ get_type()

virtual trait_t TProtoQuanti::get_type ( ) const
inlinevirtual

Implements TraitPrototype.

179{return QUANT;}
#define QUANT
Definition: types.h:72

References QUANT.

Referenced by TTQuantiSH::init(), and TTQuantiFH::write_PLINK().

+ Here is the caller graph for this function:

◆ getMutationEffectBivariateDiallelic()

double * TProtoQuanti::getMutationEffectBivariateDiallelic ( unsigned int  loc)
961{
962 bool pos = RAND::RandBool();
963 _effects_bivar[0] = _allele_value[loc][pos];
965 pos : RAND::RandBool()) ];
966 return &_effects_bivar[0];
967}
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:125
static bool RandBool()
Returns a random boolean.
Definition: Uniform.h:163
double _effects_bivar[2]
Definition: ttquanti.h:218

References _allele_value, _effects_bivar, _mutation_correlation, RAND::RandBool(), and RAND::Uniform().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ getMutationEffectBivariateGaussian()

double * TProtoQuanti::getMutationEffectBivariateGaussian ( unsigned int  loc)
936{
939 return &_effects_bivar[0];
940}
static void BivariateGaussian(double sigma1, double sigma2, double rho, double *out1, double *out2)
Definition: Uniform.h:331

References _effects_bivar, _mutation_correlation, _mutation_sigma, and RAND::BivariateGaussian().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ getMutationEffectMultivariateGaussian()

double * TProtoQuanti::getMutationEffectMultivariateGaussian ( unsigned int  loc)
928{
929 RAND::MultivariateGaussian(_eval, _evect, _ws, _effects_multivar);
930 return _effects_multivar->data;
931}

References _effects_multivar, _eval, _evect, and _ws.

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ getMutationEffectUnivariateDiallelic()

double * TProtoQuanti::getMutationEffectUnivariateDiallelic ( unsigned int  loc)
953{
955 return &_effects_bivar[0];
956}

References _allele_value, _effects_bivar, and RAND::RandBool().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ getMutationEffectUnivariateGaussian()

double * TProtoQuanti::getMutationEffectUnivariateGaussian ( unsigned int  loc)
945{
947 return &_effects_bivar[0];
948}
static double Gaussian(double sigma)
Definition: Uniform.h:262

References _effects_bivar, _mutation_sigma, and RAND::Gaussian().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ hatch()

TTQuanti * TProtoQuanti::hatch ( )
virtual

Implements TraitPrototype.

1294{
1295 TTQuanti* kid = new TTQuanti();
1296
1297 kid->set_proto(this);
1298
1299 return kid;
1300}
friend class TTQuanti
Definition: ttquanti.h:242
TTQuanti.
Definition: ttquanti.h:56
void set_proto(TProtoQuanti *proto)
Definition: ttquanti.h:93

References TTQuanti::set_proto(), and TTQuanti.

◆ inherit()

void TProtoQuanti::inherit ( sex_t  SEX,
double *  seq,
const double **  parent 
)
inline
1114{
1115 (this->*_inherit_fun_ptr)(SEX, seq, parent);
1116}

References _inherit_fun_ptr.

Referenced by TTQuanti::inherit().

+ Here is the caller graph for this function:

◆ inherit_free()

void TProtoQuanti::inherit_free ( sex_t  SEX,
double *  seq,
const double **  parent 
)
inline
1121{
1122 register unsigned int bloc;
1123
1124 assert(_all_chooser);
1125
1126 for(unsigned int i = 0; i < _nb_locus; ++i)
1128
1129 for(unsigned int i = 0; i < _nb_locus; ++i) {
1130
1131 bloc = i*_nb_traits;
1132
1133 memcpy(&seq[bloc], &parent[ _all_chooser[i] ][bloc], _locusByteSize);
1134
1135 }
1136}

References _all_chooser, _locusByteSize, _nb_locus, _nb_traits, and RAND::RandBool().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ inherit_low()

void TProtoQuanti::inherit_low ( sex_t  SEX,
double *  seq,
const double **  parent 
)
inline
1141{
1142 register unsigned int prevLoc = 0, chrm_bloc = 0, prev_bloc, cpy_bloc;
1143 register bool flipper;
1144
1145 //the table containing the loci at which x-overs happen
1146 vector< unsigned int >& recTable = _map.getRecLoci(SEX, _mapIndex);
1147
1148 //the table containing which homologous chromosome copy we start with, for each chromosome
1149 vector< bool > & firstRecPos = _map.getFirstRecPosition(SEX);
1150
1151 //number of x-overs
1152 unsigned int nbRec = recTable.size();
1153
1154 // cout << "TProtoQuanti::inherit; sex="<<SEX<<"; nb Rec = "<<nbRec;//<<endl;
1155
1156 // c is the chromosome number
1157 // stride is the number of loci considered so-far, sum of chromosome loci
1158 // rec is the number of x-over done so-far
1159 for(unsigned int c = 0, stride = 0, rec = 0; c < _numChromosome; ++c) {
1160
1161 //the copy of the chromosome with which with start
1162 flipper = firstRecPos[c];
1163
1164 //number of loci to consider, including previous chromosomes
1165 chrm_bloc = stride + _numLociPerChrmsm[c];
1166
1167 //last locus at which a x-over happened, will be first position on current chromosome
1168 prevLoc = stride;
1169
1170 // cout<<"chrm "<<c<<" side="<<firstRecPos[c]<<endl;
1171
1172 // copy blocs of loci between x-over points on current chromosome
1173 // skip it if locus is not on this chromosome but a latter one
1174 for(; recTable[rec] < chrm_bloc && rec < nbRec; rec++) {
1175
1176 // start position of the bloc of values to copy (_nb_traits values per locus)
1177 prev_bloc = prevLoc * _nb_traits;
1178
1179 // size of the bloc to copy
1180 cpy_bloc = (recTable[rec] - prevLoc) * _nb_traits;
1181
1182 // cout<<"copy seq from "<<prevLoc<<"("<<prev_bloc<<") to "<<recTable[rec]
1183 // <<"("<<(recTable[rec] - prevLoc)<<" loc) ("<<cpy_bloc*_locusByteSize<<"B) side "<<flipper<<endl;
1184
1185 memcpy(&seq[prev_bloc], &parent[flipper][prev_bloc], cpy_bloc * _sizeofLocusType);
1186
1187 //update the starting locus to the next recombination point
1188 prevLoc = recTable[rec];
1189
1190 //switch side for next bloc to copy on this chromosome
1191 flipper = !flipper;
1192 }
1193
1194 prev_bloc = prevLoc * _nb_traits;
1195
1196 cpy_bloc = (chrm_bloc - prevLoc) * _nb_traits;
1197
1198 // cout << "copy end of chrmsm from "<<prevLoc<<" to "<<chrm_bloc
1199 // <<"("<<(chrm_bloc - prevLoc)<<" loc) on side "<<flipper<<endl;
1200
1201 //copy what's left between the last x-over point and the end of the chrmsme
1202 memcpy(&seq[prev_bloc], &parent[flipper][prev_bloc], cpy_bloc * _sizeofLocusType);
1203
1204 stride += _numLociPerChrmsm[c];
1205 }
1206 // cout<<" done"<<endl;
1207}
vector< unsigned int > & getRecLoci(sex_t SEX, unsigned int trait)
Returns a vector of the loci where crossing-overs take place.
Definition: ttrait_with_map.h:157
vector< bool > & getFirstRecPosition(sex_t SEX)
Returns the vector of the first chromosome position for recombination, used for all traits.
Definition: ttrait_with_map.h:163
static GeneticMap _map
Definition: ttrait_with_map.h:201
unsigned int _numChromosome
Definition: ttrait_with_map.h:189
unsigned int * _numLociPerChrmsm
Definition: ttrait_with_map.h:192
unsigned int _mapIndex
Definition: ttrait_with_map.h:185

References TTProtoWithMap::_map, TTProtoWithMap::_mapIndex, _nb_traits, TTProtoWithMap::_numChromosome, TTProtoWithMap::_numLociPerChrmsm, _sizeofLocusType, GeneticMap::getFirstRecPosition(), and GeneticMap::getRecLoci().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ loadFileServices()

void TProtoQuanti::loadFileServices ( FileServices loader)
virtual

Implements SimComponent.

1305{
1306 int logtime = 0;
1307 //writer
1308 if(get_parameter("quanti_output")->isSet()) {
1309
1310 if(_writer == NULL) _writer = new TTQuantiFH(this);
1311
1312 _writer->setOutputOption(get_parameter("quanti_output")->getArg());
1313
1314 if(!get_parameter("quanti_logtime")->isSet())
1315 fatal("parameter \"quanti_logtime\" is missing!\n");
1316
1317 Param* param = get_parameter("quanti_logtime");
1318
1319 logtime = (param->isSet() ? (int)param->getValue() : 0);
1320
1321 if(param->isMatrix()) {
1322
1323 TMatrix temp;
1324 param->getMatrix(&temp);
1325 _writer->set_multi(true, true, 1, &temp, get_parameter("quanti_dir")->getArg());
1326
1327 } else // rpl_per, gen_per, rpl_occ, gen_occ, rank (0), path, self-ref
1328 _writer->set(true, true, 1, logtime, 0, get_parameter("quanti_dir")->getArg(),this);
1329
1330 loader->attach(_writer);
1331
1332 } else if(_writer != NULL) {
1333 delete _writer;
1334 _writer = NULL;
1335 }
1336
1337 //freq extractor
1338 if(get_parameter("quanti_freq_output")->isSet()) {
1339
1340 string model = get_parameter("quanti_allele_model")->getArg();
1341
1342 if(model != "diallelic" && model != "diallelic_HC") {
1343
1344 error("option \"quanti_freq_output\" only works with di-allelic quantitative loci, ignoring option.\n");
1345
1346 }else {
1347
1348 if(_freqExtractor == NULL) _freqExtractor = new TTQFreqExtractor(this);
1349
1351
1352 Param* param = get_parameter("quanti_freq_logtime");
1353
1354 logtime = (param->isSet() ? (int)param->getValue() : 0);
1355
1356 //save multiple generations in a single file:
1357 _freqExtractor->set(true, true, 1, logtime, 0, get_parameter("quanti_dir")->getArg(),this);
1358
1359 loader->attach(_freqExtractor);
1360 }
1361
1362 } else if(_freqExtractor != NULL) {
1363 delete _freqExtractor;
1364 _freqExtractor = NULL;
1365 }
1366
1367 //load the reader:
1368 if(_reader) delete _reader;
1369 _reader = new TTQuantiFH(this);
1371 loader->attach_reader(_reader);
1372}
virtual void set_multi(bool rpl_per, bool gen_per, int rpl_occ, TMatrix *Occ, string path)
Definition: filehandler.h:197
void set_isInputHandler(bool val)
Definition: filehandler.h:151
virtual void attach_reader(FileHandler *FH)
Attaches the FileHandler to the current list (_readers) of the FileServices.
Definition: fileservices.cc:73
virtual void attach(Handler *FH)
Attaches the FileHandler to the current list (_writers) of the FileServices.
Definition: fileservices.cc:60
This structure stores one parameter, its definition and its string argument.
Definition: param.h:54
double getValue()
Returns the argument value according to its type.
Definition: param.cc:347
bool isMatrix()
Checks if the argument is of matrix type.
Definition: param.h:172
string getArg()
Definition: param.h:138
void getMatrix(TMatrix *mat)
Sets the matrix from the argument string if the parameter is set and of matrix type.
Definition: param.cc:357
bool isSet()
Definition: param.h:140
virtual Param * get_parameter(std::string name)
Param getter.
Definition: simcomponent.h:139
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:49
TTQFreqExtractor.
Definition: ttquanti.h:358
void resetTable()
Definition: ttquanti.cc:3525
TTQuantiFH.
Definition: ttquanti.h:334
void setOutputOption(string opt)
Definition: ttquanti.cc:2988
virtual void set(bool rpl_per, bool gen_per, int rpl_occ, int gen_occ, int rank, string path, TP *trait_proto)
Definition: filehandler.h:236
void fatal(const char *str,...)
Definition: output.cc:96
int error(const char *str,...)
Definition: output.cc:77

References _freqExtractor, _reader, _writer, FileServices::attach(), FileServices::attach_reader(), error(), fatal(), SimComponent::get_parameter(), Param::getArg(), Param::getMatrix(), Param::getValue(), Param::isMatrix(), Param::isSet(), TTQFreqExtractor::resetTable(), TraitFileHandler< TP >::set(), FileHandler::set_isInputHandler(), FileHandler::set_multi(), and TTQuantiFH::setOutputOption().

◆ loadStatServices()

void TProtoQuanti::loadStatServices ( StatServices loader)
virtual

Implements SimComponent.

1377{
1378 //allocate the stat handler
1379 if(_stats)
1380 delete _stats; // this will reset internal state for the new simulation, safest solution
1381
1382 _stats = new TTQuantiSH(this);
1383
1384 loader->attach(_stats);
1385}
virtual void attach(Handler *H)
attach the StatHandler to the current list (_statHandlers) of the StatServices
Definition: statservices.cc:177
Definition: ttquanti.h:257

References _stats, and StatServices::attach().

◆ mutate()

void TProtoQuanti::mutate ( TTQuanti ind)
inline
1212{
1213 (this->*_mutation_func_ptr)(ind);
1214}

References _mutation_func_ptr.

Referenced by TTQuanti::mutate().

+ Here is the caller graph for this function:

◆ mutate_diallelic_HC()

void TProtoQuanti::mutate_diallelic_HC ( TTQuanti ind)
inline
1249{
1250 unsigned int NbMut = (unsigned int)RAND::Poisson(_genomic_mutation_rate);
1251 unsigned int mut_locus, mut_all, block, pos;
1252
1253 while(NbMut != 0) {
1254
1255 mut_locus = RAND::Uniform(_nb_locus);
1256 mut_all = RAND::RandBool();
1257
1258 block = mut_locus*_nb_traits;
1259
1260 for(unsigned int i = 0; i < _nb_traits; i++) {
1261 pos = block + i;
1262 ind->set_allele( pos, mut_all, -1.0 * ind->get_allele_value(pos, mut_all));
1263 }
1264
1265 NbMut--;
1266 }
1267
1268}
static double Poisson(double mean)
From the Numerical Recieps.
Definition: Uniform.h:220
void set_allele(int locus, int allele, double value)
Definition: ttquanti.h:97
virtual double get_allele_value(int loc, int all)
Definition: ttquanti.cc:1441

References _genomic_mutation_rate, _nb_locus, _nb_traits, TTQuanti::get_allele_value(), RAND::Poisson(), RAND::RandBool(), TTQuanti::set_allele(), and RAND::Uniform().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ mutate_HC()

void TProtoQuanti::mutate_HC ( TTQuanti ind)
inline
1273{
1274 unsigned int NbMut = (unsigned int)RAND::Poisson(_genomic_mutation_rate);
1275 unsigned int mut_locus, mut_all, pos;
1276 double *effects;
1277
1278 while(NbMut != 0) {
1279 mut_locus = RAND::Uniform(_nb_locus);
1280 effects = (this->*_getMutationValues)(mut_locus);
1281 mut_all = RAND::RandBool();
1282 pos = mut_locus*_nb_traits;
1283
1284 for(unsigned int i = 0; i < _nb_traits; i++)
1285 ind->set_allele( pos + i, mut_all, effects[i]);
1286
1287 NbMut--;
1288 }
1289}

References _genomic_mutation_rate, _getMutationValues, _nb_locus, _nb_traits, RAND::Poisson(), RAND::RandBool(), TTQuanti::set_allele(), and RAND::Uniform().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ mutate_nill()

void TProtoQuanti::mutate_nill ( TTQuanti ind)
inline
1219{
1220 //nill
1221}

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ mutate_noHC()

void TProtoQuanti::mutate_noHC ( TTQuanti ind)
inline
1226{
1227 unsigned int NbMut = (unsigned int)RAND::Poisson(_genomic_mutation_rate);
1228 unsigned int mut_locus, mut_all, pos;
1229 double *effects;
1230
1231 while(NbMut != 0) {
1232 mut_locus = RAND::Uniform(_nb_locus);
1233 effects = (this->*_getMutationValues)(mut_locus);
1234 mut_all = RAND::RandBool();
1235 pos = mut_locus*_nb_traits;
1236
1237 for(unsigned int i = 0; i < _nb_traits; i++) {
1238 ind->set_allele( pos + i, mut_all, ind->get_allele_value(pos + i, mut_all) + effects[i]);
1239 }
1240
1241 NbMut--;
1242 }
1243
1244}

References _genomic_mutation_rate, _getMutationValues, _nb_locus, _nb_traits, TTQuanti::get_allele_value(), RAND::Poisson(), RAND::RandBool(), TTQuanti::set_allele(), and RAND::Uniform().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ reset()

virtual void TProtoQuanti::reset ( )
inlinevirtual

Reimplemented from TTProtoWithMap.

virtual void reset()
Definition: ttrait_with_map.cc:611

References TTProtoWithMap::reset().

◆ reset_mutation_pointers()

void TProtoQuanti::reset_mutation_pointers ( )
972{
973 if(_allele_value) {
974 for(unsigned int i = 0; i < _nb_locus; ++i)
975 delete [] _allele_value[i];
976 delete [] _allele_value;
977 _allele_value = NULL;
978 }
979
980 if(_mutation_matrix != NULL) {
981 delete _mutation_matrix;
982 _mutation_matrix = NULL;
983 }
984
985 if(_gsl_mutation_matrix != NULL) {
986 gsl_matrix_free(_gsl_mutation_matrix);
988 }
989
990 if(_mutation_sigma != NULL){
991 delete [] _mutation_sigma;
992 _mutation_sigma = NULL;
993 }
994
995 if(_evect != NULL) {
996 gsl_matrix_free(_evect);
997 _evect = NULL;
998 }
999
1000 if(_eval != NULL) {
1001 gsl_vector_free(_eval);
1002 _eval = NULL;
1003 }
1004
1005 if(_effects_multivar != NULL) {
1006 gsl_vector_free(_effects_multivar);
1007 _effects_multivar = NULL;
1008 }
1009
1010 if(_ws) {
1011 gsl_vector_free(_ws);
1012 _ws = 0;
1013 }
1014
1015}

References _allele_value, _effects_multivar, _eval, _evect, _gsl_mutation_matrix, _mutation_matrix, _mutation_sigma, _nb_locus, and _ws.

Referenced by setMutationParameters(), and ~TProtoQuanti().

+ Here is the caller graph for this function:

◆ resetParameterFromSource()

virtual bool TProtoQuanti::resetParameterFromSource ( std::string  param,
SimComponent cmpt 
)
inlinevirtual

Implements SimComponent.

185{return false;}

◆ retrieve_data()

virtual bool TProtoQuanti::retrieve_data ( BinaryStorageBuffer reader)
inlinevirtual

Implements StorableComponent.

193 {reader->read(&_seq_length,sizeof(int));return true;}
void read(void *out, unsigned int nb_bytes)
Definition: binarystoragebuffer.h:162

References _seq_length, and BinaryStorageBuffer::read().

◆ set_eVarianceSD()

void TProtoQuanti::set_eVarianceSD ( unsigned int  trait,
double  SD 
)
918{
919 if(_eVariance.size() < trait + 1) //trait is expected as the element index
920 _eVariance.push_back(SD);
921 else
922 _eVariance[trait] = SD;
923}

References _eVariance.

Referenced by LCE_QuantiModifier::setVefromVa(), and LCE_Breed_Quanti::setVefromVa().

+ Here is the caller graph for this function:

◆ set_genotype_value_additive()

double TProtoQuanti::set_genotype_value_additive ( const double **  sequ,
const unsigned int  trait 
)
1046{
1047 unsigned int loc;
1048 double genotype = 0;
1049
1050 for(unsigned int j = 0; j < _nb_locus; ++j) {
1051 // alleles are ordered locus-trait: seq[0]:l0t0,l0t1,l0t2, ..., l1t0,l1t1,l1t2, ...
1052 loc = j * _nb_traits + trait;
1053 genotype += sequ[0][loc] + sequ[1][loc];
1054 }
1055
1056 return genotype;
1057}

References _nb_locus, and _nb_traits.

Referenced by TTQuanti::get_additive_genotype(), and setParameters().

+ Here is the caller graph for this function:

◆ set_genotype_value_dominance()

double TProtoQuanti::set_genotype_value_dominance ( const double **  sequ,
const unsigned int  trait 
)
1062{
1063 unsigned int loc;
1064 double genotype = 0;
1065
1066 for(unsigned int j = 0; j < _nb_locus; ++j) {
1067 loc = j * _nb_traits + trait;
1068 genotype += (this->*_getGenotypeWithDominance)( sequ[0][loc] , sequ[1][loc], get_dominance(j, trait));
1069 }
1070
1071 return genotype;
1072}

References _getGenotypeWithDominance, _nb_locus, _nb_traits, and get_dominance().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ set_init_values()

void TProtoQuanti::set_init_values ( const double *  values,
unsigned int  nval 
)
1020{
1021 assert(nval == _nb_traits);
1022
1023 if(!_init_value) _init_value = new double[_nb_traits];
1024
1025 for(unsigned int i = 0; i < nval; ++i)
1026 _init_value[i] = values[i];
1027}

References _init_value, and _nb_traits.

Referenced by LCE_QuantiInit::execute().

+ Here is the caller graph for this function:

◆ set_mutation_matrix_decomposition()

void TProtoQuanti::set_mutation_matrix_decomposition ( )
799{
800 gsl_matrix *E = gsl_matrix_alloc(_nb_traits,_nb_traits);
801 gsl_matrix_memcpy(E,_gsl_mutation_matrix);
802 gsl_eigen_symmv_workspace * w = gsl_eigen_symmv_alloc (_nb_traits);
803 gsl_eigen_symmv (E, _eval, _evect, w);
804 gsl_eigen_symmv_free (w);
805 gsl_matrix_free(E);
806
807#ifdef _DEBUG_
808 message("-- Mutation matrix eigenvalues:\n");
809 for(unsigned int i = 0; i < _nb_traits; i++)
810 cout<<gsl_vector_get(_eval,i)<<" ";
811 cout<<endl;
812#endif
813
814 double eval;
815 //take square root of eigenvalues, will be used in Gaussian as stdev
816 for(unsigned int i = 0; i < _nb_traits; i++) {
817 eval = gsl_vector_get(_eval,i);
818 eval = (eval < 0.000001 ? 0 : eval);
819 gsl_vector_set( _eval, i, sqrt(eval) );
820 }
821}// ----------------------------------------------------------------------------------------
void message(const char *message,...)
Definition: output.cc:40

References _eval, _evect, _gsl_mutation_matrix, _nb_traits, and message().

Referenced by setContinuousMutationModel().

+ Here is the caller graph for this function:

◆ set_trait_value_func_ptr()

void TProtoQuanti::set_trait_value_func_ptr ( bool  withVe)
457{
458 if(withVe)
460 else
462}
double set_trait_value_VE(const TTQuanti *ind, const unsigned int trait)
Definition: ttquanti.cc:1031
double set_trait_value_noVE(const TTQuanti *ind, const unsigned int trait)
Definition: ttquanti.cc:1038

References _set_trait_value_func_ptr, set_trait_value_noVE(), and set_trait_value_VE().

Referenced by LCE_QuantiModifier::execute(), and LCE_Breed_Quanti::setVefromVa().

+ Here is the caller graph for this function:

◆ set_trait_value_noVE()

double TProtoQuanti::set_trait_value_noVE ( const TTQuanti ind,
const unsigned int  trait 
)
1039{
1040 return (this->*_set_genotype_func_ptr)((const double**)ind->get_sequence(), trait);
1041}
virtual void ** get_sequence() const
Definition: ttquanti.h:79

References _set_genotype_func_ptr, and TTQuanti::get_sequence().

Referenced by set_trait_value_func_ptr(), set_trait_value_VE(), and setParameters().

+ Here is the caller graph for this function:

◆ set_trait_value_VE()

double TProtoQuanti::set_trait_value_VE ( const TTQuanti ind,
const unsigned int  trait 
)
1032{
1033 return set_trait_value_noVE(ind, trait) + RAND::Gaussian( _eVariance[trait] );
1034}

References _eVariance, RAND::Gaussian(), and set_trait_value_noVE().

Referenced by set_trait_value_func_ptr(), and setParameters().

+ Here is the caller graph for this function:

◆ setContinuousMutationModel()

bool TProtoQuanti::setContinuousMutationModel ( )
674{
675 unsigned int dims[2];
676
677 // the pointer has been freed previously in TProtoQuanti::setMutationParameters
678 // we double-check with assert
679 assert(_mutation_matrix == NULL);
680 assert(_gsl_mutation_matrix == NULL);
681 assert(_mutation_sigma == NULL);
682
683 //setting the mutation variance-covariance matrix
684 if(get_parameter("quanti_mutation_variance")->isSet()) {
685
686 if(get_parameter("quanti_mutation_matrix")->isSet()) {
687
688 warning("both \"quanti_mutation_variance\" and \"quanti_mutation_matrix\" are set, using the matrix only!\n");
689
690 } else {
691
692 // the variance, and covariance are passed as single values,
693 // we set the mutation-matrix from those values, copied to all traits
694
695 _mutation_sigma = new double [_nb_traits];
696
697 double sigma = sqrt( get_parameter_value("quanti_mutation_variance") );
698
699 for(unsigned int i = 0; i < _nb_traits; i++) _mutation_sigma[i] = sigma;
700
701 // pleiotropic loci for more than 1 trait, we need the full mutation matrix:
702 if(_nb_traits > 1) {
703
704 //setting the mutation matrix
705
707
708 _gsl_mutation_matrix = gsl_matrix_alloc(_nb_traits, _nb_traits);
709
710 double covar, var = get_parameter_value("quanti_mutation_variance");
711
712 covar = _mutation_correlation * var;
713
714 // copy the trait mutational variance into the GSL matrix (diogonal)
715 for(unsigned int i = 0; i < _nb_traits; i++)
716 gsl_matrix_set(_gsl_mutation_matrix, i, i, var);
717
718 // copy the trait mutational co-variance into the GSL matrix (off-diogonal & symmetric)
719 for(unsigned int i = 0; i < _nb_traits - 1; i++)
720 for(unsigned int j = i + 1 ; j < _nb_traits; j++) {
721 gsl_matrix_set(_gsl_mutation_matrix, i, j, covar);
722 gsl_matrix_set(_gsl_mutation_matrix, j, i, covar);
723 }
724
725 // copy the GSL matrix into the TMatrix:
726 _mutation_matrix->set_from_gsl_matrix(_gsl_mutation_matrix);
727 }
728 }
729 }
730
731 if(get_parameter("quanti_mutation_matrix")->isSet()) {
732
733 // full mutation matrix given in input:
734
736
737 get_parameter("quanti_mutation_matrix")->getMatrix(_mutation_matrix);
738
739 _mutation_matrix->get_dims(&dims[0]);
740
741 if( dims[0] != _nb_traits || dims[1] != _nb_traits) {
742
743 return error("\"quanti_mutation_matrix\" must be a square matrix of size = \"quanti_traits\" x \"quanti_traits\"\n");
744
745 }
746
747 _gsl_mutation_matrix = gsl_matrix_alloc(dims[0], dims[1]);
748
749 _mutation_matrix->get_gsl_matrix(_gsl_mutation_matrix);
750
751 _mutation_sigma = new double [_nb_traits];
752
753 for(unsigned int i = 0; i < _nb_traits; i++)
754 _mutation_sigma[i] = sqrt(_mutation_matrix->get(i, i));
755
756 }
757 else if(!get_parameter("quanti_mutation_variance")->isSet()) {
758
759 return error("\"quanti_mutation_matrix\" or \"quanti_mutation_variance\" must be specified!\n");
760 }
761
762 //some more initializations for multi-variate case, important to draw mutation from multi-variate Gaussian
763 if(_mutation_matrix) {
764
765 _evect = gsl_matrix_alloc(_nb_traits, _nb_traits);
766 _eval = gsl_vector_alloc(_nb_traits);
767
768 // M-matrix eigen-decomposition:
770
771 if(_nb_traits == 2) {
772
774
775 } else if(_nb_traits > 2) {
776
777 _effects_multivar = gsl_vector_alloc(_nb_traits);
778 _ws = gsl_vector_alloc(_nb_traits);
779
780 }
781
782#ifdef _DEBUG_
783 message("-- Mutation matrix:\n");
785 message("-- MMatrix decomposition:\n");
786 for(unsigned int i = 0; i < _nb_traits; i++)
787 cout<<gsl_vector_get(_eval,i)<<" ";
788 cout<<endl;
789 if(_nb_traits == 2) message("-- mutation correlation: %f\n",_mutation_correlation);
790#endif
791 }
792
793 return true;
794}
virtual double get_parameter_value(std::string name)
Param value getter.
Definition: simcomponent.h:143
void show_up()
Definition: tmatrix.h:282
unsigned int get_dims(unsigned int *dims)
Accessor to the matrix dimensions.
Definition: tmatrix.h:161
void set_mutation_matrix_decomposition()
Definition: ttquanti.cc:798
void warning(const char *str,...)
Definition: output.cc:58

References _effects_multivar, _eval, _evect, _gsl_mutation_matrix, _mutation_correlation, _mutation_matrix, _mutation_sigma, _nb_traits, _ws, error(), TMatrix::get(), TMatrix::get_dims(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Param::getMatrix(), message(), set_mutation_matrix_decomposition(), TMatrix::show_up(), and warning().

Referenced by setMutationParameters().

+ Here is the caller graph for this function:

◆ setDiallelicMutationModel()

bool TProtoQuanti::setDiallelicMutationModel ( )
551{
552 if (!get_parameter("quanti_allele_value")->isSet()) {
553
554 return error("in \"quanti\" trait, \"quanti_allele_value\" is not set for the diallelic model.\n");
555
556 } else {
557
558 assert(_allele_value == NULL);
559 //should be the case as reset_mutation_pointers has been called in setMutationParameters
560
561
562 // allele_value is a matrix nb_locus x 2 values
563
564 // IMPORTANT:: This interface doesn't allow for trait-specific allelic values!!
565
566 _allele_value = new double* [_nb_locus];
567
568 for (unsigned i = 0; i < _nb_locus; ++i) _allele_value[i] = new double [2];
569
570 if (get_parameter("quanti_allele_value")->isMatrix()) { //locus-specific allelic values
571
572 TMatrix tmp;
573
574 get_parameter("quanti_allele_value")->getMatrix(&tmp);
575
576 if (tmp.ncols() != _nb_locus) {
577 warning("\"quanti_allele_value\" has less values than the number of loci, allelic values will be recycled among loci.\n");
578 }
579
580 unsigned int nval = tmp.ncols();
581
582 // we need to order the allele in decreasing order for later calculations of allele frequencies
583 // such that p = freq of trai-increasing allele, q = freq of trait-decreasing allele
584
585 double a1, a2;
586
587 if (tmp.nrows() == 1) { // store + and - allelic values
588
589 if(nval < _nb_locus) { // recycle allelic values among loci
590
591 for (unsigned i = 0; i < _nb_locus; ++i) {
592
593 a1 = tmp.get(0, i % nval);
594 if(a1 < 0) a1 = -1.0*a1;
595 a2 = -1.0*a1;
596
597 _allele_value[i][0] = a1;
598 _allele_value[i][1] = a2;
599 }
600 } else {
601 for (unsigned i = 0; i < _nb_locus; ++i) {
602
603 a1 = tmp.get(0, i);
604 if(a1 < 0) a1 = -1.0*a1;
605 a2 = -1.0*a1;
606
607 _allele_value[i][0] = a1;
608 _allele_value[i][1] = a2;
609 }
610
611 }
612
613 } else if (tmp.nrows() == 2) { // store A and a allelic values
614
615 if(nval < _nb_locus) { // recycle allelic values among loci
616
617 for (unsigned i = 0; i < _nb_locus; ++i) {
618
619 a1 = tmp.get(0, i % nval);
620 a2 = tmp.get(1, i % nval);
621 if(a1 < a2) {
622 a1 = a2;
623 a2 = tmp.get(0, i % nval);
624 }
625 _allele_value[i][0] = a1;
626 _allele_value[i][1] = a2;
627 }
628
629 } else {
630
631 for (unsigned i = 0; i < _nb_locus; ++i) {
632
633 a1 = tmp.get(0, i % nval);
634 a2 = tmp.get(1, i % nval);
635 if(a1 < a2) {
636 a1 = a2;
637 a2 = tmp.get(0, i % nval);
638 }
639 _allele_value[i][0] = tmp.get(0, i);
640 _allele_value[i][1] = tmp.get(1, i);
641 }
642
643 }
644
645 } else {
646
647 return error("\"quanti_allele_value\" must get a matrix with a max. of 2 rows (and num. columns = num. loci).\n");
648
649 }
650
651
652 } else { //not a matrix, therefore no locus-specific allelic values
653
654 double a1 = get_parameter_value("quanti_allele_value"), a2;
655
656 if(a1 < 0) a1 = -1.0*a1;
657 a2 = -1.0*a1;
658
659 for (unsigned i = 0; i < _nb_locus; ++i) {
660 _allele_value[i][0] = a1;
661 _allele_value[i][1] = a2;
662 }
663
664 }
665
666 }
667
668 return true;
669}
unsigned int ncols()
Definition: tmatrix.h:170
unsigned int nrows()
Definition: tmatrix.h:167

References _allele_value, _nb_locus, error(), TMatrix::get(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Param::getMatrix(), TMatrix::ncols(), TMatrix::nrows(), and warning().

Referenced by setMutationParameters().

+ Here is the caller graph for this function:

◆ setDominanceParameters()

bool TProtoQuanti::setDominanceParameters ( )
825{
826 TMatrix tmp_mat;
827
828 if(get_parameter("quanti_dominance_model")->isSet())
829 {
830
831 _dominance_model = get_parameter_value("quanti_dominance_model") + 1; // internally, model 0 = no dominance
832 // note that the bounds for the model values are set and checked by construction of the parameters
833
834 // check and set the dominance effects, either explicitly from input or from the mean and sd provided above
835 if( !get_parameter("quanti_dominance_mean")->isSet() )
836 {
837
838 return error("the dominance at QTLs needs to be set with \"quanti_dominance_mean\"\n");
839
840 } else {
842
843 // one row per trait, one column per locus; trait x locus matrix
845
846 if(get_parameter("quanti_dominance_mean")->isMatrix())
847 {
848
849 get_parameter("quanti_dominance_mean")->getMatrix(&tmp_mat);
850
852
853 }
854 else {
855 _dominance_effects.assign( get_parameter_value("quanti_dominance_mean") );
856 }
857
858 // variance of the dominance effect across QTLs
859 if( !get_parameter("quanti_dominance_sd")->isSet() )
860 {
861
862 _dominance_sd.reset(1, 1, 0.0); //set to 0 by default.
863
865
866 } else { // sd parameter is set
867
868 // one row per trait, one column per locus; trait x locus matrix
870
872
873 if(get_parameter("quanti_dominance_sd")->isMatrix())
874 {
875 get_parameter("quanti_dominance_sd")->getMatrix(&tmp_mat);
876
878
879 }
880 else {
881
882 double sd = get_parameter_value("quanti_dominance_sd");
883
884 if(sd == 0.0) _dominance_is_constant = true;
885
886 _dominance_sd.assign( sd );
887 }
888 }
889
890 if( !_dominance_is_constant) { // add a gaussian deviate
891 for(unsigned int i = 0; i < _nb_traits; ++i)
892 for(unsigned int j = 0; j < _nb_locus; ++j)
894 }
895
896 } // end random dominance setting
897 }
898 else { //no model specified in input
899
902 _dominance_effects.reset(); //empty it when no dominance required
903
904 if(get_parameter("quanti_dominance_mean")->isSet())
905 return error("the mean dominance effect at QTLs is set but the dominance model is missing (\"quanti_dominance_model\")\n");
906
907 if(get_parameter("quanti_dominance_sd")->isSet())
908 return error("the stdev of dominance effects across QTLs is set but the dominance model is missing (\"quanti_dominance_model\")\n");
909
910 }
911
912 return true;
913}
void reset(unsigned int rows, unsigned int cols)
Re-allocate the existing matrix with assigned rows and cols dimensions.
Definition: tmatrix.h:116
void assign(double val)
Assigns a value to all element of the matrix.
Definition: tmatrix.h:110
void copy_recycle(const TMatrix &mat)
Copy elements of 'mat', recycling elements of 'mat' if its size is smaller than current matrix.
Definition: tmatrix.h:89
void plus(unsigned int i, unsigned int j, double value)
Adds a value to an element of the matrix.
Definition: tmatrix.h:210

References _dominance_effects, _dominance_is_constant, _dominance_model, _dominance_sd, _nb_locus, _nb_traits, TMatrix::assign(), TMatrix::copy_recycle(), error(), RAND::Gaussian(), TMatrix::get(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Param::getMatrix(), TMatrix::plus(), and TMatrix::reset().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ setMutationParameters()

bool TProtoQuanti::setMutationParameters ( )
467{
468 // set the genomic mutation rate
469 _genomic_mutation_rate = get_parameter_value("quanti_mutation_rate") * 2 * _nb_locus;
470
471 // set the mutational correlation, for pleiotropic loci:
472 if(get_parameter("quanti_mutation_correlation")->isSet())
473
474 _mutation_correlation = get_parameter_value("quanti_mutation_correlation");
475
476 else
477
479
480 // reset all allelic effect tables and pointer to mutation parameters etc.:
482
483 //checking allelic model
484
485 if (get_parameter("quanti_allele_model")->isSet()) {
486
487
488 string model = get_parameter("quanti_allele_model")->getArg();
489
490 //---------------------------------------------------------------------------------------
491 // DIALLELIC MODELS
492
493 if (model == "diallelic") {
494
495 if(get_parameter("quanti_init_value")->isSet()){
496
497 error("\"quanti_allele_model diallelic\" needs to be initialized with \"quanti_init_freq\" instead of \"quanti_init_value\". \n");
498
499 }
500
501 _allele_model = 1;
502
504
505
506 } else if (model == "diallelic_HC") {
507
508
509 if(get_parameter("quanti_init_value")->isSet()){
510
511 error("\"quanti_allele_model diallelic_HC\" needs to be initialized with \"quanti_init_freq\" instead of \"quanti_init_value\". \n");
512
513 }
514
515 _allele_model = 2;
516
518
519
520 //---------------------------------------------------------------------------------------
521 // CONTIUUM OF ALLELE MODELS
522
523 } else if (model == "continuous") {
524
525 _allele_model = 3;
526
528
529 } else if (model == "continuous_HC") {
530
531 _allele_model = 4;
532
534
535 } else {
536 return error("\"quanti_allele_model\" has options \"diallelic[_HC]\" or \"continuous[_HC]\" only. \n");
537 }
538
539 }
540 else { //default model: 'continuous"
541 _allele_model = 3;
543 }
544
545 return true;
546}
bool setDiallelicMutationModel()
Definition: ttquanti.cc:550
bool setContinuousMutationModel()
Definition: ttquanti.cc:673

References _allele_model, _genomic_mutation_rate, _mutation_correlation, _nb_locus, error(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Param::getArg(), reset_mutation_pointers(), setContinuousMutationModel(), and setDiallelicMutationModel().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ setParameters()

bool TProtoQuanti::setParameters ( )
virtual

Implements SimComponent.

194{
195 // Mandatory parameters:
196
197 // number of quantitative traits
198 _nb_traits = (unsigned int)get_parameter_value("quanti_traits");
199
200 // number of loci
201 _nb_locus = (unsigned int)get_parameter_value("quanti_loci");
202
203 // store a few important numbers
204 //total nbre of values for both traits in a haploid genome
205 _seq_length = _nb_traits * _nb_locus; //mutations are pleiotropic!!!
206
207 // size of data used to store pleiotropic allelic values at a locus
208 _locusByteSize = _nb_traits * sizeof(double);
209
210 // memory size of a single allele value
211 _sizeofLocusType = sizeof(double);
212
213
214 // temporary TMatrix for parameters read-in
215 TMatrix tmp_mat;
216
217 //---------------------------------------------------------------------------------------------
218 // ENVIRONMENTAL VARIANCE and HERITABILITY
219
220 _eVariance.clear(); //it is empty by default, signaling that we do not add Ve to trait genotype
221
222 if(get_parameter("quanti_environmental_variance")->isSet()){
223
224 if(get_parameter("quanti_environmental_variance")->isMatrix())
225 {
226 get_parameter("quanti_environmental_variance")->getMatrix(&tmp_mat);
227
228 double var;
229
230 for(unsigned int i = 0; i < _nb_traits; i++) {
231
232 var = tmp_mat.get(0,i);
233
234 if( var < 0 )
235 return error("\"quanti_environmental_variance\" received a negative value for trait %i!\n", i+1 );
236 else
237 _eVariance.push_back( sqrt(var) ); // store the SD to save time later
238 }
239
240 } else {
241
242 double var = get_parameter_value("quanti_environmental_variance");
243
244 if( var < 0 )
245 return error("\"quanti_environmental_variance\" received a negative value!\n");
246
247 for(unsigned int i = 0; i < _nb_traits; ++i) {
248 _eVariance.push_back( sqrt(var) ); // store the SD to save time later
249 }
250
251 }
252
254
255 } else {
256
258
259 }
260
261 _h2.clear();
262
263 if(get_parameter("quanti_heritability")->isSet()){
264
265 if(get_parameter("quanti_heritability")->isMatrix())
266 {
267 get_parameter("quanti_heritability")->getMatrix(&tmp_mat);
268
269 double h2;
270
271 for(unsigned int i = 0; i < _nb_traits; i++) {
272
273 h2 = tmp_mat.get(0,i);
274
275 if( h2< 0 )
276 return error("\"quanti_heritability\" received a negative value for trait %i!\n", i+1 );
277 else
278 _h2.push_back( h2 ); // store the SD to save time later
279 }
280
281 } else {
282
283 double h2 = get_parameter_value("quanti_heritability");
284
285 if( h2 < 0 )
286 return error("\"quanti_heritability\" received a negative value!\n");
287
288 for(unsigned int i = 0; i < _nb_traits; ++i) {
289 _h2.push_back( h2 ); // store the SD to save time later
290 }
291
292 }
293 }
294
295 _h2_setTime = 0;
296 if(get_parameter("quanti_heritability_setTime")->isSet()){
297 _h2_setTime = (unsigned int)get_parameter_value("quanti_heritability_setTime");
298 }
299
300 _h2_isBroad = false;
301 if(get_parameter("quanti_heritability_isBroad")->isSet())
302 _h2_isBroad = (bool)get_parameter_value("quanti_heritability_isBroad");
303
304 //---------------------------------------------------------------------------------------------
305 // INITIAL VALUES:
306
307 if(_init_value != NULL) {
308 delete [] _init_value;
309 _init_value = NULL;
310 }
311
312 if(get_parameter("quanti_init_value")->isSet()) {
313
314 get_parameter("quanti_init_value")->getMatrix(&tmp_mat);
315
316 if(tmp_mat.getNbRows() != 1 || tmp_mat.getNbCols() != _nb_traits) {
317 return error("\"quanti_init_value\" must be a vector of length equal to the number of traits!\n");
318 }
319
320 _init_value = new double [_nb_traits];
321
322 for(unsigned int i = 0; i < _nb_traits; i++)
323 _init_value[i] = tmp_mat.get(0,i);
324
325 }
326 else {
327
328 _init_value = new double [_nb_traits];
329
330 for(unsigned int i = 0; i < _nb_traits; i++)
331 _init_value[i] = 0.0;
332 }
333
334 if(get_parameter("quanti_init_model")->isSet()) {
335
336 _doInitMutation = (unsigned int)get_parameter_value("quanti_init_model");
337
338 } else {
339 _doInitMutation = 1;
340 }
341
342
343 //---------------------------------------------------------------------------------------
344 // ALLELE MODELS AND MUTATIONS
345
346 if( !setMutationParameters() ) return false;
347
348 // SET POINTER TO MUTATE FUNCTION
349
350 if(_genomic_mutation_rate == 0) {
351
353
354 } else if(_allele_model == 1 || _allele_model == 3) {// no "house-of-cards" models
355
357
358 } else if(_allele_model == 2) {
359
361
362 } else
364
365 // SET POINTERS TO MUTATION EFFECTS FUNCTIONS
366
367 if(_nb_traits == 1) { // univariate models
368
369 if (_allele_model == 1 || _allele_model == 2) {
370
372
373 } else {
374
376
377 }
378
379 } else if (_nb_traits == 2) { // bivariate models
380
381 if (_allele_model == 1 || _allele_model == 2) {
382
384
385 } else {
386
388
389 }
390
391 } else if (_nb_traits > 2) { // multivariate models, only for non-diallelic loci
392
393 if (_allele_model > 2) {
394
396
397 } else {
398 fatal("in \"quanti\" trait, the di-allelic model is only allowed for max. 2 quantitative traits.");
399 }
400
401 }
402 //---------------------------------------------------------------------------------------
403 // COMPUTING GENOTYPE VALUES: ADDITVITY or DOMINANCE
404
405 if( !setDominanceParameters() ) return false;
406
407 switch( _dominance_model) {
408
409 case 0:
412 break;
413
414 case 1:
417 break;
418
419 case 2:
422 break;
423 }
424
425 //---------------------------------------------------------------------------------------
426 // RECOMBINATION
427
428 //bypass the genetic map for free recombination to save significant time:
429 //this is done whenever the recombination rate is set to 0.5
430
431 if( TTProtoWithMap::isRecombinationFree("quanti")) { //test all possible options to set recomb rate = 0.5
432
434
436
437 //necessary for the inherit_free function:
438 if(_all_chooser) delete [] _all_chooser;
439 _all_chooser = new bool[_nb_locus];
440
441 } else {
442
443 // the loci positions will be registered in the genetic map
444 if( !setGeneticMapParameters("quanti") ) return false;
445
447
448 }
449
450 //---------------------------------------------------------------------------------------
451 return true;
452}
unsigned int getNbRows()
Gives the number of rows.
Definition: tmatrix.h:166
unsigned int getNbCols()
Gives the number of columns.
Definition: tmatrix.h:169
double * getMutationEffectMultivariateGaussian(unsigned int loc)
Definition: ttquanti.cc:927
bool setMutationParameters()
Definition: ttquanti.cc:466
double * getMutationEffectUnivariateGaussian(unsigned int loc)
Definition: ttquanti.cc:944
bool setDominanceParameters()
Definition: ttquanti.cc:824
double * getMutationEffectUnivariateDiallelic(unsigned int loc)
Definition: ttquanti.cc:952
void mutate_nill(TTQuanti *ind)
Definition: ttquanti.cc:1218
double * getMutationEffectBivariateGaussian(unsigned int loc)
Definition: ttquanti.cc:935
void inherit_free(sex_t SEX, double *seq, const double **parent)
Definition: ttquanti.cc:1120
double * getMutationEffectBivariateDiallelic(unsigned int loc)
Definition: ttquanti.cc:960
void mutate_noHC(TTQuanti *ind)
Definition: ttquanti.cc:1225
void mutate_HC(TTQuanti *ind)
Definition: ttquanti.cc:1272
double set_genotype_value_dominance(const double **sequ, const unsigned int trait)
Definition: ttquanti.cc:1061
double set_genotype_value_additive(const double **sequ, const unsigned int trait)
Definition: ttquanti.cc:1045
void mutate_diallelic_HC(TTQuanti *ind)
Definition: ttquanti.cc:1248
void inherit_low(sex_t SEX, double *seq, const double **parent)
Definition: ttquanti.cc:1140
double get_genotype_dominance_k(double a1, double a2, double k)
Definition: ttquanti.cc:1101
double get_genotype_dominance_h(double a1, double a2, double h)
Definition: ttquanti.cc:1084
double _recombRate
Definition: ttrait_with_map.h:187
bool isRecombinationFree(string prefix)
Definition: ttrait_with_map.cc:98
bool setGeneticMapParameters(string prefix)
Definition: ttrait_with_map.cc:125

References _all_chooser, _allele_model, _doInitMutation, _dominance_model, _eVariance, _genomic_mutation_rate, _getGenotypeWithDominance, _getMutationValues, _h2, _h2_isBroad, _h2_setTime, _inherit_fun_ptr, _init_value, _locusByteSize, _mutation_func_ptr, _nb_locus, _nb_traits, TTProtoWithMap::_recombRate, _seq_length, _set_genotype_func_ptr, _set_trait_value_func_ptr, _sizeofLocusType, error(), fatal(), TMatrix::get(), get_genotype_dominance_h(), get_genotype_dominance_k(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Param::getMatrix(), getMutationEffectBivariateDiallelic(), getMutationEffectBivariateGaussian(), getMutationEffectMultivariateGaussian(), getMutationEffectUnivariateDiallelic(), getMutationEffectUnivariateGaussian(), TMatrix::getNbCols(), TMatrix::getNbRows(), inherit_free(), inherit_low(), Param::isMatrix(), TTProtoWithMap::isRecombinationFree(), Param::isSet(), mutate_diallelic_HC(), mutate_HC(), mutate_nill(), mutate_noHC(), set_genotype_value_additive(), set_genotype_value_dominance(), set_trait_value_noVE(), set_trait_value_VE(), setDominanceParameters(), TTProtoWithMap::setGeneticMapParameters(), and setMutationParameters().

◆ store_data()

virtual void TProtoQuanti::store_data ( BinaryStorageBuffer saver)
inlinevirtual

Implements StorableComponent.

190 {saver->store(&_seq_length,sizeof(int));}
void store(void *stream, unsigned int nb_bytes)
Definition: binarystoragebuffer.cc:16

References _seq_length, and BinaryStorageBuffer::store().

Friends And Related Function Documentation

◆ TTQuanti

friend class TTQuanti
friend

Referenced by hatch().

Member Data Documentation

◆ _all_chooser

bool* TProtoQuanti::_all_chooser
private

◆ _allele_model

unsigned int TProtoQuanti::_allele_model
private

◆ _allele_value

◆ _doInitMutation

unsigned int TProtoQuanti::_doInitMutation
private

◆ _dominance_effects

TMatrix TProtoQuanti::_dominance_effects
private

◆ _dominance_is_constant

bool TProtoQuanti::_dominance_is_constant
private

Referenced by setDominanceParameters().

◆ _dominance_model

unsigned int TProtoQuanti::_dominance_model
private

◆ _dominance_sd

TMatrix TProtoQuanti::_dominance_sd
private

Referenced by setDominanceParameters().

◆ _effects_bivar

◆ _effects_multivar

gsl_vector* TProtoQuanti::_effects_multivar
private

◆ _eval

◆ _eVariance

vector<double> TProtoQuanti::_eVariance
private

◆ _evect

◆ _freqExtractor

TTQFreqExtractor* TProtoQuanti::_freqExtractor
private

Referenced by loadFileServices(), and ~TProtoQuanti().

◆ _genomic_mutation_rate

double TProtoQuanti::_genomic_mutation_rate
private

◆ _getGenotypeWithDominance

double(TProtoQuanti::* TProtoQuanti::_getGenotypeWithDominance) (double, double, double)
private

◆ _getMutationValues

double *(TProtoQuanti::* TProtoQuanti::_getMutationValues) (unsigned int)
private

◆ _gsl_mutation_matrix

gsl_matrix* TProtoQuanti::_gsl_mutation_matrix
private

◆ _h2

vector<double> TProtoQuanti::_h2
private

Referenced by get_heritability(), and setParameters().

◆ _h2_isBroad

bool TProtoQuanti::_h2_isBroad
private

Referenced by get_h2_isBroad(), and setParameters().

◆ _h2_setTime

unsigned int TProtoQuanti::_h2_setTime
private

Referenced by get_h2_setTime(), and setParameters().

◆ _inherit_fun_ptr

void(TProtoQuanti::* TProtoQuanti::_inherit_fun_ptr) (sex_t, double *, const double **)
private

Referenced by inherit(), and setParameters().

◆ _init_value

double* TProtoQuanti::_init_value
private

◆ _locusByteSize

size_t TProtoQuanti::_locusByteSize
private

◆ _mutation_correlation

◆ _mutation_func_ptr

void(TProtoQuanti::* TProtoQuanti::_mutation_func_ptr) (TTQuanti *)
private

Referenced by mutate(), and setParameters().

◆ _mutation_matrix

TMatrix* TProtoQuanti::_mutation_matrix
private

◆ _mutation_sigma

◆ _nb_locus

◆ _nb_traits

◆ _phenotypes

double* TProtoQuanti::_phenotypes
private

◆ _reader

TTQuantiFH* TProtoQuanti::_reader
private

Referenced by loadFileServices(), and ~TProtoQuanti().

◆ _seq_length

◆ _set_genotype_func_ptr

double(TProtoQuanti::* TProtoQuanti::_set_genotype_func_ptr) (const double **, const unsigned int)
private

◆ _set_trait_value_func_ptr

double(TProtoQuanti::* TProtoQuanti::_set_trait_value_func_ptr) (const TTQuanti *, const unsigned int)
private

◆ _sizeofLocusType

size_t TProtoQuanti::_sizeofLocusType
private

Referenced by inherit_low(), and setParameters().

◆ _stats

TTQuantiSH* TProtoQuanti::_stats
private

◆ _writer

TTQuantiFH* TProtoQuanti::_writer
private

Referenced by loadFileServices(), and ~TProtoQuanti().

◆ _ws

gsl_vector* TProtoQuanti::_ws
private

The documentation for this class was generated from the following files:

Generated for Nemo v2.3.56 by  doxygen 1.9.0 -- Nemo is hosted on  Download Nemo

Locations of visitors to this page
Catalogued on GSR