bpp-phyl3  3.0.0
bpp::AbstractCodonFrequenciesSubstitutionModel Class Referenceabstract

Abstract Class for substitution models on codons parametrized by frequencies. More...

#include <Bpp/Phyl/Model/Codon/AbstractCodonFrequenciesSubstitutionModel.h>

+ Inheritance diagram for bpp::AbstractCodonFrequenciesSubstitutionModel:
+ Collaboration diagram for bpp::AbstractCodonFrequenciesSubstitutionModel:

Public Member Functions

 AbstractCodonFrequenciesSubstitutionModel (std::unique_ptr< CodonFrequencySetInterface > pfreq, const std::string &prefix)
 Build a AbstractCodonFrequenciesSubstitutionModel instance. More...
 
 AbstractCodonFrequenciesSubstitutionModel (const AbstractCodonFrequenciesSubstitutionModel &model)
 
AbstractCodonFrequenciesSubstitutionModeloperator= (const AbstractCodonFrequenciesSubstitutionModel &model)
 
AbstractCodonFrequenciesSubstitutionModelclone () const override
 
virtual ~AbstractCodonFrequenciesSubstitutionModel ()
 
void fireParameterChanged (const ParameterList &parameters) override
 
void setFreq (std::map< int, double > &frequencies) override
 
void setNamespace (const std::string &prefix) override
 
double getCodonsMulRate (size_t, size_t) const override
 Returns the multiplicative rate specific to two codons specified by their number. The respective generator rate is this rate multiplied by the rate defined by the model defined on nucleotides. More...
 
const CodonFrequencySetInterfacecodonFrequencySet () const override
 
const FrequencySetInterfacefrequencySet () const
 
bool hasCodonFrequencySet () const override
 
virtual size_t getNumberOfIndependentParameters () const=0
 
virtual void aliasParameters (const std::string &p1, const std::string &p2)=0
 
virtual void aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose)=0
 
virtual void unaliasParameters (const std::string &p1, const std::string &p2)=0
 
virtual const ParameterListgetIndependentParameters () const=0
 
virtual std::vector< std::string > getAlias (const std::string &name) const=0
 
virtual std::map< std::string, std::string > getAliases () const=0
 
virtual bool hasParameter (const std::string &name) const=0
 
virtual const ParameterListgetParameters () const=0
 
virtual const Parameterparameter (const std::string &name) const=0
 
virtual double getParameterValue (const std::string &name) const=0
 
virtual void setAllParametersValues (const ParameterList &parameters)=0
 
virtual void setParameterValue (const std::string &name, double value)=0
 
virtual void setParametersValues (const ParameterList &parameters)=0
 
virtual bool matchParametersValues (const ParameterList &parameters)=0
 
virtual void removeConstraint (const std::string &name)=0
 
virtual void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0
 
virtual size_t getNumberOfParameters () const=0
 
virtual std::string getNamespace () const=0
 
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const=0
 
bool hasIndependentParameter (const std::string &name) const
 
const ParameterListgetIndependentParameters () const
 
size_t getNumberOfIndependentParameters () const
 
void aliasParameters (const std::string &p1, const std::string &p2)
 
void aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose)
 
void unaliasParameters (const std::string &p1, const std::string &p2)
 
ParameterList getAliasedParameters (const ParameterList &pl) const
 
ParameterList getFromParameters (const ParameterList &pl) const
 
virtual std::vector< std::string > getAlias (const std::string &name) const
 
virtual std::map< std::string, std::string > getAliases () const
 
std::string getFrom (const std::string &name) const
 
bool hasParameter (const std::string &name) const override
 
const ParameterListgetParameters () const override
 
const Parameterparameter (const std::string &name) const override
 
const std::shared_ptr< Parameter > & getParameter (const std::string &name) const
 
double getParameterValue (const std::string &name) const override
 
void setAllParametersValues (const ParameterList &parameters) override
 
void setParameterValue (const std::string &name, double value) override
 
void setParametersValues (const ParameterList &parameters) override
 
bool matchParametersValues (const ParameterList &parameters) override
 
void removeConstraint (const std::string &name) override
 
void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override
 
size_t getNumberOfParameters () const override
 
std::string getNamespace () const override
 
std::string getParameterNameWithoutNamespace (const std::string &name) const override
 

Protected Member Functions

virtual ParameterListgetParameters_ ()=0
 
const std::shared_ptr< Parameter > & getParameter (size_t i) const
 
std::shared_ptr< Parameter > & getParameter (size_t i)
 
void addParameter_ (Parameter *parameter)
 
void addParameters_ (const ParameterList &parameters)
 
void shareParameter_ (const std::shared_ptr< Parameter > &parameter)
 
void shareParameters_ (const ParameterList &parameters)
 
void includeParameters_ (const ParameterList &parameters)
 
void deleteParameter_ (size_t index)
 
void deleteParameter_ (std::string &name)
 
void deleteParameters_ (const std::vector< std::string > &names)
 
void resetParameters_ ()
 
ParametergetParameter_ (const std::string &name)
 
ParametergetParameter_ (size_t index)
 
const ParametergetParameter_ (size_t index) const
 
ParametergetParameterWithNamespace_ (const std::string &name)
 
const ParametergetParameterWithNamespace_ (const std::string &name) const
 
ParameterListgetParameters_ () override
 

Private Attributes

std::unique_ptr< CodonFrequencySetInterfacepfreqset_
 
std::string freqName_
 
ParameterList independentParameters_
 
std::map< std::string, std::shared_ptr< AliasParameterListener > > aliasListenersRegister_
 
ParameterList parameters_
 
std::string prefix_
 

Detailed Description

Abstract Class for substitution models on codons parametrized by frequencies.

This class should be used with models which equilibrium distribution is fixed, and does not depend on the parameters. Otherwise there may be problems of identifiability of the parameters.

Author
Laurent Guéguen

If we denote $F$ the equilibrium frequency, the generator term defined from inherited and inheriting classes, $Q_{ij})$, is multiplied by $F_{j}$.

Definition at line 29 of file AbstractCodonFrequenciesSubstitutionModel.h.

Constructor & Destructor Documentation

◆ AbstractCodonFrequenciesSubstitutionModel() [1/2]

AbstractCodonFrequenciesSubstitutionModel::AbstractCodonFrequenciesSubstitutionModel ( std::unique_ptr< CodonFrequencySetInterface pfreq,
const std::string &  prefix 
)

Build a AbstractCodonFrequenciesSubstitutionModel instance.

Parameters
pfreqpointer to the AbstractFrequencySet equilibrium frequencies. It is owned by the instance.
prefixthe Namespace

Definition at line 12 of file AbstractCodonFrequenciesSubstitutionModel.cpp.

References bpp::AbstractParameterAliasable::addParameters_(), freqName_, and pfreqset_.

Referenced by clone().

◆ AbstractCodonFrequenciesSubstitutionModel() [2/2]

bpp::AbstractCodonFrequenciesSubstitutionModel::AbstractCodonFrequenciesSubstitutionModel ( const AbstractCodonFrequenciesSubstitutionModel model)
inline

Definition at line 49 of file AbstractCodonFrequenciesSubstitutionModel.h.

◆ ~AbstractCodonFrequenciesSubstitutionModel()

AbstractCodonFrequenciesSubstitutionModel::~AbstractCodonFrequenciesSubstitutionModel ( )
virtual

Member Function Documentation

◆ clone()

◆ codonFrequencySet()

◆ fireParameterChanged()

◆ frequencySet()

const FrequencySetInterface& bpp::AbstractCodonFrequenciesSubstitutionModel::frequencySet ( ) const
inline

◆ getCodonsMulRate()

double AbstractCodonFrequenciesSubstitutionModel::getCodonsMulRate ( size_t  ,
size_t   
) const
overridevirtual

Returns the multiplicative rate specific to two codons specified by their number. The respective generator rate is this rate multiplied by the rate defined by the model defined on nucleotides.

Implements bpp::CoreCodonSubstitutionModelInterface.

Reimplemented in bpp::KroneckerCodonDistanceFrequenciesSubstitutionModel, bpp::DFPDistanceFrequenciesSubstitutionModel, and bpp::CodonDistanceFrequenciesSubstitutionModel.

Definition at line 45 of file AbstractCodonFrequenciesSubstitutionModel.cpp.

References pfreqset_.

Referenced by bpp::CodonDistanceFrequenciesSubstitutionModel::getCodonsMulRate(), bpp::DFPDistanceFrequenciesSubstitutionModel::getCodonsMulRate(), and bpp::KroneckerCodonDistanceFrequenciesSubstitutionModel::getCodonsMulRate().

◆ hasCodonFrequencySet()

◆ operator=()

AbstractCodonFrequenciesSubstitutionModel& bpp::AbstractCodonFrequenciesSubstitutionModel::operator= ( const AbstractCodonFrequenciesSubstitutionModel model)
inline

◆ setFreq()

◆ setNamespace()

Member Data Documentation

◆ freqName_

std::string bpp::AbstractCodonFrequenciesSubstitutionModel::freqName_
private

◆ pfreqset_


The documentation for this class was generated from the following files: