5 #ifndef BPP_PHYL_MODEL_RE08_H
6 #define BPP_PHYL_MODEL_RE08_H
68 std::unique_ptr<ReversibleSubstitutionModelInterface>
simpleModel_;
90 std::unique_ptr<ReversibleSubstitutionModelInterface> simpleModel,
127 double Pij_t (
size_t i,
size_t j,
double d)
const override;
128 double dPij_dt (
size_t i,
size_t j,
double d)
const override;
129 double d2Pij_dt2(
size_t i,
size_t j,
double d)
const override;
134 std::string
getName()
const override {
return "RE08"; }
147 void setFreq(std::map<int, double>& frequencies)
override
160 double getInitValue(
size_t i,
int state)
const override;
201 std::unique_ptr<NucleotideReversibleSubstitutionModelInterface> nucleotideModel,
205 RE08(std::move(nucleotideModel), lambda, mu) {}
214 return std::dynamic_pointer_cast<const NucleicAlphabet>(
alphabet_);
245 std::unique_ptr<ProteinReversibleSubstitutionModelInterface> proteinModel,
249 RE08(std::move(proteinModel), lambda, mu) {}
258 return std::dynamic_pointer_cast<const ProteicAlphabet>(
alphabet_);
290 std::unique_ptr<CodonReversibleSubstitutionModelInterface> codonModel,
294 RE08(std::move(codonModel), lambda, mu) {}
328 void setFreq(std::map<int, double>& frequencies)
override
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
Parameter & getParameter_(const std::string &name)
Partial implementation of the ReversibleSubstitutionModel interface.
AbstractSubstitutionModel & operator=(const AbstractSubstitutionModel &model)
std::shared_ptr< const Alphabet > alphabet_
The alphabet relevant to this model.
size_t getNumberOfStates() const override
Get the number of states.
virtual const FrequencySetInterface & frequencySet() const =0
Parametrize a set of state frequencies for codons.
Interface for reversible codon models.
virtual std::shared_ptr< const GeneticCode > getGeneticCode() const =0
virtual double getCodonsMulRate(size_t, size_t) const =0
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
Specialisation interface for rversible nucleotide substitution model.
Specialisation interface for nucleotide substitution model.
virtual double getValue() const
Specialized interface for protein reversible substitution model.
Specialized interface for protein substitution model.
This is a wrapper class of RE08 for codon substitution models.
RE08Codon * clone() const 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 GeneticCode > getGeneticCode() const override
void setFreq(std::map< int, double > &frequencies) override
Set equilibrium frequencies.
const CodonReversibleSubstitutionModelInterface & nestedModel() const
const CodonFrequencySetInterface & codonFrequencySet() const override
size_t getNumberOfStates() const override
Get the number of states.
RE08Codon(std::unique_ptr< CodonReversibleSubstitutionModelInterface > codonModel, double lambda=0.1, double mu=0.1)
Build a new Rivas & Eddy model from a codon substitution model.
bool hasCodonFrequencySet() const override
This is a wrapper class of RE08 for nucleotide substitution models.
RE08Nucleotide * clone() const override
const NucleotideReversibleSubstitutionModelInterface & nestedModel() const
std::shared_ptr< const NucleicAlphabet > getNucleicAlphabet() const override
RE08Nucleotide(std::unique_ptr< NucleotideReversibleSubstitutionModelInterface > nucleotideModel, double lambda=0.1, double mu=0.1)
Build a new Rivas & Eddy model from a nucleotide substitution model.
size_t getNumberOfStates() const override
Get the number of states.
virtual ~RE08Nucleotide()
This is a wrapper class of RE08 for protein substitution models.
size_t getNumberOfStates() const override
Get the number of states.
std::shared_ptr< const ProteicAlphabet > getProteicAlphabet() const override
const ProteinReversibleSubstitutionModelInterface & nestedModel() const
RE08Protein(std::unique_ptr< ProteinReversibleSubstitutionModelInterface > proteinModel, double lambda=0.1, double mu=0.1)
Build a new Rivas & Eddy model from a protein substitution model.
RE08Protein * clone() const override
The Rivas-Eddy substitution model with gap characters.
std::unique_ptr< ReversibleSubstitutionModelInterface > simpleModel_
RE08 * clone() const override
const Matrix< double > & getdPij_dt(double d) const override
RE08 & operator=(const RE08 &model)
RowMatrix< double > simpleExchangeabilities_
double getInitValue(size_t i, int state) const override
double Pij_t(size_t i, size_t j, double d) const override
void setNamespace(const std::string &prefix) override
double d2Pij_dt2(size_t i, size_t j, double d) const override
std::string nestedPrefix_
const ReversibleSubstitutionModelInterface & nestedModel() const
void setFreqFromData(const SequenceDataInterface &data, double pseudoCount=0) override
This method is forwarded to the simple model.
const Matrix< double > & getPij_t(double d) const override
std::string getName() const override
Get the name of the model.
void updateMatrices_() override
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
const Matrix< double > & getd2Pij_dt2(double d) const override
RowMatrix< double > simpleGenerator_
ReversibleSubstitutionModelInterface & nestedModel_()
RE08(std::unique_ptr< ReversibleSubstitutionModelInterface > simpleModel, double lambda=0.1, double mu=0.1)
Build a new Rivas & Eddy model from a standard substitution model.
void fireParameterChanged(const ParameterList ¶meters) override
Tells the model that a parameter value has changed.
void setFreq(std::map< int, double > &frequencies) override
Set equilibrium frequencies.
double dPij_dt(size_t i, size_t j, double d) const override
Interface for reversible substitution models.
virtual void setFreq(std::map< int, double > &frequencies)=0
Set equilibrium frequencies.
Defines the basic types of data flow nodes.