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); v1.push_back(2);
61 v2.push_back(0.333333); v2.push_back(0.333333); v2.push_back(0.333334);
63 SimpleDiscreteDistribution* psdd =
new SimpleDiscreteDistribution(v1, v2);
65 map<string, DiscreteDistribution*> mpdd;
68 YN98* yn98 =
new YN98(gc, codonFreqs);
75 ParameterList pl =
pmixmodel_->getParameters();
76 for (
size_t i = 0; i < pl.size(); i++)
83 for (
size_t i = 0; i < v.size(); i++)
99 st =
pmixmodel_->getParameterNameWithoutNamespace(it->first);
100 if (it->second.substr(0, 5) !=
"omega")
101 addParameter_(
new Parameter(
"YNGKP_M2." + it->second,
pmixmodel_->getParameterValue(st),
102 pmixmodel_->getParameter(st).hasConstraint() ?
pmixmodel_->getParameter(st).getConstraint()->clone() : 0,
true));
105 addParameter_(
new Parameter(
"YNGKP_M2.omega0", 0.5,
new IntervalConstraint(NumConstants::MILLI(), 1,
true,
false),
true));
107 addParameter_(
new Parameter(
"YNGKP_M2.omega2", 2,
new IntervalConstraint(1, 999,
false,
false, NumConstants::MILLI()),
true));
114 if (gc->areSynonymous(supportedChars[
synfrom_], supportedChars[
synto_])
123 if (
synto_ == supportedChars.size())
124 throw Exception(
"Impossible to find synonymous codons");
133 synfrom_(mod2.synfrom_),
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.
std::auto_ptr< MixtureOfASubstitutionModel > pmixmodel_
virtual void updateMatrices()
Parametrize a set of state frequencies.
const std::vector< int > & getAlphabetStates() const
YNGKP_M2(const GeneticCode *gc, FrequenciesSet *codonFreqs)
size_t synfrom_
indexes of 2 codons between which the substitution is synonymous, to set a basis to the homogeneizati...
AbstractBiblioMixedSubstitutionModel & operator=(const AbstractBiblioMixedSubstitutionModel &model)
The Yang and Nielsen (1998) substitution model for codons.
Substitution models defined as a mixture of nested substitution models.
The Yang et al (2000) M2 substitution model for codons, with the more realistic modification in Wong ...
const FrequenciesSet * getFrequenciesSet() const
If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0.
YNGKP_M2 & operator=(const YNGKP_M2 &)