5 #ifndef BPP_PHYL_MAPPING_PHYLOMAPPINGS_ABSTRACTSINGLEPHYLOSUBSTITUTIONMAPPING_H
6 #define BPP_PHYL_MAPPING_PHYLOMAPPINGS_ABSTRACTSINGLEPHYLOSUBSTITUTIONMAPPING_H
12 #include "../../Tree/PhyloTree.h"
13 #include "../BranchedModelSet.h"
14 #include "../ProbabilisticSubstitutionMapping.h"
21 std::shared_ptr<TransitionModelInterface>
pMod_;
38 std::shared_ptr<const SubstitutionRegisterInterface>
pReg_;
44 std::shared_ptr<const AlphabetIndex2>
weights_;
53 std::unique_ptr<ProbabilisticSubstitutionMapping>
counts_;
54 std::unique_ptr<ProbabilisticSubstitutionMapping>
factors_;
71 std::shared_ptr<TreeGlobalGraph> graph,
72 std::shared_ptr<const SubstitutionRegisterInterface> reg,
73 std::shared_ptr<const AlphabetIndex2> weights,
74 std::shared_ptr<const AlphabetIndex2> distances) :
91 return (*
getEdge(branchId)).pMod_;
94 std::shared_ptr<const TransitionModelInterface>
getModelForBranch(uint branchId)
const override
96 return (*
getEdge(branchId)).pMod_;
99 std::shared_ptr<const TransitionModelInterface>
getModel(
unsigned int branchId,
size_t classIndex)
const override
101 return (*
getEdge(branchId)).pMod_;
104 std::shared_ptr<TransitionModelInterface>
getModel(
size_t index)
109 std::shared_ptr<const TransitionModelInterface>
getModel(
size_t index)
const override
183 return modelColl_.matchParametersValues(nullParams);
The AbstractSinglePhyloSubstitutionMapping class: substitution mapping linked with a Single Process P...
virtual ~AbstractSinglePhyloSubstitutionMapping()
std::shared_ptr< const TransitionModelInterface > getModel(size_t index) const override
Get the model with a ginev index.
void setDistances(const AlphabetIndex2 &ndist) override
change Distances
std::shared_ptr< const SubstitutionRegisterInterface > pReg_
AbstractSinglePhyloSubstitutionMapping(std::shared_ptr< TreeGlobalGraph > graph, std::shared_ptr< const SubstitutionRegisterInterface > reg, std::shared_ptr< const AlphabetIndex2 > weights, std::shared_ptr< const AlphabetIndex2 > distances)
const ParameterList & getParameters() const override
Gets the parameters.
const ProbabilisticSubstitutionMapping & normalizations() const override
AbstractSinglePhyloSubstitutionMapping & operator=(const AbstractSinglePhyloSubstitutionMapping &sppm)
std::vector< uint > getBranchesWithModel(size_t index) const override
Get a list of branches id for which the given model is associated.
std::shared_ptr< const AlphabetIndex2 > distances_
distances of the substitutions. If null, no distances are used.
std::shared_ptr< const AlphabetIndex2 > getWeights() const
std::shared_ptr< TransitionModelInterface > getModelForBranch(uint branchId) override
From BranchedModelSet.
bool matchParametersValues(const ParameterList &nullParams) override
Checks and sets the models with given parameters.
const ProbabilisticSubstitutionMapping & counts() const override
std::shared_ptr< const SubstitutionRegisterInterface > getSubstitutionRegister() const
ProbabilisticSubstitutionMapping & normalizations() override
Return the tree of factors.
std::shared_ptr< const TransitionModelInterface > getModelForBranch(uint branchId) const override
ProbabilisticSubstitutionMapping & counts() override
Return the tree of counts.
std::shared_ptr< const AlphabetIndex2 > getDistances() const
AssociationTreeGlobalGraphObserver< uint, ModelBranch > modelTree
bool normalizationsPerformed() const override
From PhyloSubstitutionMapping.
std::shared_ptr< const AlphabetIndex2 > weights_
weights of the substitutions. If null, no weights are used.
void addModel(size_t index, const TransitionModelInterface &model, Vuint brIds)
add a Substitution Model in the map, and on all branches with given Ids.
std::shared_ptr< TransitionModelInterface > getModel(size_t index)
void setSubstitutionRegister(std::shared_ptr< const SubstitutionRegisterInterface > reg)
For registers.
ParametrizableCollection< TransitionModelInterface > modelColl_
A collection of Transition Models.
bool countsPerformed() const override
return if counts have been performed.
std::map< size_t, std::vector< uint > > mModBrid_
a map <model index, vector of branch ids>
std::unique_ptr< ProbabilisticSubstitutionMapping > counts_
std::shared_ptr< const TransitionModelInterface > getModel(unsigned int branchId, size_t classIndex) const override
Get the substitution model corresponding to a certain branch and model class.
const SubstitutionRegisterInterface & substitutionRegister() const
std::unique_ptr< ProbabilisticSubstitutionMapping > factors_
virtual AlphabetIndex2 * clone() const=0
virtual std::shared_ptr< E > getEdge(EdgeIndex edgeIndex) const=0
Data storage class for probabilistic substitution mappings.
The SubstitutionRegister interface.
Interface for all transition models.
Defines the basic types of data flow nodes.
std::vector< unsigned int > Vuint
std::shared_ptr< TransitionModelInterface > pMod_