bpp-phyl3
3.0.0
|
Abstract class for modelling of ratios of substitution rates between codons, whatever they are synonymous or not. More...
#include <Bpp/Phyl/Model/Codon/AbstractCodonAAFitnessSubstitutionModel.h>
Public Member Functions | |
AbstractCodonAAFitnessSubstitutionModel (std::shared_ptr< FrequencySetInterface > pfitset, std::shared_ptr< const GeneticCode > pgencode, const std::string &prefix) | |
AbstractCodonAAFitnessSubstitutionModel (const AbstractCodonAAFitnessSubstitutionModel &model) | |
AbstractCodonAAFitnessSubstitutionModel & | operator= (const AbstractCodonAAFitnessSubstitutionModel &model) |
AbstractCodonAAFitnessSubstitutionModel * | clone () const override |
virtual | ~AbstractCodonAAFitnessSubstitutionModel () |
void | fireParameterChanged (const ParameterList ¶meters) override |
void | setFreq (std::map< int, double > &frequencies) override |
const CodonFrequencySetInterface & | codonFrequencySet () const override |
bool | hasCodonFrequencySet () const override |
void | setNamespace (const std::string &prefix) 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 generator rate is this rate multiplied by the rate defined by the model defined on nucleotides. More... | |
const FrequencySetInterface & | aaFitness () const |
std::shared_ptr< const FrequencySetInterface > | getAAFitness () const |
void | addNsParameter () |
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 ParameterList & | getIndependentParameters () 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 ParameterList & | getParameters () const=0 |
virtual const Parameter & | parameter (const std::string &name) const=0 |
virtual double | getParameterValue (const std::string &name) const=0 |
virtual void | setAllParametersValues (const ParameterList ¶meters)=0 |
virtual void | setParameterValue (const std::string &name, double value)=0 |
virtual void | setParametersValues (const ParameterList ¶meters)=0 |
virtual bool | matchParametersValues (const ParameterList ¶meters)=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 ParameterList & | getIndependentParameters () 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 ParameterList & | getParameters () const override |
const Parameter & | parameter (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 ¶meters) override |
void | setParameterValue (const std::string &name, double value) override |
void | setParametersValues (const ParameterList ¶meters) override |
bool | matchParametersValues (const ParameterList ¶meters) 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 ParameterList & | getParameters_ ()=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 ¶meters) |
void | shareParameter_ (const std::shared_ptr< Parameter > ¶meter) |
void | shareParameters_ (const ParameterList ¶meters) |
void | includeParameters_ (const ParameterList ¶meters) |
void | deleteParameter_ (size_t index) |
void | deleteParameter_ (std::string &name) |
void | deleteParameters_ (const std::vector< std::string > &names) |
void | resetParameters_ () |
Parameter & | getParameter_ (const std::string &name) |
Parameter & | getParameter_ (size_t index) |
const Parameter & | getParameter_ (size_t index) const |
Parameter & | getParameterWithNamespace_ (const std::string &name) |
const Parameter & | getParameterWithNamespace_ (const std::string &name) const |
ParameterList & | getParameters_ () override |
Private Attributes | |
std::shared_ptr< FrequencySetInterface > | pfitset_ |
std::shared_ptr< const GeneticCode > | pgencode_ |
std::string | fitName_ |
std::shared_ptr< const StateMapInterface > | stateMap_ |
std::shared_ptr< const StateMapInterface > | protStateMap_ |
double | Ns_ |
The Ns of the model (default: 1), The generator (and all its vectorial components) is independent of the rate, since it should be normalized. More... | |
ParameterList | independentParameters_ |
std::map< std::string, std::shared_ptr< AliasParameterListener > > | aliasListenersRegister_ |
ParameterList | parameters_ |
std::string | prefix_ |
Abstract class for modelling of ratios of substitution rates between codons, whatever they are synonymous or not.
The fitness of an amino acid is a value between 0 and 1 defining the relative advantage of an amino acid, compared to others. If an amino acid has a fitness and another one ( ) has a fitness , the substitution rate from codon to codon is multiplied by
where is a positive Ns coefficient (default value: 1).
The set of fitnesses is implemented through a Protein FrequencySet object. The parameters are named "fit_NameOfTheParameterInTheFrequencySet"
.
Definition at line 38 of file AbstractCodonAAFitnessSubstitutionModel.h.
AbstractCodonAAFitnessSubstitutionModel::AbstractCodonAAFitnessSubstitutionModel | ( | std::shared_ptr< FrequencySetInterface > | pfitset, |
std::shared_ptr< const GeneticCode > | pgencode, | ||
const std::string & | prefix | ||
) |
Definition at line 14 of file AbstractCodonAAFitnessSubstitutionModel.cpp.
References bpp::AbstractParameterAliasable::addParameters_(), fitName_, bpp::AlphabetTools::isProteicAlphabet(), and pfitset_.
Referenced by clone().
|
inline |
Definition at line 66 of file AbstractCodonAAFitnessSubstitutionModel.h.
|
virtual |
Definition at line 30 of file AbstractCodonAAFitnessSubstitutionModel.cpp.
|
inline |
Definition at line 119 of file AbstractCodonAAFitnessSubstitutionModel.h.
References pfitset_.
|
inline |
Definition at line 123 of file AbstractCodonAAFitnessSubstitutionModel.h.
References bpp::AbstractParameterAliasable::addParameter_(), bpp::AbstractParameterAliasable::getNamespace(), and bpp::NumConstants::MILLI().
|
inlineoverridevirtual |
Implements bpp::AbstractParameterAliasable.
Definition at line 89 of file AbstractCodonAAFitnessSubstitutionModel.h.
References AbstractCodonAAFitnessSubstitutionModel().
|
inlineoverridevirtual |
Implements bpp::CoreCodonSubstitutionModelInterface.
Definition at line 101 of file AbstractCodonAAFitnessSubstitutionModel.h.
|
overridevirtual |
Reimplemented from bpp::AbstractParameterAliasable.
Definition at line 33 of file AbstractCodonAAFitnessSubstitutionModel.cpp.
References bpp::AbstractParameterAliasable::fireParameterChanged(), bpp::AbstractParameterAliasable::getParameterValue(), bpp::AbstractParameterAliasable::hasParameter(), Ns_, and pfitset_.
|
inline |
Definition at line 121 of file AbstractCodonAAFitnessSubstitutionModel.h.
References pfitset_.
|
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.
Definition at line 48 of file AbstractCodonAAFitnessSubstitutionModel.cpp.
References bpp::log(), Ns_, pfitset_, pgencode_, bpp::pow(), protStateMap_, and stateMap_.
|
inlineoverridevirtual |
Implements bpp::CoreCodonSubstitutionModelInterface.
Definition at line 106 of file AbstractCodonAAFitnessSubstitutionModel.h.
|
inline |
Definition at line 76 of file AbstractCodonAAFitnessSubstitutionModel.h.
References fitName_, Ns_, bpp::AbstractParameterAliasable::operator=(), pfitset_, pgencode_, protStateMap_, and stateMap_.
|
overridevirtual |
Implements bpp::CoreCodonSubstitutionModelInterface.
Definition at line 42 of file AbstractCodonAAFitnessSubstitutionModel.cpp.
References bpp::AbstractParameterAliasable::matchParametersValues(), and pfitset_.
|
inlineoverridevirtual |
Reimplemented from bpp::AbstractParameterAliasable.
Definition at line 111 of file AbstractCodonAAFitnessSubstitutionModel.h.
References fitName_, pfitset_, and bpp::AbstractParameterAliasable::setNamespace().
|
private |
Definition at line 47 of file AbstractCodonAAFitnessSubstitutionModel.h.
Referenced by AbstractCodonAAFitnessSubstitutionModel(), operator=(), and setNamespace().
|
private |
The Ns of the model (default: 1), The generator (and all its vectorial components) is independent of the rate, since it should be normalized.
Definition at line 58 of file AbstractCodonAAFitnessSubstitutionModel.h.
Referenced by fireParameterChanged(), getCodonsMulRate(), and operator=().
|
private |
Definition at line 43 of file AbstractCodonAAFitnessSubstitutionModel.h.
Referenced by aaFitness(), AbstractCodonAAFitnessSubstitutionModel(), fireParameterChanged(), getAAFitness(), getCodonsMulRate(), operator=(), setFreq(), and setNamespace().
|
private |
Definition at line 45 of file AbstractCodonAAFitnessSubstitutionModel.h.
Referenced by getCodonsMulRate(), and operator=().
|
private |
Definition at line 51 of file AbstractCodonAAFitnessSubstitutionModel.h.
Referenced by getCodonsMulRate(), and operator=().
|
private |
Definition at line 49 of file AbstractCodonAAFitnessSubstitutionModel.h.
Referenced by getCodonsMulRate(), and operator=().