bpp-phyl3
3.0.0
|
Substitution process manager for non-homogeneous / non-reversible models of evolution. More...
#include <Bpp/Phyl/Likelihood/NonHomogeneousSubstitutionProcess.h>
Public Member Functions | |
NonHomogeneousSubstitutionProcess (std::shared_ptr< DiscreteDistributionInterface > rdist, std::shared_ptr< const PhyloTree > tree=0, std::shared_ptr< FrequencySetInterface > rootFreqs=0) | |
Create a model set according to the specified alphabet and root frequencies. Stationarity is not assumed. More... | |
NonHomogeneousSubstitutionProcess (std::shared_ptr< DiscreteDistributionInterface > rdist, std::shared_ptr< ParametrizablePhyloTree > tree, std::shared_ptr< FrequencySetInterface > rootFreqs=0) | |
Create a model set according to the specified alphabet and root frequencies. Stationarity is not assumed. More... | |
NonHomogeneousSubstitutionProcess (const NonHomogeneousSubstitutionProcess &set) | |
NonHomogeneousSubstitutionProcess & | operator= (const NonHomogeneousSubstitutionProcess &set) |
virtual | ~NonHomogeneousSubstitutionProcess () |
NonHomogeneousSubstitutionProcess * | clone () const override |
void | clear () |
Resets all the information contained in this object. More... | |
void | fireParameterChanged (const ParameterList ¶meters) override |
const StateMapInterface & | stateMap () const override |
std::shared_ptr< const StateMapInterface > | getStateMap () const override |
size_t | getNumberOfModels () const override |
bool | hasMixedTransitionModel () const |
void | setModelScenario (std::shared_ptr< ModelScenario > modelscenario) override |
Set the modelPath, after checking it is valid (ie modelpath has only the model of the process). More... | |
std::vector< size_t > | getModelNumbers () const override |
const BranchModelInterface & | model (size_t n) const override |
std::shared_ptr< const BranchModelInterface > | getModel (size_t n) const override |
std::shared_ptr< const BranchModelInterface > | getModel (size_t n) |
size_t | getModelNumberForNode (unsigned int nodeId) const override |
Get the number of the model associated to a particular node id. More... | |
std::shared_ptr< const BranchModelInterface > | getModelForNode (unsigned int nodeId) const override |
Get the model associated to a particular node id. More... | |
const std::vector< unsigned int > | getNodesWithModel (size_t i) const override |
Get a list of nodes id for which the given model is associated. More... | |
void | addModel (std::shared_ptr< BranchModelInterface > model, const std::vector< unsigned int > &nodesId) |
Add a new model to the set, and set relationships with nodes and params. More... | |
void | setModel (std::shared_ptr< BranchModelInterface > model, size_t modelIndex) |
Change a given model. More... | |
void | setModelToNode (size_t modelIndex, unsigned int nodeNumber) |
Associate an existing model with a given node. More... | |
void | listModelNames (std::ostream &out=std::cout) const |
list all model names. More... | |
ParameterList | getBranchLengthParameters (bool independent) const override |
ParameterList | getRateDistributionParameters (bool independent) const override |
Get the parameters attached to the rate distribution. More... | |
const DiscreteDistributionInterface & | rateDistribution () const override |
Get the rate distribution. More... | |
DiscreteDistributionInterface & | rateDistribution () override |
Get the rate distribution. More... | |
std::shared_ptr< const DiscreteDistributionInterface > | getRateDistribution () const override |
Get a pointer to the rate distribution (or null if there is no rate distribution). More... | |
std::shared_ptr< DiscreteDistributionInterface > | getRateDistribution () override |
Get a pointer to the rate distribution (or null if there is no rate distribution). More... | |
ParameterList | getSubstitutionModelParameters (bool independent) const override |
Get the INDEPENDENT parameters corresponding to the models. More... | |
bool | isFullySetUp (bool throwEx=true) const |
Check if the model set is fully specified for a given tree. More... | |
void | setPhyloTree (const PhyloTree &phyloTree) |
sets the ParametrizablePhyloTree. More... | |
const ParametrizablePhyloTree & | parametrizablePhyloTree () const |
std::shared_ptr< const ParametrizablePhyloTree > | getParametrizablePhyloTree () const |
bool | hasRootFrequencySet () const |
const FrequencySetInterface & | rootFrequencySet () const |
FrequencySetInterface & | rootFrequencySet () |
std::shared_ptr< const FrequencySetInterface > | getRootFrequencySet () const |
std::shared_ptr< FrequencySetInterface > | getRootFrequencySet () |
void | setRootFrequencySet (std::shared_ptr< FrequencySetInterface > rootfrequency) |
set the RootFrequency. More... | |
ParameterList | getRootFrequenciesParameters (bool independent) const |
Get the parameters corresponding to the root frequencies. More... | |
std::shared_ptr< const ModelScenario > | getModelScenario () const |
get the ModelScenario. More... | |
virtual bool | isCompatibleWith (const AlignmentDataInterface &data) const =0 |
bool | isCompatibleWith (const AlignmentDataInterface &data) const |
virtual size_t | getNumberOfClasses () const =0 |
size_t | getNumberOfClasses () const |
virtual size_t | getNumberOfStates () const =0 |
size_t | getNumberOfStates () const |
virtual ParameterList | getNonDerivableParameters () const =0 |
ParameterList | getNonDerivableParameters () const |
get NonDerivable parameters More... | |
virtual size_t | getNumberOfIndependentParameters () const=0 |
size_t | getNumberOfIndependentParameters () const |
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 |
void | aliasParameters (const std::string &p1, const std::string &p2) |
void | aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose) |
virtual void | unaliasParameters (const std::string &p1, const std::string &p2)=0 |
void | unaliasParameters (const std::string &p1, const std::string &p2) |
virtual const ParameterList & | getIndependentParameters () const=0 |
const ParameterList & | getIndependentParameters () const |
virtual std::vector< std::string > | getAlias (const std::string &name) const=0 |
virtual std::vector< std::string > | getAlias (const std::string &name) const |
virtual std::map< std::string, std::string > | getAliases () const=0 |
virtual std::map< std::string, std::string > | getAliases () const |
virtual bool | hasParameter (const std::string &name) const=0 |
bool | hasParameter (const std::string &name) const override |
virtual const ParameterList & | getParameters () const=0 |
const ParameterList & | getParameters () const override |
virtual const Parameter & | parameter (const std::string &name) const=0 |
const Parameter & | parameter (const std::string &name) const override |
virtual double | getParameterValue (const std::string &name) const=0 |
double | getParameterValue (const std::string &name) const override |
virtual void | setAllParametersValues (const ParameterList ¶meters)=0 |
void | setAllParametersValues (const ParameterList ¶meters) override |
virtual void | setParameterValue (const std::string &name, double value)=0 |
void | setParameterValue (const std::string &name, double value) override |
virtual void | setParametersValues (const ParameterList ¶meters)=0 |
void | setParametersValues (const ParameterList ¶meters) override |
virtual bool | matchParametersValues (const ParameterList ¶meters)=0 |
bool | matchParametersValues (const ParameterList ¶meters) override |
virtual void | removeConstraint (const std::string &name)=0 |
void | removeConstraint (const std::string &name) override |
virtual void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0 |
void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override |
virtual size_t | getNumberOfParameters () const=0 |
size_t | getNumberOfParameters () const override |
virtual void | setNamespace (const std::string &prefix)=0 |
void | setNamespace (const std::string &prefix) |
virtual std::string | getNamespace () const=0 |
std::string | getNamespace () const override |
virtual std::string | getParameterNameWithoutNamespace (const std::string &name) const=0 |
std::string | getParameterNameWithoutNamespace (const std::string &name) const override |
std::shared_ptr< const Alphabet > | getAlphabet () const |
bool | hasIndependentParameter (const std::string &name) const |
ParameterList | getAliasedParameters (const ParameterList &pl) const |
ParameterList | getFromParameters (const ParameterList &pl) const |
std::string | getFrom (const std::string &name) const |
const std::shared_ptr< Parameter > & | getParameter (const std::string &name) const |
Protected Member Functions | |
virtual ParameterList & | getParameters_ ()=0 |
ParameterList & | getParameters_ () override |
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 |
Protected Attributes | |
std::shared_ptr< ParametrizablePhyloTree > | pTree_ |
std::shared_ptr< FrequencySetInterface > | rootFrequencies_ |
Root frequencies. More... | |
std::shared_ptr< ModelScenario > | modelScenario_ |
Private Attributes | |
std::vector< std::shared_ptr< BranchModelInterface > > | modelSet_ |
Contains all models used in this tree. More... | |
std::shared_ptr< DiscreteDistributionInterface > | rDist_ |
Rate Distribution. More... | |
std::map< unsigned int, size_t > | nodeToModel_ |
Contains for each node in a tree the index of the corresponding model in modelSet_. More... | |
std::map< size_t, std::vector< unsigned int > > | modelToNodes_ |
std::vector< ParameterList > | modelParameters_ |
Parameters for each model in the set. More... | |
ParameterList | independentParameters_ |
std::map< std::string, std::shared_ptr< AliasParameterListener > > | aliasListenersRegister_ |
ParameterList | parameters_ |
std::string | prefix_ |
Check function. | |
const std::vector< double > & | getRootFrequencies () const override |
const BranchModelInterface & | model (unsigned int nodeId, size_t classIndex) const override |
Get the substitution model corresponding to a certain branch, site pattern, and model class. More... | |
std::shared_ptr< const BranchModelInterface > | getModel (unsigned int nodeId, size_t classIndex) const override |
Get the substitution model corresponding to a certain branch, site pattern, and model class. More... | |
double | getProbabilityForModel (size_t classIndex) const override |
Vdouble | getClassProbabilities () const override |
double | getRateForModel (size_t classIndex) const override |
bool | checkOrphanNodes (bool throwEx) const |
bool | checkUnknownNodes (bool throwEx) const |
static std::unique_ptr< AutonomousSubstitutionProcessInterface > | createHomogeneousSubstitutionProcess (std::shared_ptr< BranchModelInterface > model, std::shared_ptr< DiscreteDistributionInterface > rdist, std::shared_ptr< PhyloTree > tree, std::shared_ptr< FrequencySetInterface > rootFreqs=0, std::shared_ptr< ModelScenario > scenario=0) |
Create a NonHomogeneousSubstitutionProcess object, corresponding to the homogeneous case. More... | |
static std::unique_ptr< NonHomogeneousSubstitutionProcess > | createNonHomogeneousSubstitutionProcess (std::shared_ptr< BranchModelInterface > model, std::shared_ptr< DiscreteDistributionInterface > rdist, std::shared_ptr< PhyloTree > tree, std::shared_ptr< FrequencySetInterface > rootFreqs, const std::vector< std::string > &globalParameterNames, std::shared_ptr< ModelScenario > scenario=0) |
Create a NonHomogeneousSubstitutionProcess object, with one model per branch. More... | |
Substitution process manager for non-homogeneous / non-reversible models of evolution.
This class contains a set of substitution models, and their assignment toward the branches of a phylogenetic tree. Each branch in the tree corresponds to a model in the set, but a susbstitution model may correspond to several branches. The particular case where all branches point toward a unique model is the homogeneous case.
This class also deals with the parameters associated to the models. The models may have their own parameters or share some of them. To deal with this issue, the NonHomogeneousSubstitutionProcess class contains its own parameter list and an index which tells to which models these parameters apply to. Since parameters in a list must have unique names, the names are suffixed with numbers according to the order of the model in the list.
To track the relationships between names in the list and names in each model, the parameter list is duplicated in modelParameters_. The user only act on parameters_, the fireParameterChanged function, automatically called, will update the modelParameters_ field.
In the non-homogeneous and homogeneous non-reversible cases, the likelihood depends on the position of the root. The states frequencies at the root of the tree are hence distinct parameters. These are accounted by a FrequencySet object, managed by the NonHomogeneousSubstitutionProcess class. The corresponding parameters, if any, are added at the beginning of the global parameter list.
If the heterogenity of the model does not affect the equilibrium frequencies, the model can be considered as stationary. In such a model, the process is supposed to be at equilibrium all along the trees, including at the root. Whether a model should be considered as stationary or not is left to the user. If the "assume stationarity" option is set when building the set, then no FrequencySet object is used, but the frequencies are taken to be the same as the one at the first model in the set. Nothing hence prevents you to build a "supposedly stationary model which actually is not", so be careful!!
This class provides several methods to specify which model and/or which parameter is associated to which branch/clade. Several check points are provided, but some are probably missing due to the large set of possible models that this class allows to build, so be careful!
Definition at line 78 of file NonHomogeneousSubstitutionProcess.h.
|
inline |
Create a model set according to the specified alphabet and root frequencies. Stationarity is not assumed.
rdist | The DiscreteDistribution for the rates |
tree | the phylo tree tree |
rootFreqs | The frequencies at root node. The underlying object will be owned by this instance ( = 0 if stationary) |
Definition at line 113 of file NonHomogeneousSubstitutionProcess.h.
References bpp::AbstractParameterAliasable::addParameters_(), and rDist_.
Referenced by clone().
|
inline |
Create a model set according to the specified alphabet and root frequencies. Stationarity is not assumed.
rdist | The DiscreteDistribution for the rates |
tree | the parametrizable tree |
rootFreqs | The frequencies at root node. The underlying object will be owned by this instance ( = 0 if stationary) |
Definition at line 137 of file NonHomogeneousSubstitutionProcess.h.
References bpp::AbstractParameterAliasable::addParameters_(), and rDist_.
NonHomogeneousSubstitutionProcess::NonHomogeneousSubstitutionProcess | ( | const NonHomogeneousSubstitutionProcess & | set | ) |
Definition at line 16 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::AbstractAutonomousSubstitutionProcess::modelScenario_, and modelSet_.
|
inlinevirtual |
Definition at line 157 of file NonHomogeneousSubstitutionProcess.h.
References clear().
void NonHomogeneousSubstitutionProcess::addModel | ( | std::shared_ptr< BranchModelInterface > | model, |
const std::vector< unsigned int > & | nodesId | ||
) |
Add a new model to the set, and set relationships with nodes and params.
model | A pointer toward a susbstitution model, that will added to the set. Warning! The set will now be the owner of the pointer, and will destroy it if needed! Copy the model first if you don't want it to be lost! |
nodesId | the set of nodes in the tree that points toward this model. This will override any previous affectation. |
Exception | in case of error:
|
Definition at line 89 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::AbstractParameterAliasable::addParameter_(), bpp::ParameterList::clone(), bpp::AbstractSubstitutionProcess::getAlphabet(), bpp::BranchModelInterface::getAlphabet(), bpp::ParameterAliasable::getIndependentParameters(), bpp::Parameter::getName(), bpp::AbstractSubstitutionProcess::getNumberOfStates(), bpp::BranchModelInterface::getNumberOfStates(), model(), modelParameters_, modelSet_, modelToNodes_, nodeToModel_, bpp::Parameter::setName(), bpp::ParameterList::size(), and bpp::TextTools::toString().
|
protected |
Definition at line 206 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::AbstractAutonomousSubstitutionProcess::getParametrizablePhyloTree(), nodeToModel_, and bpp::TextTools::toString().
Referenced by isFullySetUp().
|
protected |
Definition at line 229 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::VectorTools::contains(), bpp::AbstractAutonomousSubstitutionProcess::getParametrizablePhyloTree(), modelToNodes_, and bpp::TextTools::toString().
Referenced by isFullySetUp().
void NonHomogeneousSubstitutionProcess::clear | ( | ) |
Resets all the information contained in this object.
Definition at line 68 of file NonHomogeneousSubstitutionProcess.cpp.
References modelParameters_, modelSet_, nodeToModel_, rDist_, and bpp::AbstractParameterAliasable::resetParameters_().
Referenced by operator=(), and ~NonHomogeneousSubstitutionProcess().
|
inlineoverridevirtual |
Implements bpp::AbstractParameterAliasable.
Definition at line 162 of file NonHomogeneousSubstitutionProcess.h.
References NonHomogeneousSubstitutionProcess().
|
static |
Create a NonHomogeneousSubstitutionProcess object, corresponding to the homogeneous case.
Static methods to create "simply" NonHomogeneousSubstitutionProcess.
This class is mainly for testing purpose.
model | The model to use. |
rdist | The rate distribution |
tree | The tree to use for the construction of the set. |
rootFreqs | A FrequencySet object to parametrize root frequencies (0 if stationary). |
scenario | (optional) the scenario used (in case of Mixed Models) |
Definition at line 284 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::BranchModelInterface::alphabet(), bpp::BranchModelInterface::getAlphabet(), bpp::Alphabet::getAlphabetType(), and model().
|
static |
Create a NonHomogeneousSubstitutionProcess object, with one model per branch.
All branches share the same type of model, but allow one set of parameters per branch. This is also possible to specify some parameters to be common to all branches.
model | The model to use. |
rdist | The rate distribution |
rootFreqs | A FrequencySet object to parametrize root frequencies. |
tree | The tree to use for the construction of the set. |
globalParameterNames | Common parameters for all branches. All other parameters will be considered distinct for all branches. |
scenario | (optional) the scenario used (in case of Mixed Models) |
Definition at line 314 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::ParameterList::addParameter(), bpp::BranchModelInterface::alphabet(), bpp::BranchModelInterface::clone(), bpp::ParameterList::deleteParameter(), bpp::BranchModelInterface::getAlphabet(), bpp::Alphabet::getAlphabetType(), bpp::ParameterAliasable::getIndependentParameters(), bpp::StringTokenizer::hasMoreToken(), bpp::ParameterList::hasParameter(), model(), bpp::StringTokenizer::nextToken(), bpp::ParameterList::size(), and bpp::TextTools::toString().
|
overridevirtual |
To be called when a parameter has changed. Depending on parameters, this will actualize the rootFrequencies_ vector or the corresponding models in the set.
parameters | The modified parameters. |
Reimplemented from bpp::AbstractAutonomousSubstitutionProcess.
Definition at line 164 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::AbstractAutonomousSubstitutionProcess::fireParameterChanged(), bpp::AbstractParameterAliasable::getParameterValue(), modelParameters_, modelSet_, rDist_, and bpp::TextTools::toString().
|
inlineinherited |
Definition at line 45 of file AbstractSubstitutionProcess.h.
References bpp::StateMapInterface::getAlphabet(), and bpp::SubstitutionProcessInterface::stateMap().
Referenced by addModel(), bpp::AbstractSubstitutionProcess::isCompatibleWith(), and setModel().
|
inlineoverridevirtual |
Implements bpp::SubstitutionProcessInterface.
Definition at line 329 of file NonHomogeneousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::getParametrizablePhyloTree().
|
inlineoverridevirtual |
Implements bpp::SubstitutionProcessInterface.
Definition at line 434 of file NonHomogeneousSubstitutionProcess.h.
References rDist_.
|
inline |
Definition at line 234 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_.
|
inlineoverridevirtual |
Implements bpp::SubstitutionProcessInterface.
Definition at line 228 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_.
Referenced by hasMixedTransitionModel(), and bpp::PhylogeneticsApplicationTools::printParameters().
|
inlineoverridevirtual |
Get the substitution model corresponding to a certain branch, site pattern, and model class.
nodeId | The id of the node. |
classIndex | The model class index. |
Implements bpp::SubstitutionProcessInterface.
Definition at line 422 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_, and nodeToModel_.
|
inlineoverridevirtual |
Get the model associated to a particular node id.
nodeId | The id of the query node. |
Exception | If no model is found for this node. |
Implements bpp::SubstitutionProcessInterface.
Definition at line 263 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_, nodeToModel_, and bpp::TextTools::toString().
|
inlineoverridevirtual |
Get the number of the model associated to a particular node id.
nodeId | The id of the query node. |
Exception | If no model is found for this node. |
Implements bpp::SubstitutionProcessInterface.
Definition at line 248 of file NonHomogeneousSubstitutionProcess.h.
References nodeToModel_, and bpp::TextTools::toString().
|
inlineoverridevirtual |
Implements bpp::SubstitutionProcessInterface.
Definition at line 215 of file NonHomogeneousSubstitutionProcess.h.
References getNumberOfModels().
|
inlinevirtualinherited |
get the ModelScenario.
Implements bpp::SubstitutionProcessInterface.
Definition at line 150 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::modelScenario_.
|
inlineoverridevirtual |
Get a list of nodes id for which the given model is associated.
i | The number of the model in the set (ie the index in the set, plus 1). |
IndexOutOfBoundsException | If the index is not valid. |
Implements bpp::SubstitutionProcessInterface.
Definition at line 278 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_, and modelToNodes_.
Referenced by bpp::PhylogeneticsApplicationTools::printParameters().
|
virtualinherited |
get NonDerivable parameters
Implements bpp::SubstitutionProcessInterface.
Reimplemented in bpp::SubstitutionProcessCollectionMember.
Definition at line 10 of file AbstractSubstitutionProcess.cpp.
References bpp::ParameterList::includeParameters().
|
pure virtualinherited |
Implemented in bpp::SubstitutionProcessCollectionMember, and bpp::AbstractSubstitutionProcess.
Referenced by bpp::SingleProcessPhyloLikelihood::getNonDerivableParameters().
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 34 of file AbstractSubstitutionProcess.h.
References bpp::SubstitutionProcessInterface::getRateDistribution().
|
pure virtualinherited |
Implemented in bpp::AbstractSubstitutionProcess.
Referenced by bpp::RewardMappingTools::computeRewardVectors(), and bpp::SingleProcessPhyloLikelihood::getNumberOfClasses().
|
inlineoverridevirtual |
Implements bpp::SubstitutionProcessInterface.
Definition at line 199 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_.
Referenced by getModelNumbers(), hasMixedTransitionModel(), and bpp::PhylogeneticsApplicationTools::printParameters().
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 40 of file AbstractSubstitutionProcess.h.
References bpp::StateMapInterface::getNumberOfModelStates(), and bpp::SubstitutionProcessInterface::stateMap().
Referenced by addModel(), and setModel().
|
pure virtualinherited |
Implemented in bpp::AbstractSubstitutionProcess.
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 78 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::pTree_.
Referenced by checkOrphanNodes(), checkUnknownNodes(), getBranchLengthParameters(), bpp::RateAcrossSitesSubstitutionProcess::getBranchLengthParameters(), and bpp::SimpleSubstitutionProcess::getBranchLengthParameters().
|
inlineoverridevirtual |
classIndex | The model class index. |
Implements bpp::SubstitutionProcessInterface.
Definition at line 427 of file NonHomogeneousSubstitutionProcess.h.
References rDist_.
|
inlineoverridevirtual |
Get a pointer to the rate distribution (or null if there is no rate distribution).
Implements bpp::SubstitutionProcessInterface.
Definition at line 359 of file NonHomogeneousSubstitutionProcess.h.
References rDist_.
|
inlineoverridevirtual |
Get a pointer to the rate distribution (or null if there is no rate distribution).
Implements bpp::SubstitutionProcessInterface.
Definition at line 364 of file NonHomogeneousSubstitutionProcess.h.
References rDist_.
|
inlineoverridevirtual |
Get the parameters attached to the rate distribution.
Implements bpp::SubstitutionProcessInterface.
Definition at line 340 of file NonHomogeneousSubstitutionProcess.h.
References rDist_.
|
inlineoverridevirtual |
classIndex | The model class index. |
Implements bpp::SubstitutionProcessInterface.
Definition at line 449 of file NonHomogeneousSubstitutionProcess.h.
References rDist_.
|
inlineoverridevirtual |
Implements bpp::SubstitutionProcessInterface.
Definition at line 404 of file NonHomogeneousSubstitutionProcess.h.
References bpp::FrequencySetInterface::getFrequencies(), bpp::AbstractAutonomousSubstitutionProcess::hasRootFrequencySet(), modelSet_, and bpp::AbstractAutonomousSubstitutionProcess::rootFrequencySet().
|
inlinevirtualinherited |
Get the parameters corresponding to the root frequencies.
Implements bpp::SubstitutionProcessInterface.
Definition at line 130 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::hasRootFrequencySet(), and bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 106 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 96 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.
Referenced by bpp::RateAcrossSitesSubstitutionProcess::getRootFrequencies(), bpp::SimpleSubstitutionProcess::getRootFrequencies(), and bpp::PhylogeneticsApplicationTools::printParameters().
|
inlineoverridevirtual |
Implements bpp::SubstitutionProcessInterface.
Definition at line 188 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_.
|
overridevirtual |
Get the INDEPENDENT parameters corresponding to the models.
Implements bpp::SubstitutionProcessInterface.
Definition at line 185 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::ParameterList::addParameter(), bpp::Parameter::getName(), bpp::AbstractParameterAliasable::hasIndependentParameter(), modelParameters_, bpp::Parameter::setName(), and bpp::TextTools::toString().
bool NonHomogeneousSubstitutionProcess::hasMixedTransitionModel | ( | ) | const |
Definition at line 259 of file NonHomogeneousSubstitutionProcess.cpp.
References getModel(), and getNumberOfModels().
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 86 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.
Referenced by getRootFrequencies(), bpp::RateAcrossSitesSubstitutionProcess::getRootFrequencies(), bpp::SimpleSubstitutionProcess::getRootFrequencies(), and bpp::AbstractAutonomousSubstitutionProcess::getRootFrequenciesParameters().
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 50 of file AbstractSubstitutionProcess.h.
References bpp::AbstractSubstitutionProcess::getAlphabet(), and bpp::TemplateAlignmentDataInterface< class >::getAlphabet().
|
pure virtualinherited |
Implemented in bpp::AbstractSubstitutionProcess.
|
inline |
Check if the model set is fully specified for a given tree.
This include:
throwEx | Tell if an exception have to be thrown in case of test not passed. |
Definition at line 384 of file NonHomogeneousSubstitutionProcess.h.
References checkOrphanNodes(), and checkUnknownNodes().
void NonHomogeneousSubstitutionProcess::listModelNames | ( | std::ostream & | out = std::cout | ) | const |
list all model names.
Definition at line 151 of file NonHomogeneousSubstitutionProcess.cpp.
References modelSet_, and modelToNodes_.
|
inlineoverridevirtual |
Implements bpp::SubstitutionProcessInterface.
Definition at line 222 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_.
Referenced by addModel(), createHomogeneousSubstitutionProcess(), createNonHomogeneousSubstitutionProcess(), and setModel().
|
inlineoverridevirtual |
Get the substitution model corresponding to a certain branch, site pattern, and model class.
nodeId | The id of the node. |
classIndex | The model class index. |
Implements bpp::SubstitutionProcessInterface.
Definition at line 417 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_, and nodeToModel_.
NonHomogeneousSubstitutionProcess & NonHomogeneousSubstitutionProcess::operator= | ( | const NonHomogeneousSubstitutionProcess & | set | ) |
Definition at line 38 of file NonHomogeneousSubstitutionProcess.cpp.
References clear(), modelParameters_, bpp::AbstractAutonomousSubstitutionProcess::modelScenario_, modelSet_, modelToNodes_, nodeToModel_, bpp::AbstractAutonomousSubstitutionProcess::operator=(), bpp::AbstractParameterAliasable::operator=(), and rDist_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 73 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::pTree_.
|
inlineoverridevirtual |
Get the rate distribution.
NullPointerException | if there is no associated rate distribution. |
Implements bpp::SubstitutionProcessInterface.
Definition at line 345 of file NonHomogeneousSubstitutionProcess.h.
References rDist_.
Referenced by bpp::PhylogeneticsApplicationTools::printParameters().
|
inlineoverridevirtual |
Get the rate distribution.
NullPointerException | if there is no associated rate distribution. |
Implements bpp::SubstitutionProcessInterface.
Definition at line 352 of file NonHomogeneousSubstitutionProcess.h.
References rDist_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 101 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.
|
inlinevirtualinherited |
Implements bpp::SubstitutionProcessInterface.
Definition at line 91 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.
Referenced by getRootFrequencies(), and bpp::PhylogeneticsApplicationTools::printParameters().
void NonHomogeneousSubstitutionProcess::setModel | ( | std::shared_ptr< BranchModelInterface > | model, |
size_t | modelIndex | ||
) |
Change a given model.
The new model will be copied and will replace the old one. All previous associations will be kept the same.
model | A pointer toward a susbstitution model, that will added to the set. Warning! The set will now be the owner of the pointer, and will destroy it if needed! Copy the model first if you don't want it to be lost! |
modelIndex | The index of the existing model to replace. |
Definition at line 120 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::AbstractParameterAliasable::addParameter_(), bpp::ParameterList::clone(), bpp::AbstractParameterAliasable::deleteParameter_(), bpp::AbstractSubstitutionProcess::getAlphabet(), bpp::BranchModelInterface::getAlphabet(), bpp::ParameterAliasable::getIndependentParameters(), bpp::Parameter::getName(), bpp::AbstractSubstitutionProcess::getNumberOfStates(), bpp::BranchModelInterface::getNumberOfStates(), model(), modelParameters_, modelSet_, bpp::Parameter::setName(), bpp::ParameterList::size(), and bpp::TextTools::toString().
|
overridevirtual |
Set the modelPath, after checking it is valid (ie modelpath has only the model of the process).
Implements bpp::AbstractAutonomousSubstitutionProcess.
Definition at line 270 of file NonHomogeneousSubstitutionProcess.cpp.
References bpp::AbstractAutonomousSubstitutionProcess::modelScenario_, and modelSet_.
void NonHomogeneousSubstitutionProcess::setModelToNode | ( | size_t | modelIndex, |
unsigned int | nodeNumber | ||
) |
Associate an existing model with a given node.
If the node was was previously associated to a model, the old association is deleted. If other nodes are associated to this model, the association is conserved.
modelIndex | The position of the model in the set. |
nodeNumber | The id of the corresponding node. |
Definition at line 78 of file NonHomogeneousSubstitutionProcess.cpp.
References nodeToModel_.
|
virtualinherited |
sets the ParametrizablePhyloTree.
Will build a unique_ptr<ParametrizablePhyloTree> from the given PhyloTree
Implements bpp::AutonomousSubstitutionProcessInterface.
Definition at line 67 of file AbstractAutonomousSubstitutionProcess.cpp.
References bpp::AbstractParameterAliasable::addParameters_(), bpp::ParameterList::deleteParameters(), bpp::AbstractParameterAliasable::getParameters_(), and bpp::AbstractAutonomousSubstitutionProcess::pTree_.
Referenced by bpp::AbstractAutonomousSubstitutionProcess::AbstractAutonomousSubstitutionProcess().
|
inlinevirtualinherited |
set the RootFrequency.
rootfrequency | The root frequencies to be associated with this instance. |
Implements bpp::AutonomousSubstitutionProcessInterface.
Definition at line 116 of file AbstractAutonomousSubstitutionProcess.h.
References bpp::AbstractParameterAliasable::addParameters_(), bpp::ParameterList::deleteParameters(), bpp::AbstractParameterAliasable::getParameters_(), and bpp::AbstractAutonomousSubstitutionProcess::rootFrequencies_.
|
inlineoverridevirtual |
Implements bpp::SubstitutionProcessInterface.
Definition at line 180 of file NonHomogeneousSubstitutionProcess.h.
References modelSet_.
|
private |
Parameters for each model in the set.
Definition at line 102 of file NonHomogeneousSubstitutionProcess.h.
Referenced by addModel(), clear(), fireParameterChanged(), getSubstitutionModelParameters(), operator=(), and setModel().
|
protectedinherited |
Definition at line 35 of file AbstractAutonomousSubstitutionProcess.h.
Referenced by bpp::AbstractAutonomousSubstitutionProcess::getModelScenario(), NonHomogeneousSubstitutionProcess(), bpp::AbstractAutonomousSubstitutionProcess::operator=(), operator=(), bpp::RateAcrossSitesSubstitutionProcess::operator=(), bpp::SimpleSubstitutionProcess::operator=(), bpp::RateAcrossSitesSubstitutionProcess::RateAcrossSitesSubstitutionProcess(), bpp::RateAcrossSitesSubstitutionProcess::setModelScenario(), bpp::SimpleSubstitutionProcess::setModelScenario(), setModelScenario(), and bpp::SimpleSubstitutionProcess::SimpleSubstitutionProcess().
|
private |
Contains all models used in this tree.
Definition at line 86 of file NonHomogeneousSubstitutionProcess.h.
Referenced by addModel(), clear(), fireParameterChanged(), getModel(), getModelForNode(), getNodesWithModel(), getNumberOfModels(), getRootFrequencies(), getStateMap(), listModelNames(), model(), NonHomogeneousSubstitutionProcess(), operator=(), setModel(), setModelScenario(), and stateMap().
|
mutableprivate |
Definition at line 97 of file NonHomogeneousSubstitutionProcess.h.
Referenced by addModel(), checkUnknownNodes(), getNodesWithModel(), listModelNames(), and operator=().
|
mutableprivate |
Contains for each node in a tree the index of the corresponding model in modelSet_.
Definition at line 96 of file NonHomogeneousSubstitutionProcess.h.
Referenced by addModel(), checkOrphanNodes(), clear(), getModel(), getModelForNode(), getModelNumberForNode(), model(), operator=(), and setModelToNode().
|
protectedinherited |
Definition at line 28 of file AbstractAutonomousSubstitutionProcess.h.
Referenced by bpp::AbstractAutonomousSubstitutionProcess::fireParameterChanged(), bpp::AbstractAutonomousSubstitutionProcess::getParametrizablePhyloTree(), bpp::AbstractAutonomousSubstitutionProcess::operator=(), bpp::AbstractAutonomousSubstitutionProcess::parametrizablePhyloTree(), and bpp::AbstractAutonomousSubstitutionProcess::setPhyloTree().
|
private |
Rate Distribution.
Definition at line 91 of file NonHomogeneousSubstitutionProcess.h.
Referenced by clear(), fireParameterChanged(), getClassProbabilities(), getProbabilityForModel(), getRateDistribution(), getRateDistributionParameters(), getRateForModel(), NonHomogeneousSubstitutionProcess(), operator=(), and rateDistribution().
|
protectedinherited |
Root frequencies.
Definition at line 33 of file AbstractAutonomousSubstitutionProcess.h.
Referenced by bpp::AbstractAutonomousSubstitutionProcess::AbstractAutonomousSubstitutionProcess(), bpp::AbstractAutonomousSubstitutionProcess::fireParameterChanged(), bpp::AbstractAutonomousSubstitutionProcess::getRootFrequenciesParameters(), bpp::AbstractAutonomousSubstitutionProcess::getRootFrequencySet(), bpp::AbstractAutonomousSubstitutionProcess::hasRootFrequencySet(), bpp::AbstractAutonomousSubstitutionProcess::operator=(), bpp::AbstractAutonomousSubstitutionProcess::rootFrequencySet(), and bpp::AbstractAutonomousSubstitutionProcess::setRootFrequencySet().