bpp-phyl3
3.0.0
|
Substitution models manager for Mixed Substitution Models. This class inherits from SubstitutionModelSet. More...
#include <Bpp/Phyl/Legacy/Model/MixedSubstitutionModelSet.h>
Classes | |
class | HyperNode |
Public Member Functions | |
MixedSubstitutionModelSet (std::shared_ptr< const Alphabet > alpha) | |
Create a model set according to the specified alphabet. More... | |
~MixedSubstitutionModelSet () | |
MixedSubstitutionModelSet (const MixedSubstitutionModelSet &set) | |
MixedSubstitutionModelSet (const SubstitutionModelSet &set) | |
MixedSubstitutionModelSet & | operator= (const MixedSubstitutionModelSet &set) |
MixedSubstitutionModelSet * | clone () const |
void | clear () |
Resets the list of the HyperNodes. More... | |
void | addEmptyHyperNode () |
void | addHyperNode (const HyperNode &hn) |
bool | complete () |
void | addToHyperNode (size_t nM, const Vuint &vnS, int nH=-1) |
size_t | getNumberOfHyperNodes () const |
HyperNode & | getHyperNode (size_t i) |
const HyperNode & | getHyperNode (size_t i) const |
bool | hasExclusivePaths () const |
void | fireParameterChanged (const ParameterList ¶meters) |
void | computeHyperNodesProbabilities () |
double | getHyperNodeProbability (const HyperNode &hn) const |
bool | isStationary () const |
void | setRootFrequencies (std::shared_ptr< FrequencySetInterface > rootFreqs) |
Sets a given FrequencySet for root frequencies. More... | |
size_t | getNumberOfStates () const |
Get the number of states associated to this model set. More... | |
size_t | getNumberOfModels () const |
bool | hasMixedTransitionModel () const |
std::shared_ptr< const TransitionModelInterface > | getModel (size_t i) const |
Get one model from the set knowing its index. More... | |
std::shared_ptr< TransitionModelInterface > | getModel (size_t i) |
const TransitionModelInterface & | model (size_t i) const |
TransitionModelInterface & | model (size_t i) |
std::shared_ptr< const SubstitutionModelInterface > | getSubstitutionModel (size_t i) const |
Return a markovian substitution model (or null) More... | |
std::shared_ptr< SubstitutionModelInterface > | getSubstitutionModel (size_t i) |
const SubstitutionModelInterface & | substitutionModel (size_t i) const |
bool | hasOnlySubstitutionModels () const |
check if has only markovian substitution models More... | |
size_t | getModelIndexForNode (int nodeId) const |
Get the index in the set of the model associated to a particular node id. More... | |
std::shared_ptr< const TransitionModelInterface > | getModelForNode (int nodeId) const |
Get the model associated to a particular node id. More... | |
std::shared_ptr< TransitionModelInterface > | getModelForNode (int nodeId) |
std::shared_ptr< const SubstitutionModelInterface > | getSubstitutionModelForNode (int nodeId) const |
std::shared_ptr< SubstitutionModelInterface > | getSubstitutionModelForNode (int nodeId) |
const std::vector< int > & | getNodesWithModel (size_t i) const |
Get a list of nodes id for which the given model is associated. More... | |
std::vector< int > | getNodesWithParameter (const std::string &name) const |
void | addModel (std::shared_ptr< TransitionModelInterface > model, const std::vector< int > &nodesId) |
Add a new model to the set, and set relationships with nodes and params. More... | |
void | setNodeToModel (size_t modelIndex, int nodeId) |
Sets an assignment of a given model index to a given onde id. More... | |
void | resetModelToNodeIds () |
Reset model indices to node ids assignment. More... | |
void | replaceModel (size_t modelIndex, std::shared_ptr< TransitionModelInterface > model) |
Replace a model in the set, and all corresponding parameters. The replaced model deleted. More... | |
void | listModelNames (std::ostream &out=std::cout) const |
const std::shared_ptr< FrequencySetInterface > | getRootFrequencySet () const |
const FrequencySetInterface & | rootFrequencySet () const |
std::vector< double > | getRootFrequencies () const |
ParameterList | getRootFrequenciesParameters () const |
Get the parameters corresponding to the root frequencies. More... | |
ParameterList | getNodeParameters () const |
Get the parameters corresponding attached to the nodes of the tree. More... | |
ParameterList | getModelParameters (size_t modelIndex) const |
Get the parameters attached to a Model. More... | |
std::shared_ptr< const Alphabet > | getAlphabet () const |
const Alphabet & | alphabet () const |
const std::vector< int > & | getAlphabetStates () const |
const StateMapInterface & | stateMap () const |
std::shared_ptr< const StateMapInterface > | getStateMap () const |
std::vector< size_t > | getModelStates (int code) const |
std::vector< size_t > | getModelStates (const std::string &code) const |
int | getAlphabetStateAsInt (size_t index) const |
std::string | getAlphabetStateAsChar (size_t index) const |
bool | isFullySetUpFor (const Tree &tree, bool throwEx=true) const |
Check if the model set is fully specified for a given tree. More... | |
void | setNamespace (const std::string &prefix) |
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 | |
void | updateRootFrequencies () |
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 |
Check function. | |
bool | checkOrphanModels (bool throwEx) const |
bool | checkOrphanNodes (const Tree &tree, bool throwEx) const |
bool | checkUnknownNodes (const Tree &tree, bool throwEx) const |
Protected Attributes | |
std::shared_ptr< const Alphabet > | alphabet_ |
A pointer toward the common alphabet to all models in the set. More... | |
size_t | nbStates_ |
std::vector< std::shared_ptr< TransitionModelInterface > > | modelSet_ |
Contains all models used in this tree. More... | |
Private Attributes | |
std::vector< HyperNode * > | vpHyperNodes_ |
std::shared_ptr< FrequencySetInterface > | rootFrequencies_ |
Root frequencies. More... | |
std::map< 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< int > > | modelToNodes_ |
std::vector< ParameterList > | modelParameters_ |
Parameters for each model in the set. More... | |
bool | stationarity_ |
ParameterList | independentParameters_ |
std::map< std::string, std::shared_ptr< AliasParameterListener > > | aliasListenersRegister_ |
ParameterList | parameters_ |
std::string | prefix_ |
Substitution models manager for Mixed Substitution Models. This class inherits from SubstitutionModelSet.
This class is done to handle specific cases of choices among the submodels of mixed substitution models. Each branch of the tree is labelled by a mixed model, and a site may be restricted to a set of submodels it is allowed to follow. These sets are defined through an hypergrap, ie a list of hypernodes.
For example, suppose there are 3 mixed models (M1,M2 and M3), with 2, 3, 4 submodels (S1, S2, ...) each.
If the sites are allowed to follow any combination of submodels (12 combinations) the corresponding hypergraph has only one hypernode: (<1,2>,<1,2,3>,<1,2,3,4>).
The hypergraph with hypernodes ((<1>,<1,2>,<1,2>),(<2>,<3>,<3,4>)) means that a site either follows 6 combinations:
M1:S1, M2:S1 or M2:S2, and M3:S1 or M3:S2.
or
M1:S2, M2:S3, and M3:S3 or M3:S4.
Actually, additional coordinates are set when there are non mixed models, with no value in them, and not used in practice.
An hypernode is valid only if each mixed model is represented at least by one submodel.
Dependency of the submodels entails constraints in the probabilities of the submodels, and definition of the hypernodes must be taken with care for the whole modelling to be possible.
In this implementation, for sake of simplification (and for reason of time), all the submodels must belong to exactly one given hypernode, but in theory more complex dependencies are possible.
Concerning the probabilities of the submodels in each hypernode, the first coordinate (ie set of submodels inside a mixed model) in the list defines the probability of each hypernode. For each coordinate (the first included), when there are several submodels, their probabilities are conditional probabilities, which means that they sum 1 and their ratio are unchanged.
For instance, for hypergraph ((<1>,<1,2>,<1,2>),(<2>,<3>,<3,4>)), the probabilities of hypernodes are the probabilities of M1:S1 and M1:S2. In the first hypernode, the probabilities of M2:S1 and M2:S2 are P(M2:S1)/(P(M2:S1)+P(M2:S2)) and P(M2:S2)/(P(M2:S1)+P(M2:S2)).
We do not certify that the probability parameters of the mixed models are all useful, and then identifiability problems may be encountered.
There is a method ("complete") that creates an additional hypernode to ensure that all submodels belong to at least an hypernode.
Definition at line 85 of file MixedSubstitutionModelSet.h.
|
inline |
Create a model set according to the specified alphabet.
alpha | The alphabet to use for this set. |
Definition at line 239 of file MixedSubstitutionModelSet.h.
Referenced by clone().
MixedSubstitutionModelSet::~MixedSubstitutionModelSet | ( | ) |
Definition at line 27 of file MixedSubstitutionModelSet.cpp.
References vpHyperNodes_.
MixedSubstitutionModelSet::MixedSubstitutionModelSet | ( | const MixedSubstitutionModelSet & | set | ) |
Definition at line 12 of file MixedSubstitutionModelSet.cpp.
References vpHyperNodes_.
MixedSubstitutionModelSet::MixedSubstitutionModelSet | ( | const SubstitutionModelSet & | set | ) |
Definition at line 22 of file MixedSubstitutionModelSet.cpp.
void MixedSubstitutionModelSet::addEmptyHyperNode | ( | ) |
Definition at line 62 of file MixedSubstitutionModelSet.cpp.
References vpHyperNodes_.
Referenced by complete(), and bpp::LegacyPhylogeneticsApplicationTools::completeMixedSubstitutionModelSet().
void MixedSubstitutionModelSet::addHyperNode | ( | const HyperNode & | hn | ) |
Definition at line 67 of file MixedSubstitutionModelSet.cpp.
References vpHyperNodes_.
|
inherited |
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 98 of file SubstitutionModelSet.cpp.
References bpp::AbstractParameterAliasable::addParameter_(), bpp::BranchModelInterface::alphabet(), bpp::SubstitutionModelSet::alphabet_, bpp::Alphabet::getAlphabetType(), bpp::BranchModelInterface::getNumberOfStates(), bpp::ParameterList::getParameterNames(), bpp::ParameterAliasable::getParameters(), bpp::SubstitutionModelSet::model(), bpp::SubstitutionModelSet::modelParameters_, bpp::SubstitutionModelSet::modelSet_, bpp::SubstitutionModelSet::modelToNodes_, bpp::SubstitutionModelSet::nbStates_, bpp::SubstitutionModelSet::nodeToModel_, bpp::ParameterList::parameter(), bpp::Parameter::setName(), and bpp::TextTools::toString().
Referenced by bpp::LegacyPhylogeneticsApplicationTools::setSubstitutionModelSet().
void MixedSubstitutionModelSet::addToHyperNode | ( | size_t | nM, |
const Vuint & | vnS, | ||
int | nH = -1 |
||
) |
Definition at line 126 of file MixedSubstitutionModelSet.cpp.
References bpp::SubstitutionModelSet::getNumberOfModels(), and vpHyperNodes_.
Referenced by complete(), and bpp::LegacyPhylogeneticsApplicationTools::completeMixedSubstitutionModelSet().
|
inlineinherited |
Definition at line 467 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::alphabet_.
|
protectedinherited |
Definition at line 230 of file SubstitutionModelSet.cpp.
References bpp::VectorTools::contains(), bpp::MapTools::getValues(), bpp::SubstitutionModelSet::modelSet_, bpp::SubstitutionModelSet::nodeToModel_, and bpp::TextTools::toString().
Referenced by bpp::SubstitutionModelSet::isFullySetUpFor().
|
protectedinherited |
Definition at line 245 of file SubstitutionModelSet.cpp.
References bpp::Tree::getNodesId(), bpp::Tree::getRootId(), bpp::SubstitutionModelSet::nodeToModel_, and bpp::TextTools::toString().
Referenced by bpp::SubstitutionModelSet::isFullySetUpFor().
|
protectedinherited |
Definition at line 261 of file SubstitutionModelSet.cpp.
References bpp::VectorTools::contains(), bpp::Tree::getNodesId(), bpp::Tree::getRootId(), bpp::SubstitutionModelSet::modelToNodes_, and bpp::TextTools::toString().
Referenced by bpp::SubstitutionModelSet::isFullySetUpFor().
void MixedSubstitutionModelSet::clear | ( | ) |
Resets the list of the HyperNodes.
Definition at line 35 of file MixedSubstitutionModelSet.cpp.
References bpp::SubstitutionModelSet::clear(), and vpHyperNodes_.
|
inlinevirtual |
Implements bpp::AbstractParameterAliasable.
Definition at line 251 of file MixedSubstitutionModelSet.h.
References MixedSubstitutionModelSet().
bool MixedSubstitutionModelSet::complete | ( | ) |
Definition at line 72 of file MixedSubstitutionModelSet.cpp.
References addEmptyHyperNode(), addToHyperNode(), bpp::MixedSubstitutionModelSet::HyperNode::getNode(), bpp::SubstitutionModelSet::getNumberOfModels(), bpp::SubstitutionModelSet::model(), bpp::MixedSubstitutionModelSet::HyperNode::Node::size(), and vpHyperNodes_.
Referenced by bpp::LegacyPhylogeneticsApplicationTools::completeMixedSubstitutionModelSet().
void MixedSubstitutionModelSet::computeHyperNodesProbabilities | ( | ) |
Definition at line 164 of file MixedSubstitutionModelSet.cpp.
References getHyperNode(), bpp::MixedSubstitutionModelSet::HyperNode::getNode(), bpp::MixedTransitionModelInterface::getNProbability(), getNumberOfHyperNodes(), bpp::SubstitutionModelSet::getNumberOfModels(), bpp::MixedSubstitutionModelSet::HyperNode::getProbability(), bpp::SubstitutionModelSet::model(), bpp::MixedTransitionModelInterface::normalizeVRates(), bpp::MixedTransitionModelInterface::setNProbability(), bpp::MixedSubstitutionModelSet::HyperNode::setProbability(), and bpp::MixedSubstitutionModelSet::HyperNode::Node::size().
Referenced by bpp::LegacyPhylogeneticsApplicationTools::completeMixedSubstitutionModelSet(), and fireParameterChanged().
|
virtual |
To be called when a parameter has changed. Depending on parameters, this will actualize the _initialFrequencies vector or the corresponding models in the set.
parameters | The modified parameters. |
Reimplemented from bpp::SubstitutionModelSet.
Definition at line 155 of file MixedSubstitutionModelSet.cpp.
References computeHyperNodesProbabilities(), and bpp::SubstitutionModelSet::fireParameterChanged().
|
inlineinherited |
Definition at line 465 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::alphabet_.
|
inlineinherited |
index | The model state. |
Definition at line 512 of file SubstitutionModelSet.h.
References bpp::BranchModelInterface::getAlphabetStateAsChar(), and bpp::SubstitutionModelSet::model().
|
inlineinherited |
index | The model state. |
Definition at line 503 of file SubstitutionModelSet.h.
References bpp::BranchModelInterface::getAlphabetStateAsInt(), and bpp::SubstitutionModelSet::model().
|
inlineinherited |
Definition at line 474 of file SubstitutionModelSet.h.
References bpp::BranchModelInterface::getAlphabetStates(), and bpp::SubstitutionModelSet::model().
|
inline |
Definition at line 299 of file MixedSubstitutionModelSet.h.
References vpHyperNodes_.
Referenced by bpp::LegacyPhylogeneticsApplicationTools::completeMixedSubstitutionModelSet(), computeHyperNodesProbabilities(), and hasExclusivePaths().
|
inline |
Definition at line 301 of file MixedSubstitutionModelSet.h.
References vpHyperNodes_.
double MixedSubstitutionModelSet::getHyperNodeProbability | ( | const HyperNode & | hn | ) | const |
Definition at line 242 of file MixedSubstitutionModelSet.cpp.
References bpp::MixedSubstitutionModelSet::HyperNode::getNode(), bpp::MixedTransitionModelInterface::getNProbability(), bpp::SubstitutionModelSet::getNumberOfModels(), bpp::SubstitutionModelSet::model(), and bpp::MixedSubstitutionModelSet::HyperNode::Node::size().
|
inlineinherited |
Definition at line 222 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::modelSet_.
|
inlineinherited |
Get one model from the set knowing its index.
i | Index of the model in the set. |
Definition at line 210 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::modelSet_.
Referenced by bpp::LegacyPhylogeneticsApplicationTools::completeMixedSubstitutionModelSet(), bpp::SubstitutionModelSet::getSubstitutionModel(), bpp::SubstitutionModelSet::hasMixedTransitionModel(), and bpp::LegacyPhylogeneticsApplicationTools::printParameters().
|
inlineinherited |
Definition at line 308 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::modelSet_, bpp::SubstitutionModelSet::nodeToModel_, and bpp::TextTools::toString().
|
inlineinherited |
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. |
Definition at line 301 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::modelSet_, bpp::SubstitutionModelSet::nodeToModel_, and bpp::TextTools::toString().
Referenced by bpp::SubstitutionModelSet::getSubstitutionModelForNode().
|
inlineinherited |
Get the index in the set 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. |
Definition at line 286 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::nodeToModel_, and bpp::TextTools::toString().
|
inherited |
Get the parameters attached to a Model.
modelIndex | the index of the model in the set |
|
inlineinherited |
Definition at line 494 of file SubstitutionModelSet.h.
References bpp::BranchModelInterface::getModelStates(), and bpp::SubstitutionModelSet::model().
|
inlineinherited |
Definition at line 489 of file SubstitutionModelSet.h.
References bpp::BranchModelInterface::getModelStates(), and bpp::SubstitutionModelSet::model().
|
inlineinherited |
Get the parameters corresponding attached to the nodes of the tree.
That is, all the parameters without the root frequencies.
Definition at line 444 of file SubstitutionModelSet.h.
References bpp::ParameterList::addParameter(), bpp::AbstractParameterAliasable::getNumberOfParameters(), bpp::AbstractParameterAliasable::getParameter_(), bpp::SubstitutionModelSet::rootFrequencies_, and bpp::SubstitutionModelSet::stationarity_.
Referenced by bpp::SubstitutionModelSet::replaceModel().
|
inlineinherited |
Get a list of nodes id for which the given model is associated.
i | The index of the model in the set. |
IndexOutOfBoundsException | If the index is not valid. |
Definition at line 333 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::modelSet_, and bpp::SubstitutionModelSet::modelToNodes_.
Referenced by bpp::SubstitutionModelSet::getNodesWithParameter(), and bpp::LegacyPhylogeneticsApplicationTools::printParameters().
|
inherited |
name | The name of the parameter to look for. |
ParameterNotFoundException | If no parameter with the specified name is found. |
Definition at line 75 of file SubstitutionModelSet.cpp.
References bpp::AbstractParameterAliasable::getAlias(), bpp::SubstitutionModelSet::getNodesWithModel(), and bpp::AbstractParameterAliasable::hasParameter().
|
inline |
Definition at line 297 of file MixedSubstitutionModelSet.h.
References vpHyperNodes_.
Referenced by bpp::LegacyPhylogeneticsApplicationTools::completeMixedSubstitutionModelSet(), computeHyperNodesProbabilities(), and hasExclusivePaths().
|
inlineinherited |
Definition at line 196 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::modelSet_.
Referenced by addToHyperNode(), complete(), computeHyperNodesProbabilities(), getHyperNodeProbability(), bpp::SubstitutionModelSet::hasMixedTransitionModel(), and bpp::LegacyPhylogeneticsApplicationTools::printParameters().
|
inlineinherited |
Get the number of states associated to this model set.
Exception | if no model is associated to the set. |
Definition at line 181 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::nbStates_.
|
inlineinherited |
Definition at line 416 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::modelSet_, bpp::SubstitutionModelSet::rootFrequencies_, and bpp::SubstitutionModelSet::stationarity_.
|
inlineinherited |
Get the parameters corresponding to the root frequencies.
Definition at line 429 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::rootFrequencies_, and bpp::SubstitutionModelSet::stationarity_.
|
inlineinherited |
Definition at line 396 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::rootFrequencies_.
|
inlineinherited |
Definition at line 484 of file SubstitutionModelSet.h.
References bpp::BranchModelInterface::getStateMap(), and bpp::SubstitutionModelSet::model().
|
inlineinherited |
Definition at line 245 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::getModel(), and bpp::SubstitutionModelSet::model().
|
inlineinherited |
Return a markovian substitution model (or null)
Definition at line 236 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::getModel(), and bpp::SubstitutionModelSet::model().
Referenced by bpp::LegacySubstitutionMappingTools::getCountsPerBranch().
|
inlineinherited |
Definition at line 321 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::getModelForNode().
|
inlineinherited |
Definition at line 316 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::getModelForNode().
Referenced by bpp::LegacySubstitutionMappingTools::computeSubstitutionVectors().
bool MixedSubstitutionModelSet::hasExclusivePaths | ( | ) | const |
Definition at line 139 of file MixedSubstitutionModelSet.cpp.
References getHyperNode(), getNumberOfHyperNodes(), and bpp::MixedSubstitutionModelSet::HyperNode::intersects().
Referenced by bpp::LegacyPhylogeneticsApplicationTools::completeMixedSubstitutionModelSet().
|
inherited |
Definition at line 282 of file SubstitutionModelSet.cpp.
References bpp::SubstitutionModelSet::getModel(), bpp::SubstitutionModelSet::getNumberOfModels(), and bpp::SubstitutionModelSet::modelToNodes_.
|
inlineinherited |
check if has only markovian substitution models
Definition at line 269 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::model(), and bpp::SubstitutionModelSet::modelSet_.
|
inlineinherited |
Check if the model set is fully specified for a given tree.
This include:
tree | The tree to check. |
throwEx | Tell if an exception have to be thrown in case of test not passed. |
Definition at line 529 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::checkOrphanModels(), bpp::SubstitutionModelSet::checkOrphanNodes(), and bpp::SubstitutionModelSet::checkUnknownNodes().
|
inlineinherited |
Definition at line 154 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::stationarity_.
Referenced by bpp::LegacyPhylogeneticsApplicationTools::printParameters().
|
inherited |
Definition at line 201 of file SubstitutionModelSet.cpp.
References bpp::SubstitutionModelSet::modelSet_, and bpp::SubstitutionModelSet::modelToNodes_.
|
inlineinherited |
Definition at line 228 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::modelSet_.
|
inlineinherited |
Definition at line 216 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::modelSet_.
Referenced by bpp::SubstitutionModelSet::addModel(), complete(), computeHyperNodesProbabilities(), bpp::SubstitutionModelSet::getAlphabetStateAsChar(), bpp::SubstitutionModelSet::getAlphabetStateAsInt(), bpp::SubstitutionModelSet::getAlphabetStates(), getHyperNodeProbability(), bpp::SubstitutionModelSet::getModelStates(), bpp::SubstitutionModelSet::getStateMap(), bpp::SubstitutionModelSet::getSubstitutionModel(), bpp::SubstitutionModelSet::hasOnlySubstitutionModels(), bpp::SubstitutionModelSet::replaceModel(), bpp::SubstitutionModelSet::stateMap(), and bpp::SubstitutionModelSet::substitutionModel().
MixedSubstitutionModelSet & MixedSubstitutionModelSet::operator= | ( | const MixedSubstitutionModelSet & | set | ) |
Definition at line 44 of file MixedSubstitutionModelSet.cpp.
References bpp::SubstitutionModelSet::operator=(), and vpHyperNodes_.
|
inherited |
Replace a model in the set, and all corresponding parameters. The replaced model deleted.
modelIndex | The index of the model in the set. |
model | the new model. This model will be owned by the Set. |
Exception | if a parameter becomes orphan because of the removal. |
Definition at line 149 of file SubstitutionModelSet.cpp.
References bpp::AbstractParameterAliasable::addParameter_(), bpp::ParameterList::clone(), bpp::AbstractParameterAliasable::deleteParameter_(), bpp::AbstractParameterAliasable::getAlias(), bpp::SubstitutionModelSet::getNodeParameters(), bpp::ParameterList::getParameterNames(), bpp::ParameterAliasable::getParameters(), bpp::SubstitutionModelSet::model(), bpp::SubstitutionModelSet::modelParameters_, bpp::SubstitutionModelSet::modelSet_, bpp::ParameterList::parameter(), bpp::Parameter::setName(), bpp::ParameterList::size(), bpp::TextTools::toInt(), bpp::TextTools::toString(), and bpp::AbstractParameterAliasable::unaliasParameters().
|
inherited |
Reset model indices to node ids assignment.
Definition at line 132 of file SubstitutionModelSet.cpp.
References bpp::SubstitutionModelSet::modelToNodes_, and bpp::SubstitutionModelSet::nodeToModel_.
|
inlineinherited |
Definition at line 401 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::rootFrequencies_.
Referenced by bpp::LegacyPhylogeneticsApplicationTools::printParameters().
|
inherited |
Sets an assignment of a given model index to a given onde id.
modelIndex | The index of the model in the set. |
nodeId | The node ID |
Exception | if the model index doesn't correspond to an existing model in the modelSet |
Definition at line 140 of file SubstitutionModelSet.cpp.
References bpp::SubstitutionModelSet::modelSet_, bpp::SubstitutionModelSet::modelToNodes_, bpp::SubstitutionModelSet::nodeToModel_, and bpp::TextTools::toString().
|
inherited |
Sets a given FrequencySet for root frequencies.
rootFreqs | The FrequencySet for root frequencies. |
Definition at line 65 of file SubstitutionModelSet.cpp.
References bpp::AbstractParameterAliasable::addParameters_(), bpp::SubstitutionModelSet::rootFrequencies_, and bpp::SubstitutionModelSet::stationarity_.
Referenced by bpp::LegacyPhylogeneticsApplicationTools::setSubstitutionModelSet(), and bpp::SubstitutionModelSet::SubstitutionModelSet().
|
inlineinherited |
Definition at line 479 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::model(), and bpp::BranchModelInterface::stateMap().
|
inlineinherited |
Definition at line 253 of file SubstitutionModelSet.h.
References bpp::SubstitutionModelSet::model().
|
inlineprotectedinherited |
Set rootFrequencies_ from parameters.
Definition at line 541 of file SubstitutionModelSet.h.
References bpp::AbstractParameterAliasable::getParameters(), bpp::SubstitutionModelSet::rootFrequencies_, and bpp::SubstitutionModelSet::stationarity_.
Referenced by bpp::SubstitutionModelSet::fireParameterChanged().
|
protectedinherited |
A pointer toward the common alphabet to all models in the set.
Definition at line 74 of file SubstitutionModelSet.h.
Referenced by bpp::SubstitutionModelSet::addModel(), bpp::SubstitutionModelSet::alphabet(), bpp::SubstitutionModelSet::getAlphabet(), and bpp::SubstitutionModelSet::operator=().
|
privateinherited |
Parameters for each model in the set.
The parameters_ field, inherited from AbstractSubstitutionModel contains all parameters, with unique names. To make the correspondence with parameters for each model in the set, we duplicate them in this array. In most cases, this is something like 'theta_1 <=> theta', 'theta_2 <=> theta', etc.
Definition at line 102 of file SubstitutionModelSet.h.
Referenced by bpp::SubstitutionModelSet::addModel(), bpp::SubstitutionModelSet::clear(), bpp::SubstitutionModelSet::fireParameterChanged(), bpp::SubstitutionModelSet::operator=(), and bpp::SubstitutionModelSet::replaceModel().
|
protectedinherited |
Contains all models used in this tree.
Definition at line 81 of file SubstitutionModelSet.h.
Referenced by bpp::SubstitutionModelSet::addModel(), bpp::SubstitutionModelSet::checkOrphanModels(), bpp::SubstitutionModelSet::clear(), bpp::SubstitutionModelSet::fireParameterChanged(), bpp::SubstitutionModelSet::getModel(), bpp::SubstitutionModelSet::getModelForNode(), bpp::SubstitutionModelSet::getNodesWithModel(), bpp::SubstitutionModelSet::getNumberOfModels(), bpp::SubstitutionModelSet::getRootFrequencies(), bpp::SubstitutionModelSet::hasOnlySubstitutionModels(), bpp::SubstitutionModelSet::listModelNames(), bpp::SubstitutionModelSet::model(), bpp::SubstitutionModelSet::operator=(), bpp::SubstitutionModelSet::replaceModel(), bpp::SubstitutionModelSet::setNodeToModel(), and bpp::SubstitutionModelSet::SubstitutionModelSet().
|
mutableprivateinherited |
Definition at line 93 of file SubstitutionModelSet.h.
Referenced by bpp::SubstitutionModelSet::addModel(), bpp::SubstitutionModelSet::checkUnknownNodes(), bpp::SubstitutionModelSet::getNodesWithModel(), bpp::SubstitutionModelSet::hasMixedTransitionModel(), bpp::SubstitutionModelSet::listModelNames(), bpp::SubstitutionModelSet::operator=(), bpp::SubstitutionModelSet::resetModelToNodeIds(), and bpp::SubstitutionModelSet::setNodeToModel().
|
protectedinherited |
Definition at line 76 of file SubstitutionModelSet.h.
Referenced by bpp::SubstitutionModelSet::addModel(), bpp::SubstitutionModelSet::clear(), bpp::SubstitutionModelSet::getNumberOfStates(), and bpp::SubstitutionModelSet::operator=().
|
mutableprivateinherited |
Contains for each node in a tree the index of the corresponding model in modelSet_.
Definition at line 92 of file SubstitutionModelSet.h.
Referenced by bpp::SubstitutionModelSet::addModel(), bpp::SubstitutionModelSet::checkOrphanModels(), bpp::SubstitutionModelSet::checkOrphanNodes(), bpp::SubstitutionModelSet::clear(), bpp::SubstitutionModelSet::getModelForNode(), bpp::SubstitutionModelSet::getModelIndexForNode(), bpp::SubstitutionModelSet::operator=(), bpp::SubstitutionModelSet::resetModelToNodeIds(), and bpp::SubstitutionModelSet::setNodeToModel().
|
privateinherited |
Root frequencies.
Definition at line 87 of file SubstitutionModelSet.h.
Referenced by bpp::SubstitutionModelSet::clear(), bpp::SubstitutionModelSet::getNodeParameters(), bpp::SubstitutionModelSet::getRootFrequencies(), bpp::SubstitutionModelSet::getRootFrequenciesParameters(), bpp::SubstitutionModelSet::getRootFrequencySet(), bpp::SubstitutionModelSet::operator=(), bpp::SubstitutionModelSet::rootFrequencySet(), bpp::SubstitutionModelSet::setRootFrequencies(), and bpp::SubstitutionModelSet::updateRootFrequencies().
|
privateinherited |
Definition at line 104 of file SubstitutionModelSet.h.
Referenced by bpp::SubstitutionModelSet::clear(), bpp::SubstitutionModelSet::getNodeParameters(), bpp::SubstitutionModelSet::getRootFrequencies(), bpp::SubstitutionModelSet::getRootFrequenciesParameters(), bpp::SubstitutionModelSet::isStationary(), bpp::SubstitutionModelSet::operator=(), bpp::SubstitutionModelSet::setRootFrequencies(), and bpp::SubstitutionModelSet::updateRootFrequencies().
|
private |
Definition at line 231 of file MixedSubstitutionModelSet.h.
Referenced by addEmptyHyperNode(), addHyperNode(), addToHyperNode(), clear(), complete(), getHyperNode(), getNumberOfHyperNodes(), MixedSubstitutionModelSet(), operator=(), and ~MixedSubstitutionModelSet().