42 #include <Bpp/Numeric/NumConstants.h> 43 #include <Bpp/Numeric/Prob/SimpleDiscreteDistribution.h> 59 vector<double> v1, v2;
60 v1.push_back(0.5); v1.push_back(1);
61 v2.push_back(0.5); v2.push_back(0.5);
63 SimpleDiscreteDistribution* psdd =
new SimpleDiscreteDistribution(v1, v2);
65 map<string, DiscreteDistribution*> mpdd;
68 YN98* yn98 =
new YN98(gc, codonFreqs);
79 for (
size_t i = 0; i < v.size(); i++)
93 st =
pmixmodel_->getParameterNameWithoutNamespace(it->first);
94 if (st !=
"omega_Simple.V1")
96 addParameter_(
new Parameter(
"YNGKP_M1." + it->second,
pmixmodel_->getParameterValue(st),
97 pmixmodel_->getParameter(st).hasConstraint() ?
pmixmodel_->getParameter(st).getConstraint()->clone() : 0,
true));
101 addParameter_(
new Parameter(
"YNGKP_M1.omega", 0.5,
new IntervalConstraint(NumConstants::MILLI(), 1,
true,
false, NumConstants::MILLI()),
true));
108 if (gc->areSynonymous(supportedChars[
synfrom_], supportedChars[
synto_])
117 if (
synto_ == supportedChars.size())
118 throw Exception(
"Impossible to find synonymous codons");
127 synfrom_(mod2.synfrom_),
std::auto_ptr< MixtureOfASubstitutionModel > pmixmodel_
std::map< std::string, std::string > mapParNamesFromPmodel_
Tools to make the link between the Parameters of the object and those of pmixmodel_.
ParameterList lParPmodel_
Abstract class for mixture models based on the bibliography.
YNGKP_M1(const GeneticCode *gc, FrequenciesSet *codonFreqs)
virtual void updateMatrices()
AbstractBiblioSubstitutionModel & operator=(const AbstractBiblioSubstitutionModel &model)
Parametrize a set of state frequencies.
const std::vector< int > & getAlphabetStates() const
The Yang and Nielsen (1998) substitution model for codons.
Substitution models defined as a mixture of nested substitution models.
const FrequenciesSet * getFrequenciesSet() const
If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0.
The Yang et al (2000) M1 substitution model for codons, with the more realistic modification in Wong ...
size_t synfrom_
indexes of 2 codons states between which the substitution is synonymous, to set a basis to the homoge...
YNGKP_M1 & operator=(const YNGKP_M1 &)