bpp-phyl3  3.0.0
bpp::AbstractCodonClusterAASubstitutionModel Class Referenceabstract

Abstract class for modelling of non-synonymous and synonymous substitution rates in codon models, with AA clustered. More...

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

+ Inheritance diagram for bpp::AbstractCodonClusterAASubstitutionModel:
+ Collaboration diagram for bpp::AbstractCodonClusterAASubstitutionModel:

Public Member Functions

 AbstractCodonClusterAASubstitutionModel (std::shared_ptr< const GeneticCode > pgencode, const std::string &prefix, const std::vector< uint > &assign={1, 2, 3, 3, 3, 2, 2, 1, 2, 4, 4, 2, 4, 4, 1, 3, 3, 2, 2, 1})
 Build a new AbstractCodonClusterAASubstitutionModel object. More...
 
 AbstractCodonClusterAASubstitutionModel (const AbstractCodonClusterAASubstitutionModel &model)
 
AbstractCodonClusterAASubstitutionModeloperator= (const AbstractCodonClusterAASubstitutionModel &model)
 
AbstractCodonClusterAASubstitutionModelclone () const override
 
virtual ~AbstractCodonClusterAASubstitutionModel ()
 
void fireParameterChanged (const ParameterList &parameters) 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 CodonFrequencySetInterfacecodonFrequencySet () const override
 
bool hasCodonFrequencySet () const override
 
const std::vector< uint > & getAssign () const
 
void setFreq (std::map< int, double > &frequencies) 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 void setNamespace (const std::string &prefix)=0
 
virtual std::string getNamespace () const=0
 
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const=0
 
void setNamespace (const std::string &prefix)
 
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::shared_ptr< const GeneticCodepgencode_
 
double omegaR_
 
double omegaC_
 
std::vector< uint > assign_
 
std::shared_ptr< const StateMapInterfacestateMap_
 
ParameterList independentParameters_
 
std::map< std::string, std::shared_ptr< AliasParameterListener > > aliasListenersRegister_
 
ParameterList parameters_
 
std::string prefix_
 

Detailed Description

Abstract class for modelling of non-synonymous and synonymous substitution rates in codon models, with AA clustered.

Author
Laurent Guéguen

Non-synonymous rates between amino-acids in the same cluster are multiplied with $\omega_C$, and non-synonymous rates between amino-acids in different clusters are multiplied with $\omega_R$.

Parameters names are "omegaR" and "omegaC".

Clusters can be defined as a vector of assignations, amino-acids ordered as 3-letters abbreviates ("Ala", "Arg", ...). Default cluster splits according to polarity and size: "AGPV", "RQEHKWY", "NDCST", "ILMF", which produces vector:

(1,2,3,3,3,2,2,1,2,4,4,2,4,4,1,3,3,2,2,1)

References:

Sainudiin et al., 2005, Detecting Site-Specific Physicochemical Selective Pressures: Applications to the Class I HLA of the Human Major Histocompatibility Complex and the SRK of the Plant Sporophytic Self-Incompatibility System, Journal of Molecular Evolution 60(3):315-26

Claudia C Weber, Simon Whelan, 2019, Physicochemical Amino Acid Properties Better Describe Substitution Rates in Large Populations, Molecular Biology and Evolution, Volume 36, Issue 4, April 2019, Pages 679–690, https://doi.org/10.1093/molbev/msz003

Definition at line 52 of file AbstractCodonClusterAASubstitutionModel.h.

Constructor & Destructor Documentation

◆ AbstractCodonClusterAASubstitutionModel() [1/2]

AbstractCodonClusterAASubstitutionModel::AbstractCodonClusterAASubstitutionModel ( std::shared_ptr< const GeneticCode pgencode,
const std::string &  prefix,
const std::vector< uint > &  assign = {1, 2, 3, 3, 3, 2, 2, 1, 2, 4, 4, 2, 4, 4, 1, 3, 3, 2, 2, 1} 
)

Build a new AbstractCodonClusterAASubstitutionModel object.

Parameters
pgencodethe genetic code
prefixthe Namespace
assignan paramSynRate is true iff synonymous rate is parametrised (default categories: "AGPV", "RQEHKWY", "NDCST", "ILMF")

Definition at line 15 of file AbstractCodonClusterAASubstitutionModel.cpp.

References bpp::AbstractParameterAliasable::addParameter_(), assign_, and bpp::NumConstants::SMALL().

Referenced by clone().

◆ AbstractCodonClusterAASubstitutionModel() [2/2]

bpp::AbstractCodonClusterAASubstitutionModel::AbstractCodonClusterAASubstitutionModel ( const AbstractCodonClusterAASubstitutionModel model)
inline

Definition at line 79 of file AbstractCodonClusterAASubstitutionModel.h.

◆ ~AbstractCodonClusterAASubstitutionModel()

virtual bpp::AbstractCodonClusterAASubstitutionModel::~AbstractCodonClusterAASubstitutionModel ( )
inlinevirtual

Definition at line 106 of file AbstractCodonClusterAASubstitutionModel.h.

Member Function Documentation

◆ clone()

AbstractCodonClusterAASubstitutionModel* bpp::AbstractCodonClusterAASubstitutionModel::clone ( ) const
inlineoverridevirtual

◆ codonFrequencySet()

const CodonFrequencySetInterface& bpp::AbstractCodonClusterAASubstitutionModel::codonFrequencySet ( ) const
inlineoverridevirtual

◆ fireParameterChanged()

void AbstractCodonClusterAASubstitutionModel::fireParameterChanged ( const ParameterList parameters)
overridevirtual

◆ getAssign()

const std::vector<uint>& bpp::AbstractCodonClusterAASubstitutionModel::getAssign ( ) const
inline

Definition at line 123 of file AbstractCodonClusterAASubstitutionModel.h.

References assign_.

◆ getCodonsMulRate()

double AbstractCodonClusterAASubstitutionModel::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.

Definition at line 39 of file AbstractCodonClusterAASubstitutionModel.cpp.

References assign_, omegaC_, omegaR_, pgencode_, and stateMap_.

◆ hasCodonFrequencySet()

bool bpp::AbstractCodonClusterAASubstitutionModel::hasCodonFrequencySet ( ) const
inlineoverridevirtual

◆ operator=()

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

◆ setFreq()

void bpp::AbstractCodonClusterAASubstitutionModel::setFreq ( std::map< int, double > &  frequencies)
inlineoverridevirtual

Member Data Documentation

◆ assign_

std::vector<uint> bpp::AbstractCodonClusterAASubstitutionModel::assign_
private

◆ omegaC_

double bpp::AbstractCodonClusterAASubstitutionModel::omegaC_
private

◆ omegaR_

double bpp::AbstractCodonClusterAASubstitutionModel::omegaR_
private

◆ pgencode_

std::shared_ptr<const GeneticCode> bpp::AbstractCodonClusterAASubstitutionModel::pgencode_
private

Definition at line 57 of file AbstractCodonClusterAASubstitutionModel.h.

Referenced by getCodonsMulRate(), and operator=().

◆ stateMap_

std::shared_ptr<const StateMapInterface> bpp::AbstractCodonClusterAASubstitutionModel::stateMap_
private

Definition at line 63 of file AbstractCodonClusterAASubstitutionModel.h.

Referenced by getCodonsMulRate(), and operator=().


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