5 #ifndef BPP_PHYL_MODEL_FREQUENCYSET_FREQUENCYSET_H
6 #define BPP_PHYL_MODEL_FREQUENCYSET_FREQUENCYSET_H
9 #include "../StateMap.h"
37 virtual std::shared_ptr<const Alphabet>
getAlphabet()
const = 0;
52 virtual std::shared_ptr<const StateMapInterface>
getStateMap()
const = 0;
111 std::shared_ptr<const StateMapInterface>
stateMap,
112 const std::string& prefix,
113 const std::string& name) :
211 std::shared_ptr<const StateMapInterface>
stateMap,
212 bool allowNullFreqs =
false,
213 unsigned short method = 1,
214 const std::string& name =
"Full");
217 std::shared_ptr<const StateMapInterface>
stateMap,
218 const std::vector<double>& initFreqs,
219 bool allowNullFreqs =
false,
220 unsigned short method = 1,
221 const std::string& name =
"Full");
229 void setFrequencies(
const std::vector<double>& frequencies)
override;
233 void setNamespace(
const std::string& nameSpace)
override;
242 class TransitionModelInterface;
254 std::shared_ptr<TransitionModelInterface>
model_;
273 std::shared_ptr<const TransitionModelInterface>
getModel()
const
278 void setFrequencies(
const std::vector<double>& frequencies)
override;
302 std::unique_ptr<FrequencySetInterface> freqSet,
303 const std::vector<double>& rateFreqs);
327 freqSet_->setFrequencies(frequencies);
332 freqSet_->matchParametersValues(pl);
358 std::shared_ptr<const StateMapInterface>
stateMap,
359 const std::vector<double>& initFreqs,
360 const std::string& name =
"Fixed");
369 std::shared_ptr<const StateMapInterface>
stateMap,
370 const std::string& name =
"Fixed");
375 void setFrequencies(
const std::vector<double>& frequencies)
override;
393 std::shared_ptr<const StateMapInterface>
stateMap,
394 const std::string& path,
413 void setFrequencies(
const std::vector<double>& frequencies)
override;
Basic implementation of the FrequencySet interface.
std::shared_ptr< const Alphabet > alphabet_
const Alphabet & alphabet() const override
void setFrequencies_(const std::vector< double > &frequencies)
const std::map< int, double > getAlphabetStatesFrequencies() const override
std::shared_ptr< const Alphabet > getAlphabet() const override
std::shared_ptr< const StateMapInterface > stateMap_
void setFrequenciesFromAlphabetStatesFrequencies(const std::map< int, double > &frequencies) override
Set the Frequencies from the one of the map which keys match with a letter of the Alphabet....
size_t getNumberOfFrequencies() const override
std::shared_ptr< const StateMapInterface > getStateMap() const override
double & getFreq_(size_t i)
AbstractFrequencySet(const AbstractFrequencySet &af)
std::vector< double > freq_
std::vector< double > & getFrequencies_()
const double & getFreq_(size_t i) const
std::string getName() const override
AbstractFrequencySet & operator=(const AbstractFrequencySet &af)
AbstractFrequencySet(std::shared_ptr< const StateMapInterface > stateMap, const std::string &prefix, const std::string &name)
const Vdouble & getFrequencies() const override
const StateMapInterface & stateMap() const override
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
FrequencySet useful for homogeneous and stationary models.
void setFrequencies(const std::vector< double > &frequencies) override
Set the parameters in order to match a given set of frequencies.
FixedFrequencySet(std::shared_ptr< const StateMapInterface > stateMap, const std::vector< double > &initFreqs, const std::string &name="Fixed")
Construction with user-defined frequencies on the states of the model.
FixedFrequencySet * clone() const override
Parametrize a set of state frequencies.
virtual const Vdouble & getFrequencies() const =0
static std::shared_ptr< IntervalConstraint > FREQUENCE_CONSTRAINT_SMALL
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
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....
virtual const StateMapInterface & stateMap() const =0
FrequencySetInterface * clone() const =0
static std::shared_ptr< IntervalConstraint > FREQUENCE_CONSTRAINT_MILLI
virtual std::string getName() const =0
virtual const std::map< int, double > getAlphabetStatesFrequencies() const =0
virtual const Alphabet & alphabet() const =0
virtual std::shared_ptr< const StateMapInterface > getStateMap() const =0
virtual size_t getNumberOfFrequencies() const =0
virtual void setFrequencies(const std::vector< double > &frequencies)=0
Set the parameters in order to match a given set of frequencies.
static std::shared_ptr< IntervalConstraint > FREQUENCE_CONSTRAINT_CENTI
FrequencySet defined from the equilibrium distribution of a given model.
const TransitionModelInterface & model() const
void fireParameterChanged(const ParameterList &pl) override
virtual ~FromModelFrequencySet()
FromModelFrequencySet & operator=(const FromModelFrequencySet &fmfs)
std::shared_ptr< const TransitionModelInterface > getModel() const
FromModelFrequencySet * clone() const override
void setFrequencies(const std::vector< double > &frequencies) override
Set the parameters in order to match a given set of frequencies.
void setNamespace(const std::string &name) override
std::shared_ptr< TransitionModelInterface > model_
FromModelFrequencySet(std::shared_ptr< TransitionModelInterface > model)
A generic FrequencySet allowing for the estimation of all frequencies.
void fireParameterChanged(const ParameterList ¶meters) override
Simplex sFreq_
Simplex to handle the probabilities and the parameters.
unsigned short getMethod() const
FullFrequencySet(std::shared_ptr< const StateMapInterface > stateMap, bool allowNullFreqs=false, unsigned short method=1, const std::string &name="Full")
Construction with uniform frequencies on the states of the alphabet.
void setNamespace(const std::string &nameSpace) override
FullFrequencySet * clone() const override
void setFrequencies(const std::vector< double > &frequencies) override
Set the parameters in order to match a given set of frequencies.
FrequencySet to be used with a Markov-modulated substitution model.
void setFrequencies(const std::vector< double > &frequencies) override
Set the parameters in order to match a given set of frequencies.
MarkovModulatedFrequencySet(std::unique_ptr< FrequencySetInterface > freqSet, const std::vector< double > &rateFreqs)
std::unique_ptr< FrequencySetInterface > freqSet_
MarkovModulatedFrequencySet & operator=(const MarkovModulatedFrequencySet &mmfs)
virtual ~MarkovModulatedFrequencySet()
void fireParameterChanged(const ParameterList &pl) override
const FrequencySetInterface & getStatesFrequencySet() const
MarkovModulatedFrequencySet(const MarkovModulatedFrequencySet &mmfs)
std::vector< double > rateFreqs_
MarkovModulatedFrequencySet * clone() const override
unsigned short getMethod() const
Map the states of a given alphabet which have a model state.
Interface for all transition models.
FrequencySet to be read in a file. More specifically, a frequency set is read in a column of a given ...
void setFrequencies(const std::vector< double > &frequencies) override
Set the parameters in order to match a given set of frequencies.
virtual ~UserFrequencySet()
UserFrequencySet & operator=(const UserFrequencySet &fmfs)
UserFrequencySet(std::shared_ptr< const StateMapInterface > stateMap, const std::string &path, size_t nCol=1)
User.
UserFrequencySet * clone() const override
size_t getColumnNumber() const
const std::string & getPath() const
Defines the basic types of data flow nodes.
std::vector< double > Vdouble