41#include <gsl/gsl_vector.h>
42#include <gsl/gsl_matrix.h>
43#include <gsl/gsl_eigen.h>
71 virtual void reset ();
74 virtual void*
set_trait (
void* value) {
return value;}
81 virtual void set_allele_value (
unsigned int locus,
unsigned int allele,
double value);
143 double get_genotype (
const double a1,
const double a2,
const unsigned int locus,
const unsigned int trait);
166 void inherit (
sex_t SEX,
double* seq,
const double** parent);
267 gsl_eigen_symmv_workspace *
_ws;
286 virtual void init ( );
346 void print(ofstream& FH,
sex_t SEX,
age_idx Ax,
unsigned int print_gene,
bool print_genotype,
bool print_additive_genotype);
351 virtual void FHread (
string& filename);
369 virtual void FHread (
string& filename) {}
A class to store any kind of data in a char buffer before unloading it in a binary data file.
Definition: binarystoragebuffer.h:44
void read(void *out, unsigned int nb_bytes)
Definition: binarystoragebuffer.h:162
void store(void *stream, unsigned int nb_bytes)
Definition: binarystoragebuffer.cc:16
A class to manage the files associated with each components of the simulation.
Definition: fileservices.h:52
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:430
Interface to all basic components of a simulation (traits, life cycle events, pop,...
Definition: simcomponent.h:45
The Service class used to manage the StatHandler objects.
Definition: statservices.h:50
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:49
double get(unsigned int i, unsigned int j)
Accessor to element at row i and column j.
Definition: tmatrix.h:147
TProtoQuanti.
Definition: ttquanti.h:113
vector< double > _eVariance
Definition: ttquanti.h:230
double * getMutationEffectMultivariateGaussian(unsigned int loc)
Definition: ttquanti.cc:927
vector< double > get_env_var()
Definition: ttquanti.h:124
unsigned int _allele_model
Definition: ttquanti.h:203
TMatrix _dominance_sd
Definition: ttquanti.h:221
TMatrix _dominance_effects
Definition: ttquanti.h:222
size_t _sizeofLocusType
Definition: ttquanti.h:228
unsigned int _doInitMutation
Definition: ttquanti.h:219
gsl_vector * _effects_multivar
Definition: ttquanti.h:213
virtual ~TProtoQuanti()
Definition: ttquanti.cc:179
bool setMutationParameters()
Definition: ttquanti.cc:466
void(TProtoQuanti::* _inherit_fun_ptr)(sex_t, double *, const double **)
Definition: ttquanti.h:235
double set_trait_value_VE(const TTQuanti *ind, const unsigned int trait)
Definition: ttquanti.cc:1031
unsigned int _dominance_model
Definition: ttquanti.h:220
double * getMutationEffectUnivariateGaussian(unsigned int loc)
Definition: ttquanti.cc:944
double *(TProtoQuanti::* _getMutationValues)(unsigned int)
Definition: ttquanti.h:237
bool _h2_isBroad
Definition: ttquanti.h:233
TTQuantiFH * _reader
Definition: ttquanti.h:246
bool setDominanceParameters()
Definition: ttquanti.cc:824
gsl_vector * _eval
Definition: ttquanti.h:212
double * getMutationEffectUnivariateDiallelic(unsigned int loc)
Definition: ttquanti.cc:952
double get_mutation_correlation()
Definition: ttquanti.h:129
unsigned int _h2_setTime
Definition: ttquanti.h:232
unsigned int _seq_length
Total number of loci, same as _nb_locus.
Definition: ttquanti.h:202
void mutate_nill(TTQuanti *ind)
Definition: ttquanti.cc:1218
gsl_matrix * _gsl_mutation_matrix
Definition: ttquanti.h:210
double get_dominance(unsigned int locus, unsigned int trait)
Definition: ttquanti.h:147
double * _phenotypes
Definition: ttquanti.h:206
bool _dominance_is_constant
Definition: ttquanti.h:223
double * getMutationEffectBivariateGaussian(unsigned int loc)
Definition: ttquanti.cc:935
void set_trait_value_func_ptr(bool withVe)
Definition: ttquanti.cc:456
vector< double > _h2
Definition: ttquanti.h:231
void inherit(sex_t SEX, double *seq, const double **parent)
Definition: ttquanti.cc:1113
unsigned int get_nb_locus()
Definition: ttquanti.h:122
double get_init_value(unsigned int i)
Definition: ttquanti.h:132
TTQuantiSH * _stats
Definition: ttquanti.h:244
virtual TTQuanti * hatch()
Definition: ttquanti.cc:1293
void set_init_values(const double *values, unsigned int nval)
Definition: ttquanti.cc:1019
void(TProtoQuanti::* _mutation_func_ptr)(TTQuanti *)
Definition: ttquanti.h:236
void set_mutation_matrix_decomposition()
Definition: ttquanti.cc:798
unsigned int get_nb_traits()
Definition: ttquanti.h:121
void inherit_free(sex_t SEX, double *seq, const double **parent)
Definition: ttquanti.cc:1120
double _genomic_mutation_rate
Definition: ttquanti.h:215
double * getMutationEffectBivariateDiallelic(unsigned int loc)
Definition: ttquanti.cc:960
virtual bool retrieve_data(BinaryStorageBuffer *reader)
Definition: ttquanti.h:192
void mutate_noHC(TTQuanti *ind)
Definition: ttquanti.cc:1225
unsigned int get_allele_model()
Definition: ttquanti.h:130
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
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
void mutate(TTQuanti *ind)
Definition: ttquanti.cc:1211
unsigned int get_h2_setTime()
Definition: ttquanti.h:126
TMatrix get_dominance_effects()
Definition: ttquanti.h:149
double get_genotype(const double a1, const double a2, const unsigned int locus, const unsigned int trait)
Definition: ttquanti.cc:1106
double set_genotype_value_additive(const double **sequ, const unsigned int trait)
Definition: ttquanti.cc:1045
vector< double > get_heritability()
Definition: ttquanti.h:125
void mutate_diallelic_HC(TTQuanti *ind)
Definition: ttquanti.cc:1248
size_t _locusByteSize
Definition: ttquanti.h:227
double set_trait_value_noVE(const TTQuanti *ind, const unsigned int trait)
Definition: ttquanti.cc:1038
gsl_matrix * _evect
Definition: ttquanti.h:211
void inherit_low(sex_t SEX, double *seq, const double **parent)
Definition: ttquanti.cc:1140
virtual void loadStatServices(StatServices *loader)
Definition: ttquanti.cc:1376
unsigned int get_seq_length()
Definition: ttquanti.h:123
double(TProtoQuanti::* _set_trait_value_func_ptr)(const TTQuanti *, const unsigned int)
Definition: ttquanti.h:239
virtual trait_t get_type() const
Definition: ttquanti.h:179
double get_genotype_dominance_k(double a1, double a2, double k)
Definition: ttquanti.cc:1101
virtual bool resetParameterFromSource(std::string param, SimComponent *cmpt)
Definition: ttquanti.h:185
gsl_vector * _ws
Definition: ttquanti.h:214
double get_genotype_dominance_h(double a1, double a2, double h)
Definition: ttquanti.cc:1084
double _effects_bivar[2]
Definition: ttquanti.h:218
virtual void reset()
Definition: ttquanti.h:176
double _mutation_correlation
Definition: ttquanti.h:216
double * _init_value
Definition: ttquanti.h:205
TTQuantiSH * get_stater()
Definition: ttquanti.h:133
void reset_mutation_pointers()
Definition: ttquanti.cc:971
bool setDiallelicMutationModel()
Definition: ttquanti.cc:550
bool setContinuousMutationModel()
Definition: ttquanti.cc:673
TTQuantiFH * _writer
Definition: ttquanti.h:245
virtual bool setParameters()
Definition: ttquanti.cc:193
bool get_h2_isBroad()
Definition: ttquanti.h:127
virtual void loadFileServices(FileServices *loader)
Definition: ttquanti.cc:1304
unsigned int _nb_locus
Total number of loci, for all traits.
Definition: ttquanti.h:198
virtual void store_data(BinaryStorageBuffer *saver)
Definition: ttquanti.h:189
TMatrix * _mutation_matrix
Definition: ttquanti.h:209
double * _mutation_sigma
Definition: ttquanti.h:217
unsigned int get_dominance_model()
Definition: ttquanti.h:146
TProtoQuanti()
Definition: ttquanti.cc:60
double(TProtoQuanti::* _set_genotype_func_ptr)(const double **, const unsigned int)
Definition: ttquanti.h:240
void set_eVarianceSD(unsigned int trait, double SD)
Definition: ttquanti.cc:917
virtual TProtoQuanti * clone()
Definition: ttquanti.h:178
double ** get_allele_values() const
Definition: ttquanti.h:131
double ** _allele_value
Definition: ttquanti.h:204
double get_trait_var(unsigned int trait)
Definition: ttquanti.h:128
TTQFreqExtractor * _freqExtractor
Definition: ttquanti.h:247
TTProtoWithMap.
Definition: ttrait_with_map.h:176
virtual void reset()
Definition: ttrait_with_map.cc:611
TTQuantiFH.
Definition: ttquanti.h:334
void print(ofstream &FH, sex_t SEX, age_idx Ax, unsigned int print_gene, bool print_genotype, bool print_additive_genotype)
Definition: ttquanti.cc:3114
void write_PLINK()
Definition: ttquanti.cc:3177
void print_PLINK_FAM(ofstream &FH, age_idx Ax, Patch *patch)
Definition: ttquanti.cc:3369
TTQuantiFH(TProtoQuanti *T)
Definition: ttquanti.h:339
virtual void FHread(string &filename)
Definition: ttquanti.cc:3434
void print_PLINK_PED(ofstream &FH, age_idx Ax, Patch *patch)
Definition: ttquanti.cc:3292
void write_TABLE()
Definition: ttquanti.cc:3023
virtual void FHwrite()
Definition: ttquanti.cc:3001
virtual ~TTQuantiFH()
Definition: ttquanti.h:340
string _output_option
Definition: ttquanti.h:336
void setOutputOption(string opt)
Definition: ttquanti.cc:2988
Definition: ttquanti.h:257
double * _Vp
Definition: ttquanti.h:259
void addQuanti(age_t AGE)
Definition: ttquanti.cc:1923
void addAvgPerPatch(age_t AGE)
Definition: ttquanti.cc:2096
double ** _pVa
Definition: ttquanti.h:260
double getEigenVectorEltPerPatch(unsigned int p, unsigned int v)
Definition: ttquanti.h:322
vector< double > getVaNoDominance(Patch *curPop, const age_idx AGE)
Definition: ttquanti.cc:2684
double * _Vb
Definition: ttquanti.h:259
unsigned int _nb_trait
Definition: ttquanti.h:262
double getEigenVectorElt(unsigned int t1, unsigned int t2)
Definition: ttquanti.h:315
unsigned int _nb_locus
Definition: ttquanti.h:262
void addEigenStatsPerPatcg(age_t AGE)
void addCovarPerPatch(age_t AGE)
Definition: ttquanti.cc:2177
double * _meanP
Definition: ttquanti.h:259
void addEigenVect1PerPatch(age_t AGE)
Definition: ttquanti.cc:2296
void addVarPerPatch(age_t AGE)
Definition: ttquanti.cc:2131
TTQuantiSH(TProtoQuanti *TP)
Definition: ttquanti.h:274
virtual ~TTQuantiSH()
Definition: ttquanti.h:282
double ** _pVp
Definition: ttquanti.h:260
double getVa(unsigned int i)
Definition: ttquanti.h:308
bool _eVar
Definition: ttquanti.h:263
gsl_matrix * _evec
Definition: ttquanti.h:265
double getEigenValuePerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.h:320
unsigned int _table_set_age
Definition: ttquanti.h:270
void addEigenValuesPerPatch(age_t AGE)
Definition: ttquanti.cc:2262
double getVb(unsigned int i)
Definition: ttquanti.h:310
double getSkewPerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.cc:2371
double ** _pmeanP
Definition: ttquanti.h:260
double * _meanG
Definition: ttquanti.h:259
double getMeanPhenotPerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.h:317
void setStats(age_t AGE)
Definition: ttquanti.cc:2456
void setAdultStats()
Definition: ttquanti.h:304
double getVg(unsigned int i)
Definition: ttquanti.h:309
void addEigen(age_t AGE)
Definition: ttquanti.cc:1992
gsl_vector * _eval
Definition: ttquanti.h:266
double getMeanPhenot(unsigned int i)
Definition: ttquanti.h:307
double * _covar
Definition: ttquanti.h:259
DataTable< double > _phenoTable
Definition: ttquanti.h:269
double getCovarPerPatch(unsigned int p, unsigned int i)
Definition: ttquanti.h:321
double getEigenValue(unsigned int i)
Definition: ttquanti.h:314
double getQst(unsigned int i)
Definition: ttquanti.h:312
void addEigenPerPatch(age_t AGE)
Definition: ttquanti.cc:2218
vector< double > getVaWithDominance(Patch *curPop, const age_idx AGE)
computation of the additive genetic variance from the average excess of each allele exact under rando...
Definition: ttquanti.cc:2782
double getVp(unsigned int i)
Definition: ttquanti.h:311
vector< double > getSNPalleleFreqInPatch(Patch *patch)
Definition: ttquanti.cc:2593
gsl_matrix * _G
Definition: ttquanti.h:265
void addEigenVect1(age_t AGE)
Definition: ttquanti.cc:2051
double ** _peigvect
Definition: ttquanti.h:260
unsigned int _table_set_repl
Definition: ttquanti.h:270
double getVpPerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.h:319
gsl_eigen_symmv_workspace * _ws
Definition: ttquanti.h:267
unsigned int _table_set_gen
Definition: ttquanti.h:270
double getCovar(unsigned int i)
Definition: ttquanti.h:313
virtual bool setStatRecorders(std::string &token)
Definition: ttquanti.cc:1865
DataTable< double > _genoTable
Definition: ttquanti.h:269
double * _Va
Definition: ttquanti.h:259
void addEigenValues(age_t AGE)
Definition: ttquanti.cc:2023
void resetPtrs()
Definition: ttquanti.cc:1734
double * _Vg
Definition: ttquanti.h:259
void setDataTables(age_t AGE)
Definition: ttquanti.cc:2386
void addQuantiPerPatch(age_t AGE)
Definition: ttquanti.cc:2078
double ** _peigval
Definition: ttquanti.h:260
unsigned int _patchNbr
Definition: ttquanti.h:262
double ** _pcovar
Definition: ttquanti.h:260
double ** _pmeanG
Definition: ttquanti.h:260
double getVaPerPatch(unsigned int i, unsigned int p)
Definition: ttquanti.h:318
void addSkewPerPatch(age_t AGE)
Definition: ttquanti.cc:2335
double * _eigval
Definition: ttquanti.h:259
void setOffsprgStats()
Definition: ttquanti.h:305
virtual void init()
Definition: ttquanti.cc:1794
double ** _eigvect
Definition: ttquanti.h:259
TTQuanti.
Definition: ttquanti.h:56
virtual void * getValue() const
Definition: ttquanti.h:77
TProtoQuanti * _myProto
Definition: ttquanti.h:105
double ** _sequence
Definition: ttquanti.h:102
virtual void inherit(TTrait *mother, TTrait *father)
Definition: ttquanti.cc:1627
virtual ~TTQuanti()
Definition: ttquanti.h:66
virtual bool retrieve_data(BinaryStorageBuffer *reader)
Definition: ttquanti.cc:1686
virtual void ** get_sequence() const
Definition: ttquanti.h:79
virtual void set_value()
Definition: ttquanti.cc:1646
double get_full_genotype(unsigned int trait)
Definition: ttquanti.cc:1671
virtual void show_up()
Definition: ttquanti.cc:1695
virtual void init()
Definition: ttquanti.cc:1456
double get_additive_genotype(unsigned int trait)
Definition: ttquanti.cc:1664
void set_phenotype(unsigned int trait, double value)
Definition: ttquanti.cc:1655
TTQuanti()
Definition: ttquanti.h:60
virtual TTQuanti & operator=(const TTrait &T)
Definition: ttquanti.cc:1394
void set_allele(int locus, int allele, double value)
Definition: ttquanti.h:97
virtual TTQuanti * clone()
Definition: ttquanti.h:83
TTQuanti(const TTQuanti &T)
Definition: ttquanti.h:63
void set_proto(TProtoQuanti *proto)
Definition: ttquanti.h:93
virtual void init_sequence()
Definition: ttquanti.cc:1478
virtual bool operator!=(const TTrait &T)
Definition: ttquanti.cc:1431
double * _phenotypes
Definition: ttquanti.h:103
virtual double get_allele_value(int loc, int all)
Definition: ttquanti.cc:1441
virtual void store_data(BinaryStorageBuffer *saver)
Definition: ttquanti.cc:1678
virtual void mutate()
Definition: ttquanti.cc:1639
virtual void set_allele_value(unsigned int locus, unsigned int allele, double value)
Definition: ttquanti.cc:1448
virtual void reset()
Definition: ttquanti.cc:1611
virtual void set_sequence(void **seq)
Definition: ttquanti.cc:1469
virtual void * set_trait(void *value)
Definition: ttquanti.h:74
virtual bool operator==(const TTrait &T)
Definition: ttquanti.cc:1415
virtual trait_t get_type() const
Definition: ttquanti.h:78
Interface for all trait types, declares all basic trait operations.
Definition: ttrait.h:46
Template class for the trait's FileHandler.
Definition: filehandler.h:217
Template class for the trait's StatHandler.
Definition: stathandler.h:168
double ALLELE
TTQuantiSH.
Definition: ttquanti.h:255
#define QUANT
Definition: types.h:72
std::string trait_t
Trait types.
Definition: types.h:63
sex_t
Sex types, males are always 0 and females 1!!
Definition: types.h:36
unsigned int age_t
Age class flags.
Definition: types.h:46
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
age_idx
Array index of the age classes in the patch sizes and containers arrays.
Definition: types.h:41