29 shared_ptr<const ProteicAlphabet> alpha,
38 exch_(model.getName()),
53 ifstream in(file.c_str(), ios::in);
55 for (
unsigned int i = 1; i < 20; ++i)
59 for (
unsigned int j = 0; j < i; ++j)
67 for (
unsigned int i = 0; i < 20; ++i)
70 for (
unsigned int j = 0; j < 20; ++j)
100 vector<double> tmpFreqs;
102 for (
unsigned int i = 0; i < tmpFreqs.size(); ++i)
110 for (
unsigned int i = 0; i < 20; ++i)
112 if (
freq_[i] < 0.001)
126 for (
size_t i = 0; i < 20; i++)
void addParameters_(const ParameterList ¶meters)
void setNamespace(const std::string &prefix)
const Parameter & parameter(const std::string &name) const override
Specialisation abstract class for reversible protein substitution model.
virtual void updateMatrices_() override
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
RowMatrix< double > exchangeability_
The exchangeability matrix of the model, defined as . When the model is reversible,...
Vdouble freq_
The vector of equilibrium frequencies.
This class is the core class inherited by the Coala class. COaLA is a branch-heterogeneous amino-acid...
std::vector< double > colWeights_
std::vector< double > prodMatrixVector(RowMatrix< double > &P, std::vector< double > &V)
ParameterList computeCOA(const SequenceDataInterface &data, double pseudoCount=0, bool param=true)
Comoute COA from data and return the axis position parameters.
void updateMatrices_() override
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
void readFromFile(std::string &file)
void setFreqFromData(const SequenceDataInterface &data, double pseudoCount=0) override
Set equilibrium frequencies equal to the frequencies estimated from the data.
std::string getName() const override
Get the name of the model.
Coala(std::shared_ptr< const ProteicAlphabet > alpha, const ProteinSubstitutionModelInterface &model, unsigned int nbAxes=0, bool param=true)
void computeEquilibriumFrequencies()
Specialized interface for protein substitution model.
const std::string & nextToken()
virtual const Matrix< double > & exchangeabilityMatrix() const =0
double toDouble(const std::string &s, char dec='.', char scientificNotation='e')
std::string toString(T t)
Defines the basic types of data flow nodes.