15 std::shared_ptr<FrequencySetInterface> pfitset,
16 std::shared_ptr<const GeneticCode> pgencode,
17 const string& prefix) :
19 protStateMap_(pfitset->getStateMap()), Ns_(1)
22 throw Exception(
"AbstractCodonAAFitnessSubstitutionModel::AbstractCodonAAFitnessSubstitutionModel need Proteic Fitness.");
39 pfitset_->matchParametersValues(parameters);
44 pfitset_->setFrequenciesFromAlphabetStatesFrequencies(frequencies);
58 if (phi_i == phi_j ||
Ns_ == 0)
67 mu = -(
log(phi_i / phi_j) / (1 - (phi_i / phi_j)));
70 double x =
pow(phi_i / phi_j,
Ns_);
71 mu = -
log(x) / (1 - x);
std::shared_ptr< const GeneticCode > pgencode_
std::shared_ptr< const StateMapInterface > stateMap_
virtual ~AbstractCodonAAFitnessSubstitutionModel()
std::shared_ptr< FrequencySetInterface > pfitset_
void setFreq(std::map< int, double > &frequencies) override
AbstractCodonAAFitnessSubstitutionModel(std::shared_ptr< FrequencySetInterface > pfitset, std::shared_ptr< const GeneticCode > pgencode, const std::string &prefix)
void fireParameterChanged(const ParameterList ¶meters) override
double getCodonsMulRate(size_t i, size_t j) const override
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
std::shared_ptr< const StateMapInterface > protStateMap_
double Ns_
The Ns of the model (default: 1), The generator (and all its vectorial components) is independent of ...
void addParameters_(const ParameterList ¶meters)
virtual void fireParameterChanged(const ParameterList ¶meters)
bool matchParametersValues(const ParameterList ¶meters) override
bool hasParameter(const std::string &name) const override
double getParameterValue(const std::string &name) const override
This class implements a state map where all resolved states are modeled.
Defines the basic types of data flow nodes.
double log(const ExtendedFloat &ef)
ExtendedFloat pow(const ExtendedFloat &ef, double exp)