Nemo
2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
|
The stat handler for neutral markers. More...
#include <ttneutralgenes.h>
Public Member Functions | |
TTNeutralGenesSH (TProtoNeutralGenes *TP) | |
virtual | ~TTNeutralGenesSH () |
virtual void | init () |
virtual bool | setStatRecorders (std::string &token) |
void | setFreqRecorders (age_t AGE) |
void | setFreqRecordersPerPatch (age_t AGE) |
void | setFstatRecorders (age_t AGE) |
void | setFstat2Recorders (age_t AGE) |
void | setFstatWCRecorders (age_t AGE) |
void | setCoaMatrixRecorders (age_t AGE, unsigned char dim) |
void | setFstMatrixRecorders (age_t AGE, unsigned char dim) |
void | setNeiGeneticDistanceRecorders (age_t AGE, bool pairwise) |
void | setDxyRecorders (age_t AGE, bool patchwise) |
Allele and genotype frequencies: | |
void | setAdultAlleleFreq () |
void | setOffspringAlleleFreq () |
void | setHeterozygosity (age_t AGE) |
void | setAdultHeterozygosity () |
void | setOffspringHeterozygosity () |
double | getGlobalAlleleFreq (unsigned int loc, unsigned int all) |
double | getHeterozygosity (unsigned int loc) |
F-stats: | |
void | setAlleleTables (age_t AGE) |
void | setHeteroTable (age_t AGE) |
void | allocateTables (unsigned int loci, unsigned int all) |
DataTable< double > * | getAlleleFreqTable () |
Accessor to the table of allele frequencies, per patch. More... | |
DataTable< unsigned int > * | getAlleleCountTable () |
DataTable< double > * | getHeteroTable () |
TMatrix * | getGlobalFreqs () |
Accessor to the table of allele frequencies in the whole population. More... | |
void | setFstMatrix (age_t AGE, unsigned char dim) |
Computes the weighted within and between patch Fst's as well as the overall Fst (Theta). More... | |
void | setAdultsFstMatrix () |
void | setAdultsFstWithin () |
void | setAdultsFstBetween () |
void | setOffsprgFstMatrix () |
void | setOffsprgFstWithin () |
void | setOffsprgFstBetween () |
double | getWeightedFst () |
Returns the weighted Fst using Weir & Hill (2002) method. More... | |
double | getFst_ij (unsigned int i) |
Accessor to the Fst matrix as set by setFstMatrix(). More... | |
void | setFst_li (unsigned int N, unsigned int L, double **array) |
Computes the per-locus per-patch Fst values using Weir&Hill 2002 approach. More... | |
void | setFstat (age_t AGE) |
Computes the F-statistics following Nei & Chesser (1983). More... | |
void | setOffsprgFstat () |
void | setAdultsFstat () |
double | setHo (age_idx age_pos) |
double | setHs (age_idx age_pos) |
double | setHt (age_idx age_pos) |
double | getHsnei () |
double | getHtnei () |
double | getHo () |
double | getHs () |
double | getHt () |
double | getFst () |
double | getFis () |
double | getFit () |
void | setFstat2 (age_t AGE) |
New version of Nei & Chesser. More... | |
void | setOffsprgFstat2 () |
void | setAdultsFstat2 () |
deque< double > | setHo2 (age_idx age_pos) |
deque< double > | setHs2 (age_idx age_pos) |
deque< double > | setHt2 (age_idx age_pos) |
void | setFstatWeirCockerham (age_t AGE) |
Computes the Weir & Cockerham (1984) Fstat values (Theta, F, and f). More... | |
void | setFstatWeirCockerham_MS (age_t AGE) |
void | setOffspringFstatWeirCockerham () |
void | setAdultsFstatWeirCockerham () |
double | getFstWC () |
double | getFisWC () |
double | getFitWC () |
void | setLociDivCounter (age_t AGE) |
Sets the allelic diversity counters. More... | |
double | getNbAllLocal () |
double | getNbAllGlobal () |
double | getFixLocLocal () |
double | getFixLocGlobal () |
Coancestries | |
double | Coancestry (void **ind1, void **ind2, unsigned int nb_locus) |
Gives the coancestry (probability of identity by state) of two gene sequences. More... | |
void | setCoaMatrix (age_idx age_pos, unsigned char dim) |
Computes the within and between patches coancestry coefficients. More... | |
void | setAdultsCoaMatrix () |
void | setOffsprgCoaMatrix () |
void | setAdultsCoaWithin () |
void | setOffsprgCoaWithin () |
void | setAdultsCoaBetween () |
void | setOffsprgCoaBetween () |
void | setAdults_Theta () |
double | getCoa (unsigned int i) |
Gets the given coancestry coefficient from the coancestry matrix. More... | |
double | getMeanTheta () |
double | getMeanAlpha () |
double | getTheta_FF () |
Gives the mean within females coancestry coefficient. More... | |
double | getTheta_MM () |
Gives the mean within males coancestry coefficient. More... | |
double | getTheta_FM () |
Gives the mean between males and females coancestry coefficient. More... | |
void | setSibStats () |
void | setSibCoa (Individual *I1, Individual *I2) |
double | getSibProportions (unsigned int i) |
double | getSibCoaMeans (unsigned int i) |
Nei's genetic distance: | |
void | setAdltNeiGeneticDistance () |
void | setOffsprgNeiGeneticDistance () |
void | setNeiGeneticDistance (age_t AGE) |
double | getNeiGeneticDistance (unsigned int i) |
double | getMeanNeiGeneticDistance () |
Sequence divergence: Dxy (Nei & Li 1979; Nei 1987) | |
double | getDxyOffspringPerPatch (unsigned int patch1, unsigned patch2) |
double | getDxyAdultPerPatch (unsigned int patch1, unsigned patch2) |
double | getDxyPerPatch (age_idx age, unsigned int patch1, unsigned patch2) |
double | getDxy (unsigned int age_class) |
Public Member Functions inherited from TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH > | |
TraitStatHandler (TProtoNeutralGenes *trait_proto) | |
virtual | ~TraitStatHandler () |
Public Member Functions inherited from StatHandler< SH > | |
StatHandler () | |
virtual | ~StatHandler () |
virtual void | clear () |
Empties the _recorders list, they are destroyed in StatHandlerBase::reset(). More... | |
virtual StatRecorder< SH > * | add (std::string Title, std::string Name, age_t AGE, unsigned int ARG1, unsigned int ARG2, double(SH::*getStatNoArg)(void), double(SH::*getStatOneArg)(unsigned int), double(SH::*getStatTwoArg)(unsigned int, unsigned int), void(SH::*setStat)(void)) |
Adds a StatRecorder to the list, it is also added to the StatHandlerBase::_stats list. More... | |
Public Member Functions inherited from StatHandlerBase | |
StatHandlerBase () | |
virtual | ~StatHandlerBase () |
virtual void | reset () |
Empties the _stats list and calls clear() (defined in the derived class). More... | |
Metapop * | get_pop_ptr () |
void | set_service (StatServices *srv) |
StatServices * | get_service () |
unsigned int | getOccurrence () |
unsigned int | getNumOccurrences () |
unsigned int | getCurrentOccurrence () |
unsigned int | getNbRecorders () |
std::list< StatRecBase * > & | getStats () |
virtual void | add (StatRecBase *rec) |
virtual void | update () |
This function is left empty as the StatServices calls StatRecorder::setVal directly. More... | |
Public Member Functions inherited from Handler | |
virtual void | init ()=0 |
Inits state. More... | |
virtual void | update ()=0 |
Updates the handler state. More... | |
virtual | ~Handler () |
Private Attributes | |
DataTable< unsigned int > | _alleleCountTable |
DataTable< double > | _alleleFreqTable |
DataTable< double > | _heteroTable |
TMatrix | _globalAlleleFreq |
unsigned int | _table_set_gen |
unsigned int | _table_set_age |
unsigned int | _table_set_repl |
double | Theta_FF |
double | Theta_MM |
double | Theta_FM |
double | _mean_theta |
double | _mean_alpha |
TMatrix * | _coa_matrix |
double | _sib_prop [4] |
Kinship classes proportions. More... | |
double | _sib_coa [4] |
double | _ho |
F-statistics. More... | |
double | _hs |
double | _ht |
double | _hsnei |
double | _htnei |
double | _nb_all_local |
double | _nb_all_global |
double | _fst |
double | _fis |
double | _fit |
double | _fix_loc_local |
double | _fix_loc_global |
double | _fst_WH |
Weir & Hill (2002) F-stat estimates. More... | |
double | _fst_WC |
Weir & Cockerham (1984) F-stat estimates. More... | |
double | _fis_WC |
double | _fit_WC |
double * | _fst_WC_loc |
Per-locus F-stats (Weir&Cockerham). More... | |
double * | _fis_WC_loc |
double * | _fit_WC_loc |
double | _fst_W1 |
double | _fst_W2 |
TMatrix * | _fst_matrix |
Pairwise Fst matrix. More... | |
TMatrix * | _D |
double | _meanD |
Additional Inherited Members | |
Protected Types inherited from StatHandler< SH > | |
typedef std::list< StatRecorder< SH > * >::iterator | REC_IT |
Protected Attributes inherited from TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH > | |
TProtoNeutralGenes * | _SHLinkedTrait |
Pointer to a TraitProtoype object. More... | |
int | _SHLinkedTraitIndex |
Index of the trait in the Individual::Traits table. More... | |
Protected Attributes inherited from StatHandler< SH > | |
std::list< StatRecorder< SH > * > | _recorders |
The list of stat recorders. More... | |
Protected Attributes inherited from StatHandlerBase | |
Metapop * | _pop |
Link to the current population, set through the link to the StatService. More... | |
The stat handler for neutral markers.
|
inline |
|
inlinevirtual |
References _coa_matrix, _D, _fis_WC_loc, _fit_WC_loc, _fst_matrix, and _fst_WC_loc.
References _alleleCountTable, _alleleFreqTable, _globalAlleleFreq, StatHandlerBase::_pop, _table_set_age, _table_set_gen, _table_set_repl, DataTable< T >::allocate(), Metapop::getPatchNbr(), NONE, and TMatrix::reset().
Referenced by init(), setAlleleTables(), setFstat(), setFstat2(), TTNeutralGenesFH::write_Fst_i(), and TTNeutralGenesFH::write_varcompWC().
double TTNeutralGenesSH::Coancestry | ( | void ** | ind1, |
void ** | ind2, | ||
unsigned int | nb_locus | ||
) |
Gives the coancestry (probability of identity by state) of two gene sequences.
The probability returned is the average probability of having two identical alleles at a locus between the two sequences.
ind1 | first _sequence, treated as of type (unsigned char**) |
ind2 | second _sequence, treated as of type (unsigned char**) |
nb_locus | number of loci present in each _sequence |
Referenced by setAdults_Theta(), setCoaMatrix(), and setSibCoa().
References _alleleCountTable.
Referenced by TTNeutralGenesFH::write_varcompWC().
|
inline |
Accessor to the table of allele frequencies, per patch.
References _alleleFreqTable.
Referenced by TTNeutralGenesFH::write_varcompWC().
|
inline |
Gets the given coancestry coefficient from the coancestry matrix.
i | combination of the row and column indexes (see setCoaMatrixRecorders()). |
References _coa_matrix, TMatrix::get(), and TMatrix::getNbCols().
Referenced by setCoaMatrixRecorders().
double TTNeutralGenesSH::getDxy | ( | unsigned int | age_class | ) |
References StatHandlerBase::_pop, ADULTS, getDxyPerPatch(), Metapop::getPatchNbr(), OFFSPRG, OFFSx, and Metapop::size().
Referenced by setDxyRecorders().
|
inline |
References ADLTx, and getDxyPerPatch().
Referenced by setDxyRecorders().
|
inline |
References getDxyPerPatch(), and OFFSx.
Referenced by setDxyRecorders().
References StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTraitIndex, FEM, Patch::get(), TProtoNeutralGenes::get_locus_num(), TTrait::get_sequence(), Metapop::getPatchPtr(), Individual::getTrait(), MAL, and Patch::size().
Referenced by getDxy(), getDxyAdultPerPatch(), and getDxyOffspringPerPatch().
|
inline |
|
inline |
References _fis_WC.
Referenced by setFstatWCRecorders().
|
inline |
|
inline |
References _fit_WC.
Referenced by setFstatWCRecorders().
|
inline |
References _fix_loc_global.
Referenced by setFstatRecorders().
|
inline |
References _fix_loc_local.
Referenced by setFstatRecorders().
|
inline |
References _fst.
Referenced by setFstat2Recorders(), and setFstatRecorders().
|
inline |
Accessor to the Fst matrix as set by setFstMatrix().
References _fst_matrix, TMatrix::get(), and TMatrix::getNbCols().
Referenced by setFstMatrixRecorders().
|
inline |
References _fst_WC.
Referenced by setFstatWCRecorders().
References _globalAlleleFreq, and TMatrix::get().
Referenced by setFreqRecorders().
|
inline |
Accessor to the table of allele frequencies in the whole population.
References _globalAlleleFreq.
Referenced by TTNeutralGenesFH::write_varcompWC().
|
inline |
References _heteroTable.
Referenced by TTNeutralGenesFH::write_varcompWC().
|
inline |
References _heteroTable, DataTable< T >::get(), and DataTable< T >::getNumGroups().
Referenced by setFreqRecorders().
|
inline |
References _ho.
Referenced by setFstat2Recorders(), and setFstatRecorders().
|
inline |
References _hs.
|
inline |
References _hsnei.
Referenced by setFstat2Recorders(), and setFstatRecorders().
|
inline |
References _ht.
|
inline |
References _htnei.
Referenced by setFstat2Recorders(), and setFstatRecorders().
|
inline |
References _mean_alpha.
Referenced by setCoaMatrixRecorders(), and setStatRecorders().
|
inline |
References _meanD.
Referenced by setNeiGeneticDistanceRecorders().
|
inline |
References _mean_theta.
Referenced by setCoaMatrixRecorders(), and setStatRecorders().
|
inline |
References _nb_all_global.
Referenced by setFstatRecorders().
|
inline |
References _nb_all_local.
Referenced by setFstatRecorders().
|
inline |
References _D, TMatrix::get(), and TMatrix::getNbCols().
Referenced by setNeiGeneticDistanceRecorders().
|
inline |
|
inline |
References _sib_prop.
Referenced by setStatRecorders().
|
inline |
Gives the mean within females coancestry coefficient.
References Theta_FF.
Referenced by setStatRecorders().
|
inline |
Gives the mean between males and females coancestry coefficient.
References Theta_FM.
Referenced by setStatRecorders().
|
inline |
Gives the mean within males coancestry coefficient.
References Theta_MM.
Referenced by setStatRecorders().
|
inline |
Returns the weighted Fst using Weir & Hill (2002) method.
This Fst is set by a previous call to setFstMatrix().
References _fst_WH.
Referenced by setFstMatrixRecorders().
|
virtual |
Reimplemented from StatHandlerBase.
References TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, allocateTables(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), and Handler::init().
|
inline |
References ADULTS, and setNeiGeneticDistance().
Referenced by setNeiGeneticDistanceRecorders().
|
inline |
References ADULTS, and setAlleleTables().
Referenced by setFreqRecorders().
|
inline |
References ADULTS, and setHeterozygosity().
Referenced by setFreqRecorders().
void TTNeutralGenesSH::setAdults_Theta | ( | ) |
References _mean_theta, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTraitIndex, ADLTx, Coancestry(), FEM, Patch::get(), TProtoNeutralGenes::get_locus_num(), TTrait::get_sequence(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getTrait(), MAL, Patch::size(), Theta_FF, Theta_FM, and Theta_MM.
Referenced by setStatRecorders().
|
inline |
References ADLTx, and setCoaMatrix().
Referenced by setCoaMatrixRecorders(), and setStatRecorders().
|
inline |
References ADLTx, and setCoaMatrix().
Referenced by setCoaMatrixRecorders(), and setStatRecorders().
|
inline |
References ADLTx, and setCoaMatrix().
Referenced by setCoaMatrixRecorders(), and setStatRecorders().
|
inline |
References ADULTS, and setFstat().
Referenced by setFstatRecorders().
|
inline |
References ADULTS, and setFstat2().
Referenced by setFstat2Recorders().
|
inline |
References ADULTS, and setFstatWeirCockerham().
Referenced by setFstatWCRecorders().
|
inline |
References ADULTS, and setFstMatrix().
Referenced by setFstMatrixRecorders().
|
inline |
References ADULTS, and setFstMatrix().
Referenced by setFstMatrixRecorders().
|
inline |
References ADULTS, and setFstMatrix().
Referenced by setFstMatrixRecorders().
void TTNeutralGenesSH::setAlleleTables | ( | age_t | AGE | ) |
References _alleleCountTable, _alleleFreqTable, _globalAlleleFreq, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTraitIndex, _table_set_age, _table_set_gen, _table_set_repl, ADLTx, ADULTS, allocateTables(), TMatrix::assign(), TMatrix::divide(), FEM, Patch::get(), DataTable< T >::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), TTrait::get_sequence(), Metapop::getCurrentGeneration(), Metapop::getCurrentReplicate(), DataTable< T >::getNumGroups(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getTrait(), DataTable< T >::increment(), DataTable< T >::init(), MAL, OFFSx, TMatrix::plus(), DataTable< T >::set(), Metapop::size(), and Patch::size().
Referenced by setAdultAlleleFreq(), setFst_li(), setFstat(), setFstat2(), setFstatWeirCockerham(), setFstatWeirCockerham_MS(), setFstMatrix(), setNeiGeneticDistance(), setOffspringAlleleFreq(), and TTNeutralGenesFH::write_varcompWC().
void TTNeutralGenesSH::setCoaMatrix | ( | age_idx | age_pos, |
unsigned char | dim | ||
) |
Computes the within and between patches coancestry coefficients.
age_pos | the age class index |
dim | the dimension of the matrix to fill:
|
References _coa_matrix, _mean_alpha, _mean_theta, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTraitIndex, TMatrix::assign(), Coancestry(), TMatrix::divide(), FEM, Patch::get(), TMatrix::get(), TProtoNeutralGenes::get_locus_num(), TTrait::get_sequence(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getTrait(), TMatrix::length(), MAL, TMatrix::plus(), TMatrix::reset(), and Patch::size().
Referenced by setAdultsCoaBetween(), setAdultsCoaMatrix(), setAdultsCoaWithin(), setOffsprgCoaBetween(), setOffsprgCoaMatrix(), and setOffsprgCoaWithin().
void TTNeutralGenesSH::setCoaMatrixRecorders | ( | age_t | AGE, |
unsigned char | dim | ||
) |
References StatHandlerBase::_pop, StatHandler< SH >::add(), ADULTS, getCoa(), getMeanAlpha(), getMeanTheta(), Metapop::getPatchNbr(), setAdultsCoaBetween(), setAdultsCoaMatrix(), setAdultsCoaWithin(), setOffsprgCoaBetween(), setOffsprgCoaMatrix(), and setOffsprgCoaWithin().
Referenced by setStatRecorders().
void TTNeutralGenesSH::setDxyRecorders | ( | age_t | AGE, |
bool | patchwise | ||
) |
References StatHandlerBase::_pop, StatHandler< SH >::add(), ADLTx, getDxy(), getDxyAdultPerPatch(), getDxyOffspringPerPatch(), Metapop::getPatchNbr(), tstring::int2str(), OFFSPRG, and OFFSx.
Referenced by setStatRecorders().
void TTNeutralGenesSH::setFreqRecorders | ( | age_t | AGE | ) |
References TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, StatHandler< SH >::add(), ADULTS, TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), getGlobalAlleleFreq(), getHeterozygosity(), tstring::int2str(), OFFSPRG, setAdultAlleleFreq(), setAdultHeterozygosity(), setOffspringAlleleFreq(), and setOffspringHeterozygosity().
Referenced by setStatRecorders().
void TTNeutralGenesSH::setFreqRecordersPerPatch | ( | age_t | AGE | ) |
Computes the per-locus per-patch Fst values using Weir&Hill 2002 approach.
References _alleleFreqTable, _globalAlleleFreq, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, ADULTS, DataTable< T >::get(), TMatrix::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), Metapop::getPatchNbr(), setAlleleTables(), and Metapop::size().
Referenced by TTNeutralGenesFH::write_Fst_i().
void TTNeutralGenesSH::setFstat | ( | age_t | AGE | ) |
Computes the F-statistics following Nei & Chesser (1983).
References _alleleCountTable, _fis, _fit, _fst, _ho, _hs, _hsnei, _ht, _htnei, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, ADLTx, ADULTS, allocateTables(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), DataTable< T >::getNumGroups(), Metapop::getPatchNbr(), OFFSx, setAlleleTables(), setHo(), setHs(), setHt(), setLociDivCounter(), and Metapop::size().
Referenced by setAdultsFstat(), and setOffsprgFstat().
void TTNeutralGenesSH::setFstat2 | ( | age_t | AGE | ) |
New version of Nei & Chesser.
References _alleleCountTable, _fis, _fit, _fst, _ho, _hsnei, _htnei, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, ADLTx, ADULTS, allocateTables(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), DataTable< T >::getNumGroups(), Metapop::getPatchNbr(), OFFSx, setAlleleTables(), setHo2(), setHs2(), setHt2(), setLociDivCounter(), and Metapop::size().
Referenced by setAdultsFstat2(), and setOffsprgFstat2().
void TTNeutralGenesSH::setFstat2Recorders | ( | age_t | AGE | ) |
References StatHandler< SH >::add(), ADULTS, getFst(), getHo(), getHsnei(), getHtnei(), OFFSPRG, setAdultsFstat2(), and setOffsprgFstat2().
Referenced by setStatRecorders().
void TTNeutralGenesSH::setFstatRecorders | ( | age_t | AGE | ) |
References StatHandler< SH >::add(), ADULTS, getFis(), getFit(), getFixLocGlobal(), getFixLocLocal(), getFst(), getHo(), getHsnei(), getHtnei(), getNbAllGlobal(), getNbAllLocal(), OFFSPRG, setAdultsFstat(), and setOffsprgFstat().
Referenced by setStatRecorders().
void TTNeutralGenesSH::setFstatWCRecorders | ( | age_t | AGE | ) |
References StatHandler< SH >::add(), ADULTS, getFisWC(), getFitWC(), getFstWC(), OFFSPRG, setAdultsFstatWeirCockerham(), and setOffspringFstatWeirCockerham().
Referenced by setStatRecorders().
void TTNeutralGenesSH::setFstatWeirCockerham | ( | age_t | AGE | ) |
Computes the Weir & Cockerham (1984) Fstat values (Theta, F, and f).
References _alleleFreqTable, _fis_WC, _fit_WC, _fst_WC, _globalAlleleFreq, _heteroTable, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, DataTable< T >::get(), TMatrix::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), Metapop::getPatchNbr(), setAlleleTables(), setHeteroTable(), and Metapop::size().
Referenced by setAdultsFstatWeirCockerham(), and setOffspringFstatWeirCockerham().
void TTNeutralGenesSH::setFstatWeirCockerham_MS | ( | age_t | AGE | ) |
Computes W&C F-stats using the Mean Squares approach, similar to the implementation in Hierfstat. This code gives the exact same results as the other version.
References _alleleCountTable, _alleleFreqTable, _fis_WC, _fis_WC_loc, _fit_WC, _fit_WC_loc, _fst_WC, _fst_WC_loc, _globalAlleleFreq, _heteroTable, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, DataTable< T >::get(), TMatrix::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), Metapop::getPatchNbr(), setAlleleTables(), setHeteroTable(), and Metapop::size().
void TTNeutralGenesSH::setFstMatrix | ( | age_t | AGE, |
unsigned char | dim | ||
) |
Computes the weighted within and between patch Fst's as well as the overall Fst (Theta).
The method used here is that of Weir & Hill 2002, Ann. Rev. Genet. 36:721-750. The weighting is done for samples (patches) of unequal sizes.
AGE | the age class |
dim | the dimension of the matrix to fill:
|
References _alleleFreqTable, _fst_matrix, _fst_WH, _globalAlleleFreq, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TMatrix::assign(), DataTable< T >::get(), TMatrix::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), Metapop::getPatchNbr(), TMatrix::length(), TMatrix::reset(), TMatrix::set(), setAlleleTables(), and Metapop::size().
Referenced by setAdultsFstBetween(), setAdultsFstMatrix(), setAdultsFstWithin(), setOffsprgFstBetween(), setOffsprgFstMatrix(), and setOffsprgFstWithin().
void TTNeutralGenesSH::setFstMatrixRecorders | ( | age_t | AGE, |
unsigned char | dim | ||
) |
References StatHandlerBase::_pop, StatHandler< SH >::add(), ADULTS, getFst_ij(), Metapop::getPatchNbr(), getWeightedFst(), setAdultsFstBetween(), setAdultsFstMatrix(), setAdultsFstWithin(), setOffsprgFstBetween(), setOffsprgFstMatrix(), and setOffsprgFstWithin().
Referenced by setStatRecorders().
void TTNeutralGenesSH::setHeteroTable | ( | age_t | AGE | ) |
References _heteroTable, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTraitIndex, ADLTx, ADULTS, FEM, Patch::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), TTrait::get_sequence(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getTrait(), DataTable< T >::init(), MAL, OFFSx, DataTable< T >::plus(), Patch::size(), and DataTable< T >::update().
Referenced by setFstatWeirCockerham(), setFstatWeirCockerham_MS(), setHeterozygosity(), and TTNeutralGenesFH::write_varcompWC().
void TTNeutralGenesSH::setHeterozygosity | ( | age_t | AGE | ) |
References _heteroTable, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, ADLTx, ADULTS, DataTable< T >::divide(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), Metapop::getPatch(), Metapop::getPatchNbr(), OFFSx, setHeteroTable(), and Patch::size().
Referenced by setAdultHeterozygosity(), and setOffspringHeterozygosity().
double TTNeutralGenesSH::setHo | ( | age_idx | age_pos | ) |
References StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTraitIndex, FEM, Patch::get(), TProtoNeutralGenes::get_locus_num(), TTrait::get_sequence(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getTrait(), MAL, and Patch::size().
Referenced by setFstat().
deque< double > TTNeutralGenesSH::setHo2 | ( | age_idx | age_pos | ) |
References StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTraitIndex, FEM, Patch::get(), TProtoNeutralGenes::get_locus_num(), TTrait::get_sequence(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getTrait(), MAL, Metapop::size(), and Patch::size().
Referenced by setFstat2(), and TTNeutralGenesFH::write_varcompWC().
double TTNeutralGenesSH::setHs | ( | age_idx | age_pos | ) |
References _alleleFreqTable, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, Patch::assign(), DataTable< T >::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), Metapop::getPatch(), Metapop::getPatchNbr(), and Patch::size().
Referenced by setFstat().
deque< double > TTNeutralGenesSH::setHs2 | ( | age_idx | age_pos | ) |
References _alleleFreqTable, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, DataTable< T >::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), Metapop::getPatch(), Metapop::getPatchNbr(), Metapop::size(), and Patch::size().
Referenced by setFstat2().
double TTNeutralGenesSH::setHt | ( | age_idx | age_pos | ) |
References _globalAlleleFreq, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TMatrix::get(), TProtoNeutralGenes::get_allele_num(), and TProtoNeutralGenes::get_locus_num().
Referenced by setFstat().
deque< double > TTNeutralGenesSH::setHt2 | ( | age_idx | age_pos | ) |
References _globalAlleleFreq, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TMatrix::get(), TProtoNeutralGenes::get_allele_num(), and TProtoNeutralGenes::get_locus_num().
Referenced by setFstat2().
void TTNeutralGenesSH::setLociDivCounter | ( | age_t | AGE | ) |
Sets the allelic diversity counters.
References _alleleCountTable, _alleleFreqTable, _fix_loc_global, _fix_loc_local, _globalAlleleFreq, _nb_all_global, _nb_all_local, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, DataTable< T >::get(), TMatrix::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), Metapop::getPatchNbr(), and Metapop::size().
Referenced by setFstat(), and setFstat2().
void TTNeutralGenesSH::setNeiGeneticDistance | ( | age_t | AGE | ) |
References _alleleFreqTable, _D, _meanD, StatHandlerBase::_pop, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TMatrix::assign(), DataTable< T >::get(), TProtoNeutralGenes::get_allele_num(), TProtoNeutralGenes::get_locus_num(), Metapop::getPatchNbr(), TMatrix::length(), TMatrix::reset(), TMatrix::set(), setAlleleTables(), and Metapop::size().
Referenced by setAdltNeiGeneticDistance(), and setOffsprgNeiGeneticDistance().
void TTNeutralGenesSH::setNeiGeneticDistanceRecorders | ( | age_t | AGE, |
bool | pairwise | ||
) |
References StatHandlerBase::_pop, StatHandler< SH >::add(), ADULTS, getMeanNeiGeneticDistance(), getNeiGeneticDistance(), Metapop::getPatchNbr(), tstring::int2str(), setAdltNeiGeneticDistance(), and setOffsprgNeiGeneticDistance().
Referenced by setStatRecorders().
|
inline |
References OFFSx, and setCoaMatrix().
Referenced by setCoaMatrixRecorders(), and setStatRecorders().
|
inline |
References OFFSx, and setCoaMatrix().
Referenced by setCoaMatrixRecorders(), and setStatRecorders().
|
inline |
References OFFSx, and setCoaMatrix().
Referenced by setCoaMatrixRecorders(), and setStatRecorders().
|
inline |
References OFFSPRG, and setFstat().
Referenced by setFstatRecorders().
|
inline |
References OFFSPRG, and setFstat2().
Referenced by setFstat2Recorders().
|
inline |
References OFFSPRG, and setFstMatrix().
Referenced by setFstMatrixRecorders().
|
inline |
References OFFSPRG, and setFstMatrix().
Referenced by setFstMatrixRecorders().
|
inline |
References OFFSPRG, and setFstMatrix().
Referenced by setFstMatrixRecorders().
|
inline |
References OFFSPRG, and setNeiGeneticDistance().
Referenced by setNeiGeneticDistanceRecorders().
|
inline |
References OFFSPRG, and setAlleleTables().
Referenced by setFreqRecorders().
|
inline |
References OFFSPRG, and setFstatWeirCockerham().
Referenced by setFstatWCRecorders().
|
inline |
References OFFSPRG, and setHeterozygosity().
Referenced by setFreqRecorders().
void TTNeutralGenesSH::setSibCoa | ( | Individual * | I1, |
Individual * | I2 | ||
) |
References TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTrait, TraitStatHandler< TProtoNeutralGenes, TTNeutralGenesSH >::_SHLinkedTraitIndex, _sib_coa, _sib_prop, Coancestry(), TProtoNeutralGenes::get_locus_num(), TTrait::get_sequence(), Individual::getFatherID(), Individual::getMotherID(), and Individual::getTrait().
Referenced by setSibStats().
void TTNeutralGenesSH::setSibStats | ( | ) |
References StatHandlerBase::_pop, _sib_coa, _sib_prop, FEM, Patch::get(), Metapop::getPatch(), Metapop::getPatchNbr(), MAL, OFFSx, setSibCoa(), and Patch::size().
Referenced by setStatRecorders().
|
virtual |
Implements StatHandlerBase.
References StatHandler< SH >::add(), ADULTS, ALL, getMeanAlpha(), getMeanTheta(), getSibCoaMeans(), getSibProportions(), getTheta_FF(), getTheta_FM(), getTheta_MM(), message(), OFFSPRG, setAdults_Theta(), setAdultsCoaBetween(), setAdultsCoaMatrix(), setAdultsCoaWithin(), setCoaMatrixRecorders(), setDxyRecorders(), setFreqRecorders(), setFstat2Recorders(), setFstatRecorders(), setFstatWCRecorders(), setFstMatrixRecorders(), setNeiGeneticDistanceRecorders(), setOffsprgCoaBetween(), setOffsprgCoaMatrix(), setOffsprgCoaWithin(), and setSibStats().
Referenced by allocateTables(), getAlleleCountTable(), setAlleleTables(), setFstat(), setFstat2(), setFstatWeirCockerham_MS(), and setLociDivCounter().
|
private |
|
private |
Referenced by getCoa(), setCoaMatrix(), and ~TTNeutralGenesSH().
|
private |
Referenced by getNeiGeneticDistance(), setNeiGeneticDistance(), and ~TTNeutralGenesSH().
|
private |
Referenced by getFis(), setFstat(), and setFstat2().
|
private |
Referenced by getFisWC(), setFstatWeirCockerham(), and setFstatWeirCockerham_MS().
|
private |
Referenced by setFstatWeirCockerham_MS(), and ~TTNeutralGenesSH().
|
private |
Referenced by getFit(), setFstat(), and setFstat2().
|
private |
Referenced by getFitWC(), setFstatWeirCockerham(), and setFstatWeirCockerham_MS().
|
private |
Referenced by setFstatWeirCockerham_MS(), and ~TTNeutralGenesSH().
|
private |
Referenced by getFixLocGlobal(), and setLociDivCounter().
|
private |
Referenced by getFixLocLocal(), and setLociDivCounter().
|
private |
Referenced by getFst(), setFstat(), and setFstat2().
|
private |
Pairwise Fst matrix.
Referenced by getFst_ij(), setFstMatrix(), and ~TTNeutralGenesSH().
|
private |
|
private |
|
private |
Weir & Cockerham (1984) F-stat estimates.
Referenced by getFstWC(), setFstatWeirCockerham(), and setFstatWeirCockerham_MS().
|
private |
Per-locus F-stats (Weir&Cockerham).
Referenced by setFstatWeirCockerham_MS(), and ~TTNeutralGenesSH().
|
private |
Weir & Hill (2002) F-stat estimates.
Referenced by getWeightedFst(), and setFstMatrix().
|
private |
|
private |
|
private |
F-statistics.
Referenced by getHo(), setFstat(), and setFstat2().
|
private |
Referenced by getHs(), and setFstat().
|
private |
Referenced by getHsnei(), setFstat(), and setFstat2().
|
private |
Referenced by getHt(), and setFstat().
|
private |
Referenced by getHtnei(), setFstat(), and setFstat2().
|
private |
Referenced by getMeanAlpha(), and setCoaMatrix().
|
private |
Referenced by getMeanTheta(), setAdults_Theta(), and setCoaMatrix().
|
private |
Referenced by getMeanNeiGeneticDistance(), and setNeiGeneticDistance().
|
private |
Referenced by getNbAllGlobal(), and setLociDivCounter().
|
private |
Referenced by getNbAllLocal(), and setLociDivCounter().
|
private |
Referenced by getSibCoaMeans(), setSibCoa(), and setSibStats().
|
private |
Kinship classes proportions.
Referenced by getSibProportions(), setSibCoa(), and setSibStats().
|
private |
Referenced by allocateTables(), and setAlleleTables().
|
private |
Referenced by allocateTables(), and setAlleleTables().
|
private |
Referenced by allocateTables(), and setAlleleTables().
|
private |
Referenced by getTheta_FF(), and setAdults_Theta().
|
private |
Referenced by getTheta_FM(), and setAdults_Theta().
|
private |
Referenced by getTheta_MM(), and setAdults_Theta().