Nemo  2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
ttneutralgenes.h
Go to the documentation of this file.
1
29#ifndef TTNEUTRALGENES_H
30#define TTNEUTRALGENES_H
31
32#include <cmath>
33#include <vector>
34#include "ttrait_with_map.h"
35#include "types.h"
36#include "lifecycleevent.h"
37#include "filehandler.h"
38#include "stathandler.h"
39#include "datatable.h"
40#include "metapop.h"
41#include "binarystoragebuffer.h"
42
45class TTNtrlPhenotyperFH;
47// ----------------------------------------------------------------------------------------
48
49// N E U T R A L T R A I T
50
51// ----------------------------------------------------------------------------------------
53class TTNeutralGenes : public TTrait
54{
55private:
57 //parameters:
58 unsigned int _allele_num;
59 unsigned int _locus_num;
60 unsigned int _ploidy;
61 double _mut_rate;
63 unsigned int _mut_model;
64 unsigned int _2L; //genome size (ploidy*num_locus)
65 unsigned short _init_model;
67 void (TProtoNeutralGenes::* _inherit_func_ptr) (sex_t, unsigned char*, unsigned char**);
68
69 //_sequence:
70 unsigned char** _sequence; // ordered as [ploidy][locus]
71
73
74public:
75
79
81 : _myProto(T._myProto),
85 _sequence(0), _type(NTRL) { }
86
87 virtual ~TTNeutralGenes ();
88
91 unsigned int get_ploidy ( ) {return _ploidy;}
92 unsigned int get_locus_num ( ) {return _locus_num;}
93 unsigned int get_allele_num ( ) {return _allele_num;}
94
95 void set_proto (TProtoNeutralGenes* proto) {_myProto = proto;}
96 void set_locus_num (int value) {_locus_num = value;}
97 void set_allele_num (int value) {_allele_num = value;}
98 void set_mut_rate (double value) {_mut_rate = value;}
99 void set_2L (unsigned int val) {_2L = val;}
100 void set_recomb_rate (double value) {_recomb_rate = value;}
101 void set_mut_model (int value) {_mut_model = value;}
102 void set_init_model (unsigned short val) {_init_model = val;}
103 void set_mut_func_ptr (void(TTNeutralGenes::* theFunc)(void))
104 {_mutate_func_ptr = theFunc;}
105 void set_inherit_func_ptr (void(TProtoNeutralGenes::* theFunc)(sex_t, unsigned char*, unsigned char**))
106 {_inherit_func_ptr = theFunc;}
107 void set_allele (unsigned int loc, unsigned int al, unsigned char val) {_sequence[al][loc] = val;}
109
110 // static void set_recomb_template (unsigned int size);
111
114 void mutate_SSM ( );
115 void mutate_KAM ( );
116 void mutate_2all ( );
117 void mutate_NULL ( ) { }
121 virtual TTNeutralGenes& operator= (const TTrait& T);
122 virtual bool operator== (const TTrait& T);
123 virtual bool operator!= (const TTrait& T);
124 virtual void init ( );
125 virtual void init_sequence ( );
126 virtual void reset ( );
127 virtual void* set_trait (void* value) {return NULL;}
128 inline virtual void** get_sequence ( ) const {return (void**)_sequence;}
129 virtual double get_allele_value (int loc, int all)
130 {return ( !(loc<(int)_locus_num) || !(all<(int)_ploidy) ? 0 : (double)_sequence[all][loc]);}
131 virtual void set_allele_value (unsigned int locus, unsigned int allele, double value)
132 {assert(locus < _locus_num && allele < 2); _sequence[allele][locus] = (unsigned char)value;}
133 virtual void set_sequence (void** seq);
134 inline virtual trait_t get_type ( ) const {return _type;}
135 virtual void set_value ( ) { }
136 virtual void* getValue ( ) const {return 0;}
137 virtual void inherit (TTrait* mother, TTrait* father);
138 virtual void mutate ( ) {(this->*_mutate_func_ptr) ();}
139 virtual void show_up ( );
140 virtual TTNeutralGenes* clone ( ) {return new TTNeutralGenes(*this);}
141
142 //implements StorableComponent
143 virtual void store_data (BinaryStorageBuffer* saver)
144 {
145 for(unsigned int i = 0; i < _locus_num; ++i)
146 for(unsigned int j = 0; j < _ploidy; ++j)
147 saver->store(&_sequence[j][i], 1);
148 }
149 virtual bool retrieve_data (BinaryStorageBuffer* reader)
150 {
151 for(unsigned int i = 0; i < _locus_num; ++i)
152 for(unsigned int j = 0; j < _ploidy; ++j)
153 reader->read(&_sequence[j][i], 1);
154 return true;
155 }
157};
158// ----------------------------------------------------------------------------------------
159
160// N E U T R A L T R A I T P R O T O T Y P E
161
162// ----------------------------------------------------------------------------------------
165
166private:
167 unsigned int _allele_num;
168 unsigned int _locus_num;
169 unsigned int _ploidy;
170 double _mut_rate;
172 unsigned short _init_model;
175 void (TProtoNeutralGenes::* _inherit_func_ptr) (sex_t, unsigned char*, unsigned char**);
176
177 vector< TTNeutralGenesFH* > _writers;
180
181public:
182
184
186
187 virtual ~TProtoNeutralGenes ( );
188
189 unsigned int get_ploidy ( ) {return _ploidy;}
190 unsigned int get_locus_num ( ) {return _locus_num;}
191 unsigned int get_allele_num ( ) {return _allele_num;}
192
194
195 void inherit_low (sex_t SEX, unsigned char* seq, unsigned char** parent);
196 void inherit_free (sex_t SEX, unsigned char* seq, unsigned char** parent);
197
198 //implementation of TraitPrototype:
199 virtual void init (){}
200
201 virtual void reset (){TTProtoWithMap::reset();}
202
203 virtual TTNeutralGenes* hatch ();
204
205 virtual TProtoNeutralGenes* clone () {return new TProtoNeutralGenes(*this);}
206
207 virtual trait_t get_type () const {return _type;}
208 //implementation of SimComponent:
209 virtual bool setParameters();
210
211 virtual void loadFileServices ( FileServices* loader );
212
213 virtual void loadStatServices ( StatServices* loader );
214
215 virtual bool resetParameterFromSource (std::string param, SimComponent* cmpt); // {return false;}
216
217 //implementation of StorableComponent:
218 virtual void store_data ( BinaryStorageBuffer* saver ) {saver->store(&_locus_num,sizeof(int));}
219
220 virtual bool retrieve_data ( BinaryStorageBuffer* reader );
221};
222
223// ----------------------------------------------------------------------------------------
224
225// N E U T R A L T R A I T F I L E H A N D L E R
226
227// ----------------------------------------------------------------------------------------
228
235class TTNeutralGenesFH: public TraitFileHandler<TProtoNeutralGenes> {
236
239
240public:
241
244 { }
245
246 virtual ~TTNeutralGenesFH ( ) { }
247
248 virtual void FHwrite ();
249
250 virtual void FHread (string& filename);
251
252 void write_TAB();
253 void write_patch_TAB(Patch* patch, sex_t SEX, age_idx AGE, ofstream &FH);
254 void write_PLINK ();
255 void print_PLINK_PED(ofstream& FH, age_idx Ax, Patch *patch);
256 void write_PLINK_BED (ofstream &BED);
257 void write_GENEPOP();
258 void write_patch_GENEPOP(Patch* patch, sex_t SEX, age_idx AGE, ofstream &FH, unsigned int digits);
259 void write_FSTAT();
260 void write_patch_FSTAT(Patch* patch, sex_t SEX, age_idx AGE, ofstream &FH, unsigned int digits);
261 void write_Fst_i();
262// void write_freq();
263 void write_varcompWC();
264
265 void setOutputOption(string opt);
266 void set_write_fct( void (TTNeutralGenesFH::* fct_ptr) () ) {write_fct = fct_ptr;}
267
268};
269
270// ----------------------------------------------------------------------------------------
271
272// N E U T R A L T R A I T S T A T H A N D L E R
273
274// ----------------------------------------------------------------------------------------
275
277class TTNeutralGenesSH: public TraitStatHandler<TProtoNeutralGenes, TTNeutralGenesSH> {
278
284
288
290 double _sib_prop[4];
291 double _sib_coa[4];
292
297 double _fst_WH;
302
306
307 //Nei's genetic distance:
309 double _meanD;
310
311public:
312
316 _D(0)
317 { }
318
319 virtual ~TTNeutralGenesSH ( )
320 {
321 if(_coa_matrix != NULL) delete _coa_matrix;
322 if(_fst_matrix != NULL) delete _fst_matrix;
323 if(_fst_WC_loc) delete[]_fst_WC_loc;
324 if(_fis_WC_loc) delete[]_fis_WC_loc;
325 if(_fit_WC_loc) delete[]_fit_WC_loc;
326 if(_D != NULL) delete _D;
327 }
328
329 virtual void init ( ) ;
330
331 virtual bool setStatRecorders (std::string& token);
332
333 void setFreqRecorders (age_t AGE);
335 void setFstatRecorders (age_t AGE);
336 void setFstat2Recorders (age_t AGE);
337 void setFstatWCRecorders (age_t AGE);
338 void setCoaMatrixRecorders (age_t AGE, unsigned char dim);
339 void setFstMatrixRecorders (age_t AGE, unsigned char dim);
340 void setNeiGeneticDistanceRecorders (age_t AGE, bool pairwise);
341 void setDxyRecorders (age_t AGE, bool patchwise);
342
347 void setHeterozygosity (age_t AGE);
350
351 double getGlobalAlleleFreq (unsigned int loc, unsigned int all) {
352 return _globalAlleleFreq.get(loc, all);
353 }
354
355 double getHeterozygosity (unsigned int loc) {
356 double het = 0;
357 for(unsigned int i = 0; i < _heteroTable.getNumGroups(); ++i )
358 het += _heteroTable.get(i, loc, 0);
359 return het/_heteroTable.getNumGroups(); //mean per patch heterozygosity
360 }
361
365 void setAlleleTables (age_t AGE);
366 void setHeteroTable (age_t AGE);
367 void allocateTables (unsigned int loci, unsigned int all);
368
371
373
375
378
388 void setFstMatrix (age_t AGE, unsigned char dim);
397 double getWeightedFst () {return _fst_WH;}
399 double getFst_ij (unsigned int i)
400 {
401 unsigned int scale = (unsigned int)pow( 10.0, (int)log10((float)_fst_matrix->getNbCols()) + 1 );
402 return _fst_matrix->get(i/scale, i%scale);
403 }
405 void setFst_li(unsigned int N, unsigned int L, double **array);
406// /**Computes raw Fst following the original definition (=var(p)/p_bar(1 - p_bar)).*/
407// double getFstWright(unsigned int i) {if(i == 1) return _fst_W1; else return _fst_W2;}
408
410 void setFstat (age_t AGE);
413 double setHo (age_idx age_pos);
414 double setHs (age_idx age_pos);
415 double setHt (age_idx age_pos);
416 double getHsnei () {return _hsnei;}
417 double getHtnei () {return _htnei;}
418 double getHo () {return _ho;}
419 double getHs () {return _hs;}
420 double getHt () {return _ht;}
421 double getFst () {return _fst;}
422 double getFis () {return _fis;}
423 double getFit () {return _fit;}
425 void setFstat2 (age_t AGE);
428 deque<double> setHo2 (age_idx age_pos);
429 deque<double> setHs2 (age_idx age_pos);
430 deque<double> setHt2 (age_idx age_pos);
431
433 void setFstatWeirCockerham (age_t AGE);
437 double getFstWC () {return _fst_WC;}
438 double getFisWC () {return _fis_WC;}
439 double getFitWC () {return _fit_WC;}
441 void setLociDivCounter (age_t AGE);
442 double getNbAllLocal () {return _nb_all_local;}
443 double getNbAllGlobal () {return _nb_all_global;}
444 double getFixLocLocal () {return _fix_loc_local;}
449
456 double Coancestry (void** ind1, void** ind2, unsigned int nb_locus);
464 void setCoaMatrix (age_idx age_pos, unsigned char dim);
471 void setAdults_Theta ();
472
477 double getCoa (unsigned int i)
478 {
479 unsigned int scale = (unsigned int)pow( 10.0, (int)log10((float)_coa_matrix->getNbCols()) + 1 );
480 return _coa_matrix->get(i/scale, i%scale);
481 }
482 double getMeanTheta () {return _mean_theta;}
483 double getMeanAlpha () {return _mean_alpha;}
485 double getTheta_FF () {return Theta_FF;}
487 double getTheta_MM () {return Theta_MM;}
489 double getTheta_FM () {return Theta_FM;}
490 void setSibStats ();
491 void setSibCoa (Individual *I1, Individual *I2);
492 double getSibProportions (unsigned int i) {return _sib_prop[i];}
493 double getSibCoaMeans (unsigned int i) {return _sib_coa[i];}
495
500 void setNeiGeneticDistance (age_t AGE);
501 double getNeiGeneticDistance (unsigned int i)
502 {
503 unsigned int scale = (unsigned int)pow( 10.0, (int)log10((float)_D->getNbCols()) + 1 );
504 return _D->get(i/scale,i%scale);
505 }
508
511 double getDxyOffspringPerPatch (unsigned int patch1, unsigned patch2) {return getDxyPerPatch(OFFSx, patch1, patch2);}
512 double getDxyAdultPerPatch (unsigned int patch1, unsigned patch2) {return getDxyPerPatch(ADLTx, patch1, patch2);}
513 double getDxyPerPatch (age_idx age, unsigned int patch1, unsigned patch2);
514 double getDxy (unsigned int age_class);
516};
517
518// ----------------------------------------------------------------------------------------
519
520// N E U T R A L T R A I T F R E Q I N I T I A L I Z E R
521
522// ----------------------------------------------------------------------------------------
523
524//LCE_NtrlInit
525//
527class LCE_NtrlInit : public virtual LifeCycleEvent
528{
529
531 unsigned int _nLoci;
532
533public:
534
535 LCE_NtrlInit ( );
536
537 virtual ~LCE_NtrlInit ( ) { }
538
539 virtual void execute ();
540
541 void init_allele_freq(sex_t SEX, age_idx AGE, unsigned int size, unsigned int deme, double *values);
542
543 virtual LifeCycleEvent* clone ( ) {return new LCE_NtrlInit();}
544
545 virtual bool setParameters ();
546
547 //SimComponent implementation:
548 virtual void loadFileServices ( FileServices* loader ) {}
549 virtual void loadStatServices ( StatServices* loader ) {}
550 virtual bool resetParameterFromSource (std::string param, SimComponent* cmpt) {return false;}
551 virtual age_t removeAgeClass ( ) {return 0;}
552 virtual age_t addAgeClass ( ) {return 0;}
553 virtual age_t requiredAgeClass () {return 0;}
554
555};
556
557#endif //TTNEUTRALGENES_H
558
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
T get(unsigned int group, unsigned int Class, unsigned int elmnt)
Returns value stored of the element 'elmnt' of the class 'Class' in the group 'group'.
Definition: datatable.h:228
unsigned int getNumGroups()
Definition: datatable.h:258
A class to manage the files associated with each components of the simulation.
Definition: fileservices.h:52
This class contains traits along with other individual information (sex, pedigree,...
Definition: individual.h:49
Set patch-specifiec initial genotypes values.
Definition: ttneutralgenes.h:528
virtual age_t requiredAgeClass()
Definition: ttneutralgenes.h:553
virtual age_t removeAgeClass()
Definition: ttneutralgenes.h:551
TMatrix _init_freq
Definition: ttneutralgenes.h:530
virtual ~LCE_NtrlInit()
Definition: ttneutralgenes.h:537
unsigned int _nLoci
Definition: ttneutralgenes.h:531
virtual void execute()
Definition: ttneutralgenes.cc:2305
virtual age_t addAgeClass()
Definition: ttneutralgenes.h:552
virtual LifeCycleEvent * clone()
Definition: ttneutralgenes.h:543
void init_allele_freq(sex_t SEX, age_idx AGE, unsigned int size, unsigned int deme, double *values)
Definition: ttneutralgenes.cc:2329
virtual void loadFileServices(FileServices *loader)
Definition: ttneutralgenes.h:548
virtual bool setParameters()
Definition: ttneutralgenes.cc:2281
LCE_NtrlInit()
Definition: ttneutralgenes.cc:2274
virtual bool resetParameterFromSource(std::string param, SimComponent *cmpt)
Definition: ttneutralgenes.h:550
virtual void loadStatServices(StatServices *loader)
Definition: ttneutralgenes.h:549
Base class of the Life Cycle Events, declares the LCE interface.
Definition: lifecycleevent.h:73
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
unsigned int getNbCols()
Gives the number of columns.
Definition: tmatrix.h:169
Prototype class for the TTNeutralGenes trait class.
Definition: ttneutralgenes.h:164
virtual bool resetParameterFromSource(std::string param, SimComponent *cmpt)
Definition: ttneutralgenes.cc:456
TTNeutralGenesSH * _stats
Definition: ttneutralgenes.h:178
virtual void loadFileServices(FileServices *loader)
Definition: ttneutralgenes.cc:154
unsigned int _allele_num
Definition: ttneutralgenes.h:167
const trait_t _type
Definition: ttneutralgenes.h:179
double _mut_rate
Definition: ttneutralgenes.h:170
virtual void init()
Definition: ttneutralgenes.h:199
unsigned short _init_model
Definition: ttneutralgenes.h:172
virtual trait_t get_type() const
Definition: ttneutralgenes.h:207
unsigned int get_locus_num()
Definition: ttneutralgenes.h:190
virtual bool retrieve_data(BinaryStorageBuffer *reader)
Definition: ttneutralgenes.cc:445
double _recomb_rate
Definition: ttneutralgenes.h:173
unsigned int _locus_num
Definition: ttneutralgenes.h:168
virtual bool setParameters()
Definition: ttneutralgenes.cc:95
void inherit_low(sex_t SEX, unsigned char *seq, unsigned char **parent)
Definition: ttneutralgenes.cc:368
virtual void store_data(BinaryStorageBuffer *saver)
Definition: ttneutralgenes.h:218
TProtoNeutralGenes()
Definition: ttneutralgenes.cc:49
unsigned int get_ploidy()
Definition: ttneutralgenes.h:189
unsigned int get_allele_num()
Definition: ttneutralgenes.h:191
virtual void reset()
Definition: ttneutralgenes.h:201
void(TProtoNeutralGenes::* _inherit_func_ptr)(sex_t, unsigned char *, unsigned char **)
Definition: ttneutralgenes.h:175
vector< TTNeutralGenesFH * > _writers
Definition: ttneutralgenes.h:177
unsigned int _ploidy
Definition: ttneutralgenes.h:169
virtual TProtoNeutralGenes * clone()
Definition: ttneutralgenes.h:205
virtual TTNeutralGenes * hatch()
Definition: ttneutralgenes.cc:328
int _mut_model
Definition: ttneutralgenes.h:171
void inherit_free(sex_t SEX, unsigned char *seq, unsigned char **parent)
Definition: ttneutralgenes.cc:358
virtual void loadStatServices(StatServices *loader)
Definition: ttneutralgenes.cc:314
virtual ~TProtoNeutralGenes()
Definition: ttneutralgenes.cc:84
TTNeutralGenesSH * get_stater()
Definition: ttneutralgenes.h:193
void(TTNeutralGenes::* _mutate_func_ptr)(void)
Definition: ttneutralgenes.h:174
A file handler to save the neutral markers genotypes in the FSTAT format (extended).
Definition: ttneutralgenes.h:235
void write_patch_GENEPOP(Patch *patch, sex_t SEX, age_idx AGE, ofstream &FH, unsigned int digits)
Definition: ttneutralgenes.cc:1169
void(TTNeutralGenesFH::* write_fct)()
Definition: ttneutralgenes.h:238
void write_patch_FSTAT(Patch *patch, sex_t SEX, age_idx AGE, ofstream &FH, unsigned int digits)
Definition: ttneutralgenes.cc:1083
virtual void FHwrite()
Definition: ttneutralgenes.cc:714
virtual ~TTNeutralGenesFH()
Definition: ttneutralgenes.h:246
void write_GENEPOP()
Definition: ttneutralgenes.cc:1113
void write_PLINK_BED(ofstream &BED)
Definition: ttneutralgenes.cc:974
void write_Fst_i()
Definition: ttneutralgenes.cc:1343
string _output_option
Definition: ttneutralgenes.h:237
void setOutputOption(string opt)
Definition: ttneutralgenes.cc:703
void write_FSTAT()
Definition: ttneutralgenes.cc:1032
void print_PLINK_PED(ofstream &FH, age_idx Ax, Patch *patch)
Definition: ttneutralgenes.cc:905
void write_patch_TAB(Patch *patch, sex_t SEX, age_idx AGE, ofstream &FH)
Definition: ttneutralgenes.cc:787
virtual void FHread(string &filename)
Definition: ttneutralgenes.cc:1199
void write_TAB()
Definition: ttneutralgenes.cc:733
void write_varcompWC()
Definition: ttneutralgenes.cc:1409
void write_PLINK()
Definition: ttneutralgenes.cc:828
void set_write_fct(void(TTNeutralGenesFH::*fct_ptr)())
Definition: ttneutralgenes.h:266
TTNeutralGenesFH(TProtoNeutralGenes *TP)
Definition: ttneutralgenes.h:242
The stat handler for neutral markers.
Definition: ttneutralgenes.h:277
void setAdultHeterozygosity()
Definition: ttneutralgenes.h:348
virtual ~TTNeutralGenesSH()
Definition: ttneutralgenes.h:319
double setHo(age_idx age_pos)
Definition: stats_fstat.cc:363
DataTable< unsigned int > * getAlleleCountTable()
Definition: ttneutralgenes.h:372
void setFstatWeirCockerham_MS(age_t AGE)
Definition: stats_fstat.cc:854
double getGlobalAlleleFreq(unsigned int loc, unsigned int all)
Definition: ttneutralgenes.h:351
void setFreqRecordersPerPatch(age_t AGE)
void setAdultsFstat2()
Definition: ttneutralgenes.h:427
double getSibCoaMeans(unsigned int i)
Definition: ttneutralgenes.h:493
TTNeutralGenesSH(TProtoNeutralGenes *TP)
Definition: ttneutralgenes.h:313
double setHt(age_idx age_pos)
Definition: stats_fstat.cc:455
double getHeterozygosity(unsigned int loc)
Definition: ttneutralgenes.h:355
double getHsnei()
Definition: ttneutralgenes.h:416
double getDxyPerPatch(age_idx age, unsigned int patch1, unsigned patch2)
Definition: stats_fstat.cc:1236
double getSibProportions(unsigned int i)
Definition: ttneutralgenes.h:492
deque< double > setHo2(age_idx age_pos)
Definition: stats_fstat.cc:545
void setAdultsCoaWithin()
Definition: ttneutralgenes.h:467
double _fst
Definition: ttneutralgenes.h:295
void setAlleleTables(age_t AGE)
Definition: stats_fstat.cc:74
void setOffsprgCoaWithin()
Definition: ttneutralgenes.h:468
double getFixLocGlobal()
Definition: ttneutralgenes.h:445
void setFstatWeirCockerham(age_t AGE)
Computes the Weir & Cockerham (1984) Fstat values (Theta, F, and f).
Definition: stats_fstat.cc:771
void setSibStats()
Definition: stats_coa.cc:279
void setFstMatrix(age_t AGE, unsigned char dim)
Computes the weighted within and between patch Fst's as well as the overall Fst (Theta).
Definition: stats_fstat.cc:665
void allocateTables(unsigned int loci, unsigned int all)
Definition: stats_fstat.cc:43
double getFit()
Definition: ttneutralgenes.h:423
double _hs
Definition: ttneutralgenes.h:294
DataTable< unsigned int > _alleleCountTable
Definition: ttneutralgenes.h:279
void setSibCoa(Individual *I1, Individual *I2)
Definition: stats_coa.cc:350
void setDxyRecorders(age_t AGE, bool patchwise)
Definition: ttneutralgenes.cc:2237
double _nb_all_local
Definition: ttneutralgenes.h:294
double * _fis_WC_loc
Definition: ttneutralgenes.h:301
double _ht
Definition: ttneutralgenes.h:294
double _mean_alpha
Definition: ttneutralgenes.h:286
TMatrix * _fst_matrix
Pairwise Fst matrix.
Definition: ttneutralgenes.h:305
void setAdultsFstat()
Definition: ttneutralgenes.h:412
double _fst_W1
Definition: ttneutralgenes.h:303
void setNeiGeneticDistance(age_t AGE)
Definition: stats_fstat.cc:1129
DataTable< double > _heteroTable
Definition: ttneutralgenes.h:281
void setCoaMatrixRecorders(age_t AGE, unsigned char dim)
Definition: ttneutralgenes.cc:1995
double getHt()
Definition: ttneutralgenes.h:420
void setAdultsFstatWeirCockerham()
Definition: ttneutralgenes.h:436
double _meanD
Definition: ttneutralgenes.h:309
void setFstatRecorders(age_t AGE)
Definition: ttneutralgenes.cc:2083
double _mean_theta
Definition: ttneutralgenes.h:286
double getCoa(unsigned int i)
Gets the given coancestry coefficient from the coancestry matrix.
Definition: ttneutralgenes.h:477
void setAdultAlleleFreq()
Definition: ttneutralgenes.h:345
void setOffspringFstatWeirCockerham()
Definition: ttneutralgenes.h:435
double getNbAllGlobal()
Definition: ttneutralgenes.h:443
void setOffsprgCoaBetween()
Definition: ttneutralgenes.h:470
double _ho
F-statistics.
Definition: ttneutralgenes.h:294
double getWeightedFst()
Returns the weighted Fst using Weir & Hill (2002) method.
Definition: ttneutralgenes.h:397
void setAdultsFstBetween()
Definition: ttneutralgenes.h:391
double getMeanTheta()
Definition: ttneutralgenes.h:482
void setCoaMatrix(age_idx age_pos, unsigned char dim)
Computes the within and between patches coancestry coefficients.
Definition: stats_coa.cc:59
double Theta_MM
Definition: ttneutralgenes.h:285
unsigned int _table_set_gen
Definition: ttneutralgenes.h:283
double getMeanAlpha()
Definition: ttneutralgenes.h:483
TMatrix * getGlobalFreqs()
Accessor to the table of allele frequencies in the whole population.
Definition: ttneutralgenes.h:377
double Theta_FM
Definition: ttneutralgenes.h:285
double getNeiGeneticDistance(unsigned int i)
Definition: ttneutralgenes.h:501
double getHs()
Definition: ttneutralgenes.h:419
double getHo()
Definition: ttneutralgenes.h:418
double getDxyAdultPerPatch(unsigned int patch1, unsigned patch2)
Definition: ttneutralgenes.h:512
double _fst_W2
Definition: ttneutralgenes.h:303
deque< double > setHt2(age_idx age_pos)
Definition: stats_fstat.cc:639
TMatrix * _D
Definition: ttneutralgenes.h:308
void setFreqRecorders(age_t AGE)
Definition: ttneutralgenes.cc:2051
double * _fst_WC_loc
Per-locus F-stats (Weir&Cockerham).
Definition: ttneutralgenes.h:301
double * _fit_WC_loc
Definition: ttneutralgenes.h:301
void setOffsprgNeiGeneticDistance()
Definition: ttneutralgenes.h:499
TMatrix _globalAlleleFreq
Definition: ttneutralgenes.h:282
void setOffsprgCoaMatrix()
Definition: ttneutralgenes.h:466
DataTable< double > * getHeteroTable()
Definition: ttneutralgenes.h:374
TMatrix * _coa_matrix
Definition: ttneutralgenes.h:287
void setOffsprgFstBetween()
Definition: ttneutralgenes.h:394
void setAdultsFstMatrix()
Definition: ttneutralgenes.h:389
double _fis_WC
Definition: ttneutralgenes.h:299
void setFstat(age_t AGE)
Computes the F-statistics following Nei & Chesser (1983).
Definition: stats_fstat.cc:254
void setAdltNeiGeneticDistance()
Definition: ttneutralgenes.h:498
double getDxy(unsigned int age_class)
Definition: stats_fstat.cc:1210
double getFis()
Definition: ttneutralgenes.h:422
double getNbAllLocal()
Definition: ttneutralgenes.h:442
double _sib_coa[4]
Definition: ttneutralgenes.h:291
double getTheta_FF()
Gives the mean within females coancestry coefficient.
Definition: ttneutralgenes.h:485
void setOffspringHeterozygosity()
Definition: ttneutralgenes.h:349
void setFst_li(unsigned int N, unsigned int L, double **array)
Computes the per-locus per-patch Fst values using Weir&Hill 2002 approach.
Definition: stats_fstat.cc:1057
void setHeteroTable(age_t AGE)
Definition: stats_fstat.cc:166
double getTheta_MM()
Gives the mean within males coancestry coefficient.
Definition: ttneutralgenes.h:487
virtual bool setStatRecorders(std::string &token)
Definition: ttneutralgenes.cc:1742
double getFixLocLocal()
Definition: ttneutralgenes.h:444
double getFitWC()
Definition: ttneutralgenes.h:439
double getHtnei()
Definition: ttneutralgenes.h:417
void setLociDivCounter(age_t AGE)
Sets the allelic diversity counters.
Definition: stats_fstat.cc:295
void setOffsprgFstat()
Definition: ttneutralgenes.h:411
deque< double > setHs2(age_idx age_pos)
Definition: stats_fstat.cc:589
double getTheta_FM()
Gives the mean between males and females coancestry coefficient.
Definition: ttneutralgenes.h:489
double _fis
Definition: ttneutralgenes.h:295
double _fix_loc_local
Definition: ttneutralgenes.h:295
void setOffsprgFstWithin()
Definition: ttneutralgenes.h:393
double _fit
Definition: ttneutralgenes.h:295
void setFstatWCRecorders(age_t AGE)
Definition: ttneutralgenes.cc:2139
double setHs(age_idx age_pos)
Definition: stats_fstat.cc:410
void setHeterozygosity(age_t AGE)
Definition: stats_fstat.cc:225
double getDxyOffspringPerPatch(unsigned int patch1, unsigned patch2)
Definition: ttneutralgenes.h:511
double Theta_FF
Definition: ttneutralgenes.h:285
unsigned int _table_set_age
Definition: ttneutralgenes.h:283
double getFst_ij(unsigned int i)
Accessor to the Fst matrix as set by setFstMatrix().
Definition: ttneutralgenes.h:399
double _sib_prop[4]
Kinship classes proportions.
Definition: ttneutralgenes.h:290
void setFstMatrixRecorders(age_t AGE, unsigned char dim)
Definition: ttneutralgenes.cc:2159
DataTable< double > * getAlleleFreqTable()
Accessor to the table of allele frequencies, per patch.
Definition: ttneutralgenes.h:370
void setAdultsCoaBetween()
Definition: ttneutralgenes.h:469
void setAdultsFstWithin()
Definition: ttneutralgenes.h:390
void setOffsprgFstMatrix()
Definition: ttneutralgenes.h:392
double getFstWC()
Definition: ttneutralgenes.h:437
double Coancestry(void **ind1, void **ind2, unsigned int nb_locus)
Gives the coancestry (probability of identity by state) of two gene sequences.
Definition: stats_coa.cc:43
void setNeiGeneticDistanceRecorders(age_t AGE, bool pairwise)
Definition: ttneutralgenes.cc:2207
double getMeanNeiGeneticDistance()
Definition: ttneutralgenes.h:506
double _fit_WC
Definition: ttneutralgenes.h:299
double _hsnei
Definition: ttneutralgenes.h:294
virtual void init()
Definition: ttneutralgenes.cc:1733
double getFisWC()
Definition: ttneutralgenes.h:438
void setOffsprgFstat2()
Definition: ttneutralgenes.h:426
double getFst()
Definition: ttneutralgenes.h:421
void setAdultsCoaMatrix()
Definition: ttneutralgenes.h:465
void setOffspringAlleleFreq()
Definition: ttneutralgenes.h:346
void setAdults_Theta()
Definition: stats_coa.cc:203
double _nb_all_global
Definition: ttneutralgenes.h:294
double _fst_WC
Weir & Cockerham (1984) F-stat estimates.
Definition: ttneutralgenes.h:299
void setFstat2Recorders(age_t AGE)
Definition: ttneutralgenes.cc:2117
double _fix_loc_global
Definition: ttneutralgenes.h:295
double _htnei
Definition: ttneutralgenes.h:294
unsigned int _table_set_repl
Definition: ttneutralgenes.h:283
DataTable< double > _alleleFreqTable
Definition: ttneutralgenes.h:280
void setFstat2(age_t AGE)
New version of Nei & Chesser.
Definition: stats_fstat.cc:482
double _fst_WH
Weir & Hill (2002) F-stat estimates.
Definition: ttneutralgenes.h:297
Microsatellites genome.
Definition: ttneutralgenes.h:54
void set_allele(unsigned int loc, unsigned int al, unsigned char val)
Definition: ttneutralgenes.h:107
virtual bool operator!=(const TTrait &T)
Definition: ttneutralgenes.cc:517
void set_proto(TProtoNeutralGenes *proto)
Definition: ttneutralgenes.h:95
void set_mut_model(int value)
Definition: ttneutralgenes.h:101
virtual bool retrieve_data(BinaryStorageBuffer *reader)
Definition: ttneutralgenes.h:149
virtual void reset()
Definition: ttneutralgenes.cc:592
void mutate_SSM()
Definition: ttneutralgenes.cc:642
void set_2L(unsigned int val)
Definition: ttneutralgenes.h:99
void set_inherit_func_ptr(void(TProtoNeutralGenes::*theFunc)(sex_t, unsigned char *, unsigned char **))
Definition: ttneutralgenes.h:105
unsigned short _init_model
Definition: ttneutralgenes.h:65
void(TProtoNeutralGenes::* _inherit_func_ptr)(sex_t, unsigned char *, unsigned char **)
Definition: ttneutralgenes.h:67
void set_allele_num(int value)
Definition: ttneutralgenes.h:97
unsigned int get_ploidy()
Definition: ttneutralgenes.h:91
unsigned int get_locus_num()
Definition: ttneutralgenes.h:92
TProtoNeutralGenes * _myProto
Definition: ttneutralgenes.h:56
unsigned int get_allele_num()
Definition: ttneutralgenes.h:93
unsigned int _locus_num
Definition: ttneutralgenes.h:59
virtual void * set_trait(void *value)
Definition: ttneutralgenes.h:127
void(TTNeutralGenes::* _mutate_func_ptr)(void)
Definition: ttneutralgenes.h:66
virtual TTNeutralGenes & operator=(const TTrait &T)
Definition: ttneutralgenes.cc:477
virtual void set_allele_value(unsigned int locus, unsigned int allele, double value)
Definition: ttneutralgenes.h:131
virtual bool operator==(const TTrait &T)
Definition: ttneutralgenes.cc:502
virtual void init_sequence()
Definition: ttneutralgenes.cc:557
void mutate_2all()
Definition: ttneutralgenes.cc:684
virtual void set_value()
Definition: ttneutralgenes.h:135
void set_mut_func_ptr(void(TTNeutralGenes::*theFunc)(void))
Definition: ttneutralgenes.h:103
double _recomb_rate
Definition: ttneutralgenes.h:62
virtual void inherit(TTrait *mother, TTrait *father)
Definition: ttneutralgenes.cc:630
const trait_t _type
Definition: ttneutralgenes.h:72
unsigned int _mut_model
Definition: ttneutralgenes.h:63
virtual void set_sequence(void **seq)
Definition: ttneutralgenes.cc:606
virtual trait_t get_type() const
Definition: ttneutralgenes.h:134
unsigned int _allele_num
Definition: ttneutralgenes.h:58
double _mut_rate
Definition: ttneutralgenes.h:61
void set_init_model(unsigned short val)
Definition: ttneutralgenes.h:102
unsigned char ** _sequence
Definition: ttneutralgenes.h:70
virtual ~TTNeutralGenes()
Definition: ttneutralgenes.cc:527
void set_mut_rate(double value)
Definition: ttneutralgenes.h:98
void set_recomb_rate(double value)
Definition: ttneutralgenes.h:100
virtual void store_data(BinaryStorageBuffer *saver)
Definition: ttneutralgenes.h:143
virtual void * getValue() const
Definition: ttneutralgenes.h:136
void mutate_NULL()
Definition: ttneutralgenes.h:117
virtual void mutate()
Definition: ttneutralgenes.h:138
TTNeutralGenes()
Definition: ttneutralgenes.h:76
virtual void show_up()
Definition: ttneutralgenes.cc:615
virtual double get_allele_value(int loc, int all)
Definition: ttneutralgenes.h:129
void mutate_KAM()
Definition: ttneutralgenes.cc:665
virtual void init()
Definition: ttneutralgenes.cc:538
void set_locus_num(int value)
Definition: ttneutralgenes.h:96
TTNeutralGenes(const TTNeutralGenes &T)
Definition: ttneutralgenes.h:80
virtual void ** get_sequence() const
Definition: ttneutralgenes.h:128
virtual TTNeutralGenes * clone()
Definition: ttneutralgenes.h:140
unsigned int _ploidy
Definition: ttneutralgenes.h:60
unsigned int _2L
Definition: ttneutralgenes.h:64
TTProtoWithMap.
Definition: ttrait_with_map.h:176
virtual void reset()
Definition: ttrait_with_map.cc:611
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
std::string trait_t
Trait types.
Definition: types.h:63
#define NTRL
Definition: types.h:70
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
@ OFFSx
Definition: types.h:42
@ ADLTx
Definition: types.h:42

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