bpp-phyl3  3.0.0
bpp::CodonFrequencySetInterface Class Referenceabstract

Parametrize a set of state frequencies for codons. More...

#include <Bpp/Phyl/Model/FrequencySet/CodonFrequencySet.h>

+ Inheritance diagram for bpp::CodonFrequencySetInterface:
+ Collaboration diagram for bpp::CodonFrequencySetInterface:

Public Member Functions

CodonFrequencySetInterfaceclone () const override=0
 
virtual std::shared_ptr< const CodonAlphabetgetCodonAlphabet () const =0
 
virtual std::shared_ptr< const GeneticCodegetGeneticCode () const =0
 
virtual std::shared_ptr< const AlphabetgetAlphabet () const =0
 
virtual const Alphabetalphabet () const =0
 
virtual const StateMapInterfacestateMap () const =0
 
virtual std::shared_ptr< const StateMapInterfacegetStateMap () const =0
 
virtual const VdoublegetFrequencies () const =0
 
virtual const std::map< int, double > getAlphabetStatesFrequencies () const =0
 
virtual void setFrequencies (const std::vector< double > &frequencies)=0
 Set the parameters in order to match a given set of frequencies. More...
 
virtual void setFrequenciesFromAlphabetStatesFrequencies (const std::map< int, double > &frequencies)=0
 Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1. More...
 
virtual std::string getName () const =0
 
virtual size_t getNumberOfFrequencies () const =0
 
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
 

Static Public Member Functions

static std::unique_ptr< CodonFrequencySetInterfacegetFrequencySetForCodons (short option, std::shared_ptr< const GeneticCode > gCode, const std::string &mgmtStopCodon="quadratic", unsigned short method=1)
 A helper function that provide frequencies set for codon models according to PAML option. More...
 

Static Public Attributes

static const short F0 = 0
 
static const short F1X4 = 1
 
static const short F3X4 = 2
 
static const short F61 = 3
 
static std::shared_ptr< IntervalConstraintFREQUENCE_CONSTRAINT_SMALL
 
static std::shared_ptr< IntervalConstraintFREQUENCE_CONSTRAINT_MILLI
 
static std::shared_ptr< IntervalConstraintFREQUENCE_CONSTRAINT_CENTI
 

Protected Member Functions

virtual ParameterListgetParameters_ ()=0
 

Detailed Description

Parametrize a set of state frequencies for codons.

Definition at line 21 of file CodonFrequencySet.h.

Member Function Documentation

◆ alphabet()

virtual const Alphabet& bpp::FrequencySetInterface::alphabet ( ) const
pure virtualinherited
Returns
The alphabet associated to this set.

Implemented in bpp::AbstractFrequencySet.

◆ clone()

◆ getAlphabet()

◆ getAlphabetStatesFrequencies()

virtual const std::map<int, double> bpp::FrequencySetInterface::getAlphabetStatesFrequencies ( ) const
pure virtualinherited
Returns
The frequencies of each alphabet states according to this model.

Implemented in bpp::AbstractFrequencySet.

◆ getCodonAlphabet()

virtual std::shared_ptr<const CodonAlphabet> bpp::CodonFrequencySetInterface::getCodonAlphabet ( ) const
pure virtual

◆ getFrequencies()

◆ getFrequencySetForCodons()

unique_ptr< CodonFrequencySetInterface > CodonFrequencySetInterface::getFrequencySetForCodons ( short  option,
std::shared_ptr< const GeneticCode gCode,
const std::string &  mgmtStopCodon = "quadratic",
unsigned short  method = 1 
)
static

A helper function that provide frequencies set for codon models according to PAML option.

Parameters
optionA code describing the option, one of F61, F1X4 or F3X4.
gCodeThe genetic code to use. The underlying codon alphabet object will be passed to the FrequencySet instance.
mgmtStopCodonthe optional way the frequencies assigned to the stop codons are redistributed to the other codons, with F1X4 and F3X4 options. The available values are:
  • uniform : each stop frequency is distributed evenly
  • linear : each stop frequency is distributed to the neighbour codons (ie 1 substitution away), in proportion to each target codon frequency.
  • quadratic (default): each stop frequency is distributed to the neighbour codons (ie 1 substitution away), in proportion to the square of each target codon frequency.
methodThe parametrization used for F61. Default method is 1 (ie global ratio).
See also
Simplex

Definition at line 641 of file CodonFrequencySet.cpp.

References F0, F1X4, F3X4, and F61.

Referenced by bpp::BppOFrequencySetFormat::readFrequencySet().

◆ getGeneticCode()

virtual std::shared_ptr<const GeneticCode> bpp::CodonFrequencySetInterface::getGeneticCode ( ) const
pure virtual

◆ getName()

virtual std::string bpp::FrequencySetInterface::getName ( ) const
pure virtualinherited

◆ getNumberOfFrequencies()

virtual size_t bpp::FrequencySetInterface::getNumberOfFrequencies ( ) const
pure virtualinherited
Returns
The number of frequencies in the set. This is equivalent to getStateMap().getNumberOfModelStates().

Implemented in bpp::AbstractFrequencySet.

◆ getStateMap()

virtual std::shared_ptr<const StateMapInterface> bpp::FrequencySetInterface::getStateMap ( ) const
pure virtualinherited
Returns
A shared_ptr toward the mapping of model states with alphabet states.

Implemented in bpp::AbstractFrequencySet.

◆ setFrequencies()

virtual void bpp::FrequencySetInterface::setFrequencies ( const std::vector< double > &  frequencies)
pure virtualinherited

Set the parameters in order to match a given set of frequencies.

Parameters
frequenciesThe set of frequencies to match.
Exceptions
DimensionExceptionIf the number of frequencies does not match the size of the alphabet.
ExceptionIf the frequencies do not sum to 1.

Implemented in bpp::WordFromUniqueFrequencySet, bpp::WordFromIndependentFrequencySet, bpp::FullNucleotideFrequencySet, bpp::GCFrequencySet, bpp::MvaFrequencySet, bpp::UserFrequencySet, bpp::FixedFrequencySet, bpp::MarkovModulatedFrequencySet, bpp::FromModelFrequencySet, bpp::FullFrequencySet, bpp::FullPerAACodonFrequencySet, bpp::UserCodonFrequencySet, bpp::FixedCodonFrequencySet, and bpp::FullCodonFrequencySet.

Referenced by bpp::BppOFrequencySetFormat::initialize_().

◆ setFrequenciesFromAlphabetStatesFrequencies()

virtual void bpp::FrequencySetInterface::setFrequenciesFromAlphabetStatesFrequencies ( const std::map< int, double > &  frequencies)
pure virtualinherited

Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1.

Parameters
frequenciesThe set of frequencies to match.

Implemented in bpp::AbstractFrequencySet.

Referenced by bpp::BppOFrequencySetFormat::initialize_().

◆ stateMap()

virtual const StateMapInterface& bpp::FrequencySetInterface::stateMap ( ) const
pure virtualinherited
Returns
The mapping of model states with alphabet states.

Implemented in bpp::AbstractFrequencySet.

Member Data Documentation

◆ F0

const short CodonFrequencySetInterface::F0 = 0
static

◆ F1X4

const short CodonFrequencySetInterface::F1X4 = 1
static

◆ F3X4

const short CodonFrequencySetInterface::F3X4 = 2
static

◆ F61

const short CodonFrequencySetInterface::F61 = 3
static

◆ FREQUENCE_CONSTRAINT_CENTI

std::shared_ptr< IntervalConstraint > FrequencySetInterface::FREQUENCE_CONSTRAINT_CENTI
staticinherited

◆ FREQUENCE_CONSTRAINT_MILLI

std::shared_ptr< IntervalConstraint > FrequencySetInterface::FREQUENCE_CONSTRAINT_MILLI
staticinherited

Definition at line 91 of file FrequencySet.h.

◆ FREQUENCE_CONSTRAINT_SMALL

std::shared_ptr< IntervalConstraint > FrequencySetInterface::FREQUENCE_CONSTRAINT_SMALL
staticinherited

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