42 #include <Bpp/Numeric/NumConstants.h> 43 #include <Bpp/Numeric/Prob/BetaDiscreteDistribution.h> 45 #include <Bpp/Text/TextTools.h> 60 throw Exception(
"Bad number of classes for model YNGKP_M7: " + TextTools::toString(nclass));
64 BetaDiscreteDistribution* pbdd =
new BetaDiscreteDistribution(nclass, 2, 2);
66 map<string, DiscreteDistribution*> mpdd;
69 YN98* yn98 =
new YN98(gc, codonFreqs);
76 ParameterList pl =
pmixmodel_->getParameters();
77 for (
size_t i = 0; i < pl.size(); i++)
84 for (
size_t i = 0; i < v.size(); i++)
98 st =
pmixmodel_->getParameterNameWithoutNamespace(it->first);
99 addParameter_(
new Parameter(
"YNGKP_M7." + it->second,
pmixmodel_->getParameterValue(st),
100 pmixmodel_->getParameter(st).hasConstraint() ?
pmixmodel_->getParameter(st).getConstraint()->clone() : 0,
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_),
152 for (
unsigned int i = 0; i <
pmixmodel_->getNumberOfModels(); i++)
const FrequenciesSet * getFrequenciesSet() const
If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0.
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.
virtual void updateMatrices()
YNGKP_M7 & operator=(const YNGKP_M7 &)
Parametrize a set of state frequencies.
const std::vector< int > & getAlphabetStates() const
AbstractBiblioMixedSubstitutionModel & operator=(const AbstractBiblioMixedSubstitutionModel &model)
The Yang and Nielsen (1998) substitution model for codons.
Substitution models defined as a mixture of nested substitution models.
size_t synfrom_
indexes of 2 codons between which the substitution is synonymous, to set a basis to the homogeneizati...
YNGKP_M7(const GeneticCode *gc, FrequenciesSet *codonFreqs, unsigned int nclass)
std::auto_ptr< MixtureOfASubstitutionModel > pmixmodel_
The Yang et al (2000) M7 substitution model for codons.