46 const GeneticCode* gCode,
50 const AlphabetIndex2* pdist) :
51 AbstractParameterAliasable(
"CodonDistFitPhasFreq."),
61 const GeneticCode* gCode,
67 const AlphabetIndex2* pdist) :
68 AbstractParameterAliasable(
"CodonDistFitPhasFreq."),
79 return (
"CodonDistFitPhasFreq");
101 AbstractParameterAliasable::setNamespace(st);
103 AbstractCodonDistanceSubstitutionModel::setNamespace(st);
113 map<int, double> freq2;
115 map<int, double>::iterator it;
117 for (it=frequencies.begin();it!=frequencies.end();it++)
119 freq2[it->first]=(freq1[it->first] != 0 ? it->second/freq1[it->first] : 0);
120 s += freq2[it->first];
123 for (it = freq2.begin(); it != freq2.end(); it++)
124 freq2[it->first] /= s;
double getCodonsMulRate(size_t i, size_t j) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
Abstract Class for substitution models on codons parametrized by a frequency.
virtual void fireParameterChanged(const ParameterList ¶meters)
Tells the model that a parameter value has changed.
const FrequenciesSet * getFrequenciesSet() const
If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0.
Parametrize a set of state frequencies.
CodonDistanceFitnessPhaseFrequenciesSubstitutionModel(const GeneticCode *gCode, NucleotideSubstitutionModel *pmod, FrequenciesSet *pfit, FrequenciesSet *pfreq, const AlphabetIndex2 *pdist=0)
Abstract class for modelling of non-synonymous abd synonymous substitution rates in codon models...
std::string getName() const
Get the name of the model.
void fireParameterChanged(const ParameterList ¶meterlist)
Tells the model that a parameter value has changed.
void setNamespace(const std::string &)
Abstract class for modelling of ratios of substitution rates between codons, whatever they are synony...
void setNamespace(const std::string &prefix)
void updateMatrices()
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
void setFreq(std::map< int, double > &frequencies)
Set equilibrium frequencies.
Specialisation interface for nucleotide substitution model.
virtual const std::map< int, double > getAlphabetStatesFrequencies() const =0
void setFreq(std::map< int, double > &frequencies)
Set equilibrium frequencies.
double getCodonsMulRate(size_t i, size_t j) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
void setNamespace(const std::string &prefix)
void fireParameterChanged(const ParameterList ¶meters)
void setFreq(std::map< int, double > &frequencies)
Set equilibrium frequencies.
void setNamespace(const std::string &prefix)
void fireParameterChanged(const ParameterList ¶meters)
Abstract class for substitution models on codons.
double getCodonsMulRate(size_t i, size_t j) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
void fireParameterChanged(const ParameterList ¶meters)
virtual double getCodonsMulRate(size_t i, size_t j) const
Method inherited from CodonSubstitutionModel.
double getCodonsMulRate(size_t, size_t) const
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...