41 #include "../FrequenciesSet/NucleotideFrequenciesSet.h" 43 #include <Bpp/Numeric/Matrix/MatrixTools.h> 46 #include <Bpp/Seq/Container/SequenceContainerTools.h> 57 const NucleicAlphabet* alpha,
67 AbstractParameterAliasable(
"GTR."),
69 a_(a), b_(b), c_(c), d_(d), e_(e), piA_(piA), piC_(piC), piG_(piG), piT_(piT), theta_(piG + piC), theta1_(piA / (1. - theta_)), theta2_(piG / theta_), p_()
71 addParameter_(
new Parameter(
"GTR.a", a, &Parameter::R_PLUS_STAR));
72 addParameter_(
new Parameter(
"GTR.b", b, &Parameter::R_PLUS_STAR));
73 addParameter_(
new Parameter(
"GTR.c", c, &Parameter::R_PLUS_STAR));
74 addParameter_(
new Parameter(
"GTR.d", d, &Parameter::R_PLUS_STAR));
75 addParameter_(
new Parameter(
"GTR.e", e, &Parameter::R_PLUS_STAR));
90 a_ = getParameterValue(
"a");
91 b_ = getParameterValue(
"b");
92 c_ = getParameterValue(
"c");
93 d_ = getParameterValue(
"d");
94 e_ = getParameterValue(
"e");
95 theta_ = getParameterValue(
"theta");
96 theta1_ = getParameterValue(
"theta1");
97 theta2_ = getParameterValue(
"theta2");
138 vector<string> thetas(3);
139 thetas[0] = getNamespace() +
"theta";
140 thetas[1] = getNamespace() +
"theta1";
141 thetas[2] = getNamespace() +
"theta2";
142 ParameterList pl = getParameters().subList(thetas);
146 setParametersValues(pl);
RowMatrix< double > exchangeability_
The exchangeability matrix of the model, defined as . When the model is reversible, this matrix is symetric.
This class implements a state map where all resolved states are modeled.
Vdouble freq_
The vector of equilibrium frequencies.
GTR(const NucleicAlphabet *alpha, double a=1., double b=1., double c=1., double d=1., double e=1., double piA=0.25, double piC=0.25, double piG=0.25, double piT=0.25)
virtual void updateMatrices()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Partial implementation of the ReversibleSubstitutionModel interface.
static IntervalConstraint FREQUENCE_CONSTRAINT_SMALL
void setFreq(std::map< int, double > &freqs)
This method is redefined to actualize the corresponding parameters piA, piT, piG and piC too...
void updateMatrices()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...