bpp-phyl  2.1.0
 All Classes Namespaces Files Functions Variables Friends Pages
bpp::SubstitutionModelSet Class Reference

Substitution models manager for non-homogeneous / non-reversible models of evolution. More...

#include <Bpp/Phyl/Model/SubstitutionModelSet.h>

+ Inheritance diagram for bpp::SubstitutionModelSet:
+ Collaboration diagram for bpp::SubstitutionModelSet:

Public Member Functions

 SubstitutionModelSet (const Alphabet *alpha)
 Create a model set according to the specified alphabet. Stationarity is assumed. More...
 
 SubstitutionModelSet (const Alphabet *alpha, FrequenciesSet *rootFreqs)
 Create a model set according to the specified alphabet and root frequencies. Stationarity is not assumed. More...
 
void clear ()
 Resets all the information contained in this object. More...
 
void setRootFrequencies (FrequenciesSet *rootFreqs)
 Sets a given FrequenciesSet for root frequencies. More...
 
 SubstitutionModelSet (const SubstitutionModelSet &set)
 
SubstitutionModelSetoperator= (const SubstitutionModelSet &set)
 
virtual ~SubstitutionModelSet ()
 
SubstitutionModelSetclone () const
 
size_t getNumberOfStates () const throw (Exception)
 Get the number of states associated to this model set. More...
 
size_t getParameterIndex (const std::string &name) const throw (ParameterNotFoundException)
 Get the index of a given parameter in the list of all parameters. More...
 
std::string getParameterModelName (const std::string &name) const throw (ParameterNotFoundException, Exception)
 Get the model name of a given parameter in the list of all parameters. More...
 
virtual void fireParameterChanged (const ParameterList &parameters)
 
size_t getNumberOfModels () const
 
bool hasMixedSubstitutionModel () const
 
const SubstitutionModelgetModel (size_t i) const throw (IndexOutOfBoundsException)
 Get one model from the set knowing its index. More...
 
SubstitutionModelgetModel (size_t i) throw (IndexOutOfBoundsException)
 
size_t getModelIndexForNode (int nodeId) const throw (Exception)
 Get the index in the set of the model associated to a particular node id. More...
 
const SubstitutionModelgetModelForNode (int nodeId) const throw (Exception)
 Get the model associated to a particular node id. More...
 
SubstitutionModelgetModelForNode (int nodeId) throw (Exception)
 
const std::vector< int > & getNodesWithModel (size_t i) const throw (IndexOutOfBoundsException)
 Get a list of nodes id for which the given model is associated. More...
 
std::vector< int > getNodesWithParameter (const std::string &name) const throw (ParameterNotFoundException)
 
std::vector< size_t > getModelsWithParameter (const std::string &name) const throw (ParameterNotFoundException)
 
void addModel (SubstitutionModel *model, const std::vector< int > &nodesId, const std::vector< std::string > &newParams) throw (Exception)
 Add a new model to the set, and set relationships with nodes and params. More...
 
void setModel (SubstitutionModel *model, size_t modelIndex) throw (Exception, IndexOutOfBoundsException)
 Change a given model. More...
 
void setModelToNode (size_t modelIndex, int nodeNumber) throw (IndexOutOfBoundsException)
 Associate an existing model with a given node. More...
 
void setParameterToModel (size_t parameterIndex, size_t modelIndex) throw (IndexOutOfBoundsException)
 Assign a parameter to a model. More...
 
void unsetParameterToModel (size_t parameterIndex, size_t modelIndex) throw (IndexOutOfBoundsException, Exception)
 Unset a given parameter to the specified model. More...
 
void addParameter (const Parameter &parameter, const std::vector< int > &nodesId) throw (Exception)
 Add a parameter to the list, and link it to specified existing nodes. More...
 
void addParameters (const ParameterList &parameters, const std::vector< int > &nodesId) throw (Exception)
 Add several parameters to the list, and link them to specified existing nodes. More...
 
void removeParameter (const std::string &name) throw (ParameterNotFoundException)
 Remove a parameter from the list, and unset it to all linked nodes and models. More...
 
void removeModel (size_t modelIndex) throw (Exception)
 Remove a model from the set, and all corresponding parameters. More...
 
void listModelNames (std::ostream &out=std::cout) const
 
const FrequenciesSetgetRootFrequenciesSet () 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...
 
const AlphabetgetAlphabet () const
 
bool isFullySetUpFor (const Tree &tree, bool throwEx=true) const throw (Exception)
 Check if the model set is fully specified for a given tree. More...
 
void setNamespace (const std::string &prefix)
 
const ParameterListgetIndependentParameters () const
 
size_t getNumberOfIndependentParameters () const
 
void aliasParameters (const std::string &p1, const std::string &p2)
 
void unaliasParameters (const std::string &p1, const std::string &p2)
 
std::vector< std::string > getAlias (const std::string &name) const
 
bool hasParameter (const std::string &name) const
 
const ParameterListgetParameters () const
 
const ParametergetParameter (const std::string &name) const
 
double getParameterValue (const std::string &name) const
 
void setAllParametersValues (const ParameterList &parameters)
 
void setParameterValue (const std::string &name, double value)
 
void setParametersValues (const ParameterList &parameters)
 
bool matchParametersValues (const ParameterList &parameters)
 
size_t getNumberOfParameters () const
 
std::string getNamespace () const
 
std::string getParameterNameWithoutNamespace (const std::string &name) const
 

Protected Member Functions

void updateRootFrequencies ()
 
void addParameter_ (Parameter *parameter)
 
void addParameters_ (const ParameterList &parameters)
 
void deleteParameter_ (size_t index)
 
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_ ()
 
Check function.
bool checkOrphanModels (bool throwEx) const throw (Exception)
 
bool checkOrphanParameters (bool throwEx) const throw (Exception)
 
bool checkOrphanNodes (const Tree &tree, bool throwEx) const throw (Exception)
 
bool checkUnknownNodes (const Tree &tree, bool throwEx) const throw (Exception)
 

Protected Attributes

const Alphabetalphabet_
 A pointer toward the common alphabet to all models in the set. More...
 
size_t nbStates_
 
std::vector< SubstitutionModel * > modelSet_
 Contains all models used in this tree. More...
 

Private Attributes

std::auto_ptr< FrequenciesSetrootFrequencies_
 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< std::vector
< size_t > > 
paramToModels_
 Contains for each parameter in the list the indexes of the corresponding models in modelSet_ that share this parameter. More...
 
std::map< std::string, size_t > paramNamesCount_
 
std::vector< std::string > modelParameterNames_
 Contains for each parameter in the list the corresponding name in substitution models. More...
 
std::vector< ParameterListmodelParameters_
 Parameters for each model in the set. More...
 
bool stationarity_
 

Detailed Description

Substitution models manager for non-homogeneous / non-reversible models of evolution.

This class contains a set of substitution models, and their assigment 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. In the homogeneous case, the parameter list is the same as the list in susbstitution model. When two models at least are specified, these models may have their own parameters or share some of them. To deal with this issue, the SubstitutionModelSet 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, duplicated names are numbered according to the order 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. Theses are accounted by a FrequenciesSet objet, managed by the SubstitutionModelSet class. The corresponding parameters, if any, are added at the begining 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 "asumme stationarity" option is set when building the set, then no FrequenciesSet 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 "supposingly 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 carefull!

See Also
SubstitutionModelSetTools for methods that provide instances of the SubstitutionModelSet for general cases.

Definition at line 99 of file SubstitutionModelSet.h.

Constructor & Destructor Documentation

bpp::SubstitutionModelSet::SubstitutionModelSet ( const Alphabet alpha)
inline

Create a model set according to the specified alphabet. Stationarity is assumed.

Parameters
alphaThe alphabet to use for this set.

Definition at line 157 of file SubstitutionModelSet.h.

Referenced by clone().

bpp::SubstitutionModelSet::SubstitutionModelSet ( const Alphabet alpha,
FrequenciesSet rootFreqs 
)
inline

Create a model set according to the specified alphabet and root frequencies. Stationarity is not assumed.

Parameters
alphaThe alphabet to use for this set.
rootFreqsThe frequencies at root node. The underlying object will be owned by this instance.

Definition at line 180 of file SubstitutionModelSet.h.

References setRootFrequencies().

SubstitutionModelSet::SubstitutionModelSet ( const SubstitutionModelSet set)

Definition at line 49 of file SubstitutionModelSet.cpp.

References modelSet_.

virtual bpp::SubstitutionModelSet::~SubstitutionModelSet ( )
inlinevirtual

Definition at line 216 of file SubstitutionModelSet.h.

References modelSet_, and modelSet_.

Member Function Documentation

void SubstitutionModelSet::addModel ( SubstitutionModel model,
const std::vector< int > &  nodesId,
const std::vector< std::string > &  newParams 
) throw (Exception)

Add a new model to the set, and set relationships with nodes and params.

Parameters
modelA 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!
nodesIdthe set of nodes in the tree that points toward this model. This will override any previous affectation.
newParamsThe names of the parameters that have to be added to the global list. These parameters will only be affected to this susbstitution model. You can use the setParameterToModel function to assign this parameter to an additional model, and the unsetParameterToModel to remove the relationship with this model for instance. Parameters not specified in newParams will be ignored, unless you manually assign them to another parameter with setParameterToModel.
Exceptions
Exceptionin case of error:
  • if the new model does not match the alphabet
  • if the new model does not have the same number of states than existing ones
  • etc.

Definition at line 157 of file SubstitutionModelSet.cpp.

References bpp::Parameter::clone(), and bpp::TextTools::toString().

Referenced by bpp::SubstitutionModelSetTools::createHomogeneousModelSet(), bpp::SubstitutionModelSetTools::createNonHomogeneousModelSet(), and bpp::PhylogeneticsApplicationTools::setSubstitutionModelSet().

void SubstitutionModelSet::addParameter ( const Parameter parameter,
const std::vector< int > &  nodesId 
) throw (Exception)

Add a parameter to the list, and link it to specified existing nodes.

Parameters
parameterThe parameter to add. Its name must match model parameter names.
nodesIdThe list of ids of the nodes to link with these parameters. Nodes must have a corresponding model in the set.
Exceptions
ExceptionIf one of the above requirement is not true.

Definition at line 288 of file SubstitutionModelSet.cpp.

References bpp::Parameter::clone(), bpp::TextTools::toString(), and bpp::TextTools::toString().

void SubstitutionModelSet::addParameters ( const ParameterList parameters,
const std::vector< int > &  nodesId 
) throw (Exception)

Add several parameters to the list, and link them to specified existing nodes.

Parameters
parametersThe list of parameters to add. Its name must match model parameter names.
nodesIdThe list of ids of the nodes to link with these parameters. Nodes must have a corresponding model in the set.
Exceptions
ExceptionIf one of the above requirement is not true.

Definition at line 309 of file SubstitutionModelSet.cpp.

References bpp::ParameterList::size(), bpp::ParameterList::size(), bpp::TextTools::toString(), and bpp::TextTools::toString().

Referenced by bpp::SubstitutionModelSetTools::createNonHomogeneousModelSet().

bool SubstitutionModelSet::checkOrphanModels ( bool  throwEx) const throw (Exception)
protected
bool SubstitutionModelSet::checkOrphanNodes ( const Tree tree,
bool  throwEx 
) const throw (Exception)
protected

Definition at line 425 of file SubstitutionModelSet.cpp.

References bpp::TextTools::toString().

Referenced by isFullySetUpFor().

bool SubstitutionModelSet::checkOrphanParameters ( bool  throwEx) const throw (Exception)
protected

Definition at line 411 of file SubstitutionModelSet.cpp.

Referenced by isFullySetUpFor().

bool SubstitutionModelSet::checkUnknownNodes ( const Tree tree,
bool  throwEx 
) const throw (Exception)
protected

Definition at line 441 of file SubstitutionModelSet.cpp.

References bpp::VectorTools::contains(), and bpp::TextTools::toString().

Referenced by isFullySetUpFor().

SubstitutionModelSet* bpp::SubstitutionModelSet::clone ( ) const
inlinevirtual

Implements bpp::Clonable.

Definition at line 226 of file SubstitutionModelSet.h.

References SubstitutionModelSet().

void SubstitutionModelSet::fireParameterChanged ( const ParameterList parameters)
virtual
const Alphabet* bpp::SubstitutionModelSet::getAlphabet ( ) const
inline

Definition at line 541 of file SubstitutionModelSet.h.

References alphabet_.

Referenced by bpp::NonHomogeneousSequenceSimulator::dSimulate().

SubstitutionModel* bpp::SubstitutionModelSet::getModel ( size_t  i) throw (IndexOutOfBoundsException)
inline

Definition at line 307 of file SubstitutionModelSet.h.

References modelSet_, modelSet_, and modelSet_.

const SubstitutionModel* bpp::SubstitutionModelSet::getModelForNode ( int  nodeId) const throw (Exception)
inline
SubstitutionModel* bpp::SubstitutionModelSet::getModelForNode ( int  nodeId) throw (Exception)
inline
size_t bpp::SubstitutionModelSet::getModelIndexForNode ( int  nodeId) const throw (Exception)
inline

Get the index in the set of the model associated to a particular node id.

Parameters
nodeIdThe id of the query node.
Returns
The index of the model associated to the given node.
Exceptions
ExceptionIf no model is found for this node.

Definition at line 320 of file SubstitutionModelSet.h.

References nodeToModel_, nodeToModel_, and bpp::TextTools::toString().

Referenced by bpp::RNonHomogeneousMixedTreeLikelihood::computeTransitionProbabilitiesForNode().

ParameterList SubstitutionModelSet::getModelParameters ( size_t  modelIndex) const

Get the parameters attached to a Model.

Parameters
modelIndexthe index of the model in the set
Returns
The parameters attached to the model.

Definition at line 220 of file SubstitutionModelSet.cpp.

References bpp::ParameterList::addParameter(), modelParameterNames_, paramToModels_, rootFrequencies_, and stationarity_.

vector< size_t > SubstitutionModelSet::getModelsWithParameter ( const std::string &  name) const throw (ParameterNotFoundException)
Parameters
nameThe name of the parameter to look for.
Returns
The list of model indices containing the specified parameter.
Exceptions
ParameterNotFoundExceptionIf no parameter with the specified name is found.

Definition at line 144 of file SubstitutionModelSet.cpp.

Referenced by bpp::PhylogeneticsApplicationTools::printParameters(), and bpp::PhylogeneticsApplicationTools::setSubstitutionModelSet().

ParameterList bpp::SubstitutionModelSet::getNodeParameters ( ) const
inline

Get the parameters corresponding attached to the nodes of the tree.

That is, all the parameters without the root frequencies.

Returns
The parameters attached to the nodes of the tree.

Definition at line 520 of file SubstitutionModelSet.h.

References bpp::ParameterList::addParameter(), bpp::AbstractParameterAliasable::getNumberOfParameters(), rootFrequencies_, and stationarity_.

Referenced by bpp::DRNonHomogeneousTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::fireParameterChanged(), and bpp::RNonHomogeneousMixedTreeLikelihood::fireParameterChanged().

const std::vector<int>& bpp::SubstitutionModelSet::getNodesWithModel ( size_t  i) const throw (IndexOutOfBoundsException)
inline

Get a list of nodes id for which the given model is associated.

Parameters
iThe index of the model in the set.
Returns
A vector with the ids of the node associated to this model.
Exceptions
IndexOutOfBoundsExceptionIf the index is not valid.

Definition at line 357 of file SubstitutionModelSet.h.

References modelSet_, modelSet_, and modelToNodes_.

Referenced by bpp::AbstractNonHomogeneousTreeLikelihood::ConstNonHomogeneousSiteModelIterator::ConstNonHomogeneousSiteModelIterator(), bpp::RNonHomogeneousMixedTreeLikelihood::init(), and bpp::PhylogeneticsApplicationTools::printParameters().

std::vector< int > SubstitutionModelSet::getNodesWithParameter ( const std::string &  name) const throw (ParameterNotFoundException)
Parameters
nameThe name of the parameter to look for.
Returns
The list of nodes with a model containing the specified parameter.
Exceptions
ParameterNotFoundExceptionIf no parameter with the specified name is found.

Definition at line 124 of file SubstitutionModelSet.cpp.

References bpp::VectorTools::append().

Referenced by bpp::DRNonHomogeneousTreeLikelihood::fireParameterChanged(), bpp::RNonHomogeneousTreeLikelihood::fireParameterChanged(), and bpp::RNonHomogeneousMixedTreeLikelihood::fireParameterChanged().

size_t bpp::SubstitutionModelSet::getNumberOfStates ( ) const throw (Exception)
inline

Get the number of states associated to this model set.

Returns
The number of states.
Exceptions
Exceptionif no model is associated to the set.

Definition at line 235 of file SubstitutionModelSet.h.

References nbStates_.

size_t bpp::SubstitutionModelSet::getParameterIndex ( const std::string &  name) const throw (ParameterNotFoundException)
inline

Get the index of a given parameter in the list of all parameters.

Parameters
nameThe name of the parameter to look for.
Returns
The position of the parameter in the global parameter list.
Exceptions
ParameterNotFoundExceptionIf no parameter with this name is found.

Definition at line 247 of file SubstitutionModelSet.h.

References bpp::AbstractParameterAliasable::getNumberOfParameters(), and bpp::AbstractParameterAliasable::getParameter_().

Referenced by getParameterModelName(), and bpp::PhylogeneticsApplicationTools::setSubstitutionModelSet().

std::string bpp::SubstitutionModelSet::getParameterModelName ( const std::string &  name) const throw (ParameterNotFoundException, Exception)
inline

Get the model name of a given parameter in the list of all parameters.

Parameters
nameThe name of the parameter to look for.
Returns
The model name of the parameter in the global parameter list.
Exceptions
ParameterNotFoundExceptionIf no parameter with this name is found.
ExceptionIf the parameter is not a 'model' parameter (that is, it is a root frequency parameter).

Definition at line 264 of file SubstitutionModelSet.h.

References getParameterIndex(), modelParameterNames_, modelParameterNames_, rootFrequencies_, and stationarity_.

Referenced by bpp::PhylogeneticsApplicationTools::printParameters(), and bpp::PhylogeneticsApplicationTools::printParameters().

ParameterList bpp::SubstitutionModelSet::getRootFrequenciesParameters ( ) const
inline

Get the parameters corresponding to the root frequencies.

Returns
The parameters corresponding to the root frequencies.

Definition at line 505 of file SubstitutionModelSet.h.

References rootFrequencies_, and stationarity_.

Referenced by bpp::AbstractNonHomogeneousTreeLikelihood::getRootFrequenciesParameters(), and bpp::PhylogeneticsApplicationTools::printParameters().

const FrequenciesSet* bpp::SubstitutionModelSet::getRootFrequenciesSet ( ) const
inline
Returns
The set of root frequencies.

Definition at line 487 of file SubstitutionModelSet.h.

References rootFrequencies_.

Referenced by bpp::PhylogeneticsApplicationTools::printParameters().

bool SubstitutionModelSet::hasMixedSubstitutionModel ( ) const
bool bpp::SubstitutionModelSet::isFullySetUpFor ( const Tree tree,
bool  throwEx = true 
) const throw (Exception)
inline

Check if the model set is fully specified for a given tree.

This include:

  • that each node as a model set up,
  • that each model in the set is attributed to a node,
  • that each parameter in the set actually correspond to a model.
  • all nodes ids in the set refer to an existing node in the tree.
Parameters
treeThe tree to check.
throwExTell if an exception have to be thrown in case of test not passed.

Definition at line 555 of file SubstitutionModelSet.h.

References checkOrphanModels(), checkOrphanNodes(), checkOrphanParameters(), and checkUnknownNodes().

Referenced by bpp::RNonHomogeneousMixedTreeLikelihood::RNonHomogeneousMixedTreeLikelihood(), and bpp::RNonHomogeneousMixedTreeLikelihood::RNonHomogeneousMixedTreeLikelihood().

void SubstitutionModelSet::listModelNames ( std::ostream &  out = std::cout) const

Definition at line 240 of file SubstitutionModelSet.cpp.

References modelSet_, modelSet_, modelToNodes_, and modelToNodes_.

void SubstitutionModelSet::removeModel ( size_t  modelIndex) throw (Exception)

Remove a model from the set, and all corresponding parameters.

Parameters
modelIndexThe index of the model in the set.
Exceptions
Exceptionif a parameter becomes orphan because of the removal.

Definition at line 201 of file SubstitutionModelSet.cpp.

void SubstitutionModelSet::removeParameter ( const std::string &  name) throw (ParameterNotFoundException)

Remove a parameter from the list, and unset it to all linked nodes and models.

Parameters
nameThe name of the parameter to remove.
Exceptions
ParameterNotFoundExceptionIf no parameter with the given name is found in the list.

Definition at line 342 of file SubstitutionModelSet.cpp.

void SubstitutionModelSet::setModel ( SubstitutionModel model,
size_t  modelIndex 
) throw (Exception, IndexOutOfBoundsException)

Change a given model.

The new model will be copied and will replace the old one. All previous associations will be kept the same.

Parameters
modelA 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!
modelIndexThe index of the existing model to replace.

Definition at line 191 of file SubstitutionModelSet.cpp.

void bpp::SubstitutionModelSet::setModelToNode ( size_t  modelIndex,
int  nodeNumber 
) throw (IndexOutOfBoundsException)
inline

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.

Parameters
modelIndexThe position of the model in the set.
nodeNumberThe id of the corresponding node.

Definition at line 421 of file SubstitutionModelSet.h.

References nodeToModel_, nodeToModel_, and nodeToModel_.

void SubstitutionModelSet::setParameterToModel ( size_t  parameterIndex,
size_t  modelIndex 
) throw (IndexOutOfBoundsException)

Assign a parameter to a model.

Parameters
parameterIndexThe index of the parameter in the list.
modelIndexThe index of the model in the list.
Exceptions
IndexOutOfBoundsExceptionIf one of the index is not valid.

Definition at line 253 of file SubstitutionModelSet.cpp.

References bpp::VectorTools::contains(), and bpp::TextTools::toString().

Referenced by bpp::PhylogeneticsApplicationTools::setSubstitutionModelSet().

void SubstitutionModelSet::unsetParameterToModel ( size_t  parameterIndex,
size_t  modelIndex 
) throw (IndexOutOfBoundsException, Exception)

Unset a given parameter to the specified model.

Parameters
parameterIndexThe index of the parameter in the list.
modelIndexThe index of the model in the list.
Exceptions
IndexOutOfBoundsExceptionIf one of the index is not valid.
ExceptionIf the pseicified parameter is not currently associated to the specified model.

Definition at line 271 of file SubstitutionModelSet.cpp.

References bpp::VectorTools::contains(), and bpp::TextTools::toString().

void bpp::SubstitutionModelSet::updateRootFrequencies ( )
inlineprotected

Set rootFrequencies_ from parameters.

Definition at line 567 of file SubstitutionModelSet.h.

References rootFrequencies_, and stationarity_.

Referenced by fireParameterChanged().

Member Data Documentation

const Alphabet* bpp::SubstitutionModelSet::alphabet_
protected

A pointer toward the common alphabet to all models in the set.

Definition at line 106 of file SubstitutionModelSet.h.

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

std::vector<std::string> bpp::SubstitutionModelSet::modelParameterNames_
private

Contains for each parameter in the list the corresponding name in substitution models.

Definition at line 137 of file SubstitutionModelSet.h.

Referenced by clear(), fireParameterChanged(), fireParameterChanged(), fireParameterChanged(), fireParameterChanged(), getModelParameters(), getParameterModelName(), getParameterModelName(), and operator=().

std::vector<ParameterList> bpp::SubstitutionModelSet::modelParameters_
private

Parameters for each model in the set.

The parameters_ field, inherited from AbstractSubstitutionModel contains all parameters, with unique names. To make the correspondance 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 146 of file SubstitutionModelSet.h.

Referenced by clear(), fireParameterChanged(), fireParameterChanged(), fireParameterChanged(), fireParameterChanged(), and operator=().

std::map<size_t, std::vector<int> > bpp::SubstitutionModelSet::modelToNodes_
mutableprivate
size_t bpp::SubstitutionModelSet::nbStates_
protected

Definition at line 108 of file SubstitutionModelSet.h.

Referenced by clear(), getNumberOfStates(), and operator=().

std::map<int, size_t> bpp::SubstitutionModelSet::nodeToModel_
mutableprivate

Contains for each node in a tree the index of the corresponding model in modelSet_.

Definition at line 124 of file SubstitutionModelSet.h.

Referenced by clear(), getModelForNode(), getModelForNode(), getModelForNode(), getModelForNode(), getModelIndexForNode(), getModelIndexForNode(), operator=(), setModelToNode(), setModelToNode(), and setModelToNode().

std::map<std::string, size_t> bpp::SubstitutionModelSet::paramNamesCount_
private

Definition at line 132 of file SubstitutionModelSet.h.

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

std::vector< std::vector<size_t> > bpp::SubstitutionModelSet::paramToModels_
private

Contains for each parameter in the list the indexes of the corresponding models in modelSet_ that share this parameter.

Definition at line 130 of file SubstitutionModelSet.h.

Referenced by clear(), fireParameterChanged(), getModelParameters(), and operator=().


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