5 #ifndef BPP_PHYL_LIKELIHOOD_SUBSTITUTIONPROCESSCOLLECTIONMEMBER_H
6 #define BPP_PHYL_LIKELIHOOD_SUBSTITUTIONPROCESSCOLLECTIONMEMBER_H
19 class SubstitutionProcessCollection;
150 throw NullPointerException(
"SubstitutionProcessCollectionMember::collection(). Member is not associated to any collection.");
157 throw NullPointerException(
"SubstitutionProcessCollectionMember::collection(). Member is not associated to any collection.");
183 std::shared_ptr<const StateMapInterface>
getStateMap()
const override
216 std::shared_ptr<const BranchModelInterface>
getModel(
size_t n)
const override;
218 std::shared_ptr<BranchModelInterface>
getModel(
size_t n);
233 throw Exception(
"SubstitutionProcessCollectionMember::getModelNumberForNode(). No model associated to node with id " +
TextTools::toString(nodeId));
244 std::shared_ptr<const BranchModelInterface>
getModelForNode(
unsigned int nodeId)
const override
246 std::map<unsigned int, size_t>::const_iterator i =
nodeToModel_.find(nodeId);
248 throw Exception(
"SubstitutionProcessCollectionMember::getModelForNode(). No model associated to node with id " +
TextTools::toString(nodeId));
275 void addModel(
size_t numModel,
const std::vector<unsigned int>& nodesId);
391 std::shared_ptr<const BranchModelInterface>
getModel(
unsigned int nodeId,
size_t classIndex)
const override
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
A partial implementation of the SubstitutionProcess interface.
Interface for all Branch models.
virtual std::shared_ptr< const StateMapInterface > getStateMap() const =0
virtual const StateMapInterface & stateMap() const =0
Parametrize a set of state frequencies.
PhyloTree with Parametrizable Phylo Branches. They SHARE their branch length parameters.
Map the states of a given alphabet which have a model state.
const size_t getModelScenarioNumber() const
void updateParameters()
sets the parameters as the independent parameters on the objects
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.
size_t getNumberOfProcesses() const
std::vector< size_t > getModelNumbers() const override
std::shared_ptr< const DiscreteDistributionInterface > getRateDistribution() const override
Get a pointer to the rate distribution (or null if there is no rate distribution).
const DiscreteDistributionInterface & rateDistribution() const override
Get the rate distribution.
bool hasRootFrequencySet() const override
size_t nPath_
the number of the set of model path, if needed.
SubstitutionProcessCollection * getCollection()
SubstitutionProcessCollectionMember(SubstitutionProcessCollection *pSubProColl, size_t nProc, size_t nTree, size_t nDist)
Create a model set belonging to the specified SubstitutionProcessCollection. Stationarity is assumed.
size_t nRoot_
The number of the root frequencies (0 if the process is stationary).
bool isFullySetUp(bool throwEx=true) const
Check if the model set is fully specified for a given tree.
const FrequencySetInterface & rootFrequencySet() const override
size_t nProc_
The number of the process in the collection.
bool hasMixedTransitionModel() const
std::map< size_t, std::vector< unsigned int > > modelToNodes_
const SubstitutionProcessCollection * getCollection() const
ParameterList getBranchLengthParameters(bool independent) const override
Get the parameters of the tree.
void setTreeNumber(size_t nTree, bool check=true)
bool isStationary() const
const StateMapInterface & stateMap() const override
double getRateForModel(size_t classIndex) const override
bool matchParametersValues(const ParameterList ¶meters) override
AbsractParametrizable interface.
virtual ~SubstitutionProcessCollectionMember()
const BranchModelInterface & model(size_t n) const override
std::shared_ptr< const ModelScenario > getModelScenario() const override
Get the Model Scenario associated with this process, in case there are mixture models involved.
size_t nTree_
The number of the tree: 0 means no assigned tree.
const std::vector< unsigned int > getNodesWithModel(size_t i) const override
Get a list of nodes id for which the given model is associated.
SubstitutionProcessCollection & collection()
SubstitutionProcessCollectionMember(const SubstitutionProcessCollectionMember &set)
Resets all the information contained in this object.
void addModel(size_t numModel, const std::vector< unsigned int > &nodesId)
Add a new model to the set, and set relationships with nodes.
std::shared_ptr< const FrequencySetInterface > getRootFrequencySet() const override
std::shared_ptr< const BranchModelInterface > getModel(size_t n) const override
size_t getNumberOfModels() const override
std::shared_ptr< const StateMapInterface > getStateMap() const override
ParameterList getSubstitutionModelParameters(bool independent) const override
Get the parameters of the substitution models.
const std::vector< double > & getRootFrequencies() const override
ParameterList getRateDistributionParameters(bool independent) const override
Get the parameters of the rate distribution.
std::shared_ptr< const ParametrizablePhyloTree > getParametrizablePhyloTree() const override
void setModelScenario(size_t numPath)
Vdouble getClassProbabilities() const override
bool checkUnknownNodes(bool throwEx) const
size_t nDist_
The number of the rate distribution.
const ParametrizablePhyloTree & parametrizablePhyloTree() const override
bool checkOrphanNodes(bool throwEx) const
std::map< unsigned int, size_t > nodeToModel_
Contains for each node in a tree the index of the corresponding model in modelSet_.
std::shared_ptr< const BranchModelInterface > getModelForNode(unsigned int nodeId) const override
Get the model associated to a particular node id.
void setRootFrequencies(size_t numFreq)
Set the root Frequencies Set.
SubstitutionProcessCollectionMember & operator=(const SubstitutionProcessCollectionMember &set)
const size_t getRootFrequenciesNumber() const
ParameterList getNonDerivableParameters() const override
get all NonDerivable parameters.
size_t getTreeNumber() const
const SubstitutionProcessCollection & collection() const
ParameterList getRootFrequenciesParameters(bool independent) const override
Get the parameters of the root frequencies set.
SubstitutionProcessCollection * pSubProColl_
A pointer towards the collection the SubstitutionProcessCollectionMember belongs to.
size_t getModelNumberForNode(unsigned int nodeId) const override
Get the number of the model associated to a particular node id.
SubstitutionProcessCollectionMember * clone() const override
const size_t getRateDistributionNumber() const
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.
double getProbabilityForModel(size_t classIndex) const override
Collection of Substitution Process, which owns all the necessary objects: Substitution models,...
std::string toString(T t)
Defines the basic types of data flow nodes.
std::vector< double > Vdouble
void operator()(SubstitutionProcessCollectionMember *sm) const