8 #include "../MixtureOfASubstitutionModel.h"
18 std::shared_ptr<const GeneticCode> gCode,
19 std::unique_ptr<ProteinSubstitutionModelInterface> pAAmodel,
20 std::unique_ptr<CodonFrequencySetInterface> codonFreqs) :
27 mixedSubModelPtr_(nullptr),
33 auto codmodel = make_unique<DFPDistanceFrequenciesSubstitutionModel>(gCode, std::move(codonFreqs));
34 auto submodel = make_unique<CodonSameAARateSubstitutionModel>(std::move(pAAmodel), std::move(codmodel), unique_ptr<CodonFrequencySetInterface>(
nullptr), gCode);
36 map<string, unique_ptr<DiscreteDistributionInterface>> mpdd;
37 vector<double> v1, v2;
38 v1.push_back(0.5); v1.push_back(1);
39 v2.push_back(0.5); v2.push_back(0.5);
40 mpdd[
"DFPDistFreq.beta"] = make_unique<SimpleDiscreteDistribution>(v1, v2);
50 vector<std::string> v =
mixedModelPtr_->getNModel(0)->getParameters().getParameterNames();
54 if (vi !=
"SameAARate.DFPDistFreq.beta")
67 if (st !=
"DFPDistFreq.beta_Simple.V1")
70 mixedModelPtr_->parameter(st).hasConstraint() ? std::shared_ptr<ConstraintInterface>(
mixedModelPtr_->parameter(st).getConstraint()->clone()) : 0));
74 addParameter_(
new Parameter(
"DFP07.omega", 0.5, std::make_shared<IntervalConstraint>(0.002, 1,
true,
false, 0.002)));
81 if (gCode->areSynonymous(supportedChars[
synfrom_], supportedChars[
synto_])
90 if (
synto_ == supportedChars.size())
91 throw Exception(
"Impossible to find synonymous codons");
Abstract class for mixture models based on the bibliography.
const MixedTransitionModelInterface & mixedModel() const
std::unique_ptr< MixedTransitionModelInterface > mixedModelPtr_
Partial implementation of the SubstitutionModel interface for models that are set for matching the bi...
std::map< std::string, std::string > mapParNamesFromPmodel_
Tools to make the link between the Parameters of the object and those of pmixmodel_.
ParameterList lParPmodel_
virtual void updateMatrices_()
void addParameter_(Parameter *parameter)
bool computeFrequencies() const override
const std::vector< int > & getAlphabetStates() const override
Abstract class of Wrapping model class, where all methods are redirected from model().
void updateMatrices_() override
const MixtureOfASubstitutionModel * mixedSubModelPtr_
size_t synfrom_
indexes of 2 codons states between which the substitution is synonymous, to set a basis to the homoge...
DFP07(std::shared_ptr< const GeneticCode > gCode, std::unique_ptr< ProteinSubstitutionModelInterface > pAAmodel, std::unique_ptr< CodonFrequencySetInterface > codonFreqs)
const SubstitutionModelInterface & subNModel(size_t i) const
virtual void addParameters(const ParameterList ¶ms)
virtual double Qij(size_t i, size_t j) const =0
A method for computing all necessary matrices.
Defines the basic types of data flow nodes.
std::vector< double > Vdouble