bpp-phyl3
3.0.0
|
Legacy data storage class for probabilistic substitution mappings. More...
#include <Bpp/Phyl/Legacy/Mapping/ProbabilisticSubstitutionMapping.h>
Public Member Functions | |
LegacyProbabilisticSubstitutionMapping (const Tree &tree, std::shared_ptr< const SubstitutionCountInterface > sc, size_t numberOfSites) | |
Build a new LegacyProbabilisticSubstitutionMapping object. More... | |
LegacyProbabilisticSubstitutionMapping (const Tree &tree) | |
Build a new ProbabilisticSubstitutionMapping object. More... | |
LegacyProbabilisticSubstitutionMapping * | clone () const override |
LegacyProbabilisticSubstitutionMapping (const LegacyProbabilisticSubstitutionMapping &psm)=default | |
LegacyProbabilisticSubstitutionMapping & | operator= (const LegacyProbabilisticSubstitutionMapping &psm)=default |
virtual | ~LegacyProbabilisticSubstitutionMapping () |
size_t | getNumberOfSubstitutionTypes () const override |
double | getNumberOfSubstitutions (int nodeId, size_t siteIndex, size_t type) const |
virtual std::vector< double > | getNumberOfSubstitutions (int nodeId, size_t siteIndex) const |
virtual void | setTree (const Tree &tree) |
(Re)-set the phylogenetic tree associated to this mapping. More... | |
virtual void | setNumberOfSites (size_t numberOfSites) override |
virtual double & | operator() (size_t nodeIndex, size_t siteIndex, size_t type) override |
Direct access to substitution numbers. More... | |
virtual const double & | operator() (size_t nodeIndex, size_t siteIndex, size_t type) const override |
Direct access to substitution numbers. More... | |
std::vector< std::vector< double > > & | operator[] (size_t siteIndex) |
Direct access to substitution numbers. More... | |
const std::vector< std::vector< double > > & | operator[] (size_t siteIndex) const |
Direct access to substitution numbers. More... | |
virtual const Tree & | tree () const =0 |
const TreeTemplate< Node > & | tree () const override |
virtual bool | isEmpty () const =0 |
bool | isEmpty () const override |
virtual size_t | getNumberOfSites () const =0 |
size_t | getNumberOfSites () const override |
virtual size_t | getNumberOfBranches () const =0 |
size_t | getNumberOfBranches () const override |
virtual int | getSitePosition (size_t index) const =0 |
int | getSitePosition (size_t index) const override |
virtual std::vector< double > | getBranchLengths () const =0 |
virtual std::vector< double > | getBranchLengths () const override |
virtual size_t | getNodeIndex (int nodeId) const =0 |
virtual size_t | getNodeIndex (int nodeId) const override |
virtual void | setSitePosition (size_t index, int position)=0 |
Set the position of a given site. More... | |
void | setSitePosition (size_t index, int position) override |
Set the position of a given site. More... | |
virtual const Node * | getNode (size_t nodeIndex) const |
Private Attributes | |
std::shared_ptr< const SubstitutionCountInterface > | substitutionCount_ |
std::vector< std::vector< std::vector< double > > > | mapping_ |
Substitution numbers storage. More... | |
std::unique_ptr< const TreeTemplate< Node > > | tree_ |
std::vector< int > | sitesPositions_ |
std::vector< const Node * > | nodes_ |
size_t | nbSites_ |
size_t | nbBranches_ |
Legacy data storage class for probabilistic substitution mappings.
A 'probabilistic' mapping contains an single value for each branch and each site. This number can be an average number of substitutions, optionally waited, or a probability of observing a certain number of substitutions. Probabilistic was coined there by opposition to the'stochastic' mapping, where a path (number of susbstitutions + there position along the branch) is available for each branch and site. The probabilistic mapping can however be extended to contain a matrix will all types of substitutions, instead of their total number.
Definition at line 27 of file ProbabilisticSubstitutionMapping.h.
|
inline |
Build a new LegacyProbabilisticSubstitutionMapping object.
tree | The tree object to use. It will be cloned for internal use. |
sc | A pointer toward the substitution count object that has been used for the mapping, if any. This object allows to get the substitution types description, if there are several. If set to 0, then the mapping will be considered as having only one type of substitution mapped. |
numberOfSites | The number of sites to map. |
Definition at line 50 of file ProbabilisticSubstitutionMapping.h.
References setNumberOfSites().
Referenced by clone().
|
inline |
Build a new ProbabilisticSubstitutionMapping object.
tree | The tree object to use. It will be cloned for internal use. |
Definition at line 63 of file ProbabilisticSubstitutionMapping.h.
|
default |
|
inlinevirtual |
Definition at line 79 of file ProbabilisticSubstitutionMapping.h.
|
inlineoverridevirtual |
Implements bpp::LegacyAbstractSubstitutionMapping.
Definition at line 70 of file ProbabilisticSubstitutionMapping.h.
References LegacyProbabilisticSubstitutionMapping().
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 174 of file Mapping.h.
References bpp::LegacyAbstractMapping::nbBranches_, and bpp::LegacyAbstractMapping::nodes_.
|
inlinevirtualinherited |
Definition at line 162 of file Mapping.h.
References bpp::LegacyAbstractMapping::nodes_.
Referenced by bpp::LegacyRewardMappingTools::writeToStream(), and bpp::LegacySubstitutionMappingTools::writeToStream().
|
pure virtualinherited |
nodeId | An id of the node to look for in the map. |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
nodeId | An id of the node to look for in the map. |
Implements bpp::LegacyMappingInterface.
Definition at line 184 of file Mapping.h.
References bpp::LegacyAbstractMapping::nbBranches_, bpp::LegacyAbstractMapping::nodes_, and bpp::TextTools::toString().
Referenced by getNumberOfSubstitutions(), bpp::LegacyProbabilisticRewardMapping::getReward(), bpp::LegacyRewardMappingTools::readFromStream(), and bpp::LegacySubstitutionMappingTools::readFromStream().
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
Referenced by bpp::LegacySubstitutionMappingTools::computeNormForSite(), bpp::LegacyRewardMappingTools::computeSumForSite(), bpp::LegacySubstitutionMappingTools::computeSumForSite(), bpp::LegacySubstitutionMappingTools::computeTotalSubstitutionVectorForSitePerBranch(), and bpp::LegacySubstitutionMappingTools::computeTotalSubstitutionVectorForSitePerType().
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 160 of file Mapping.h.
References bpp::LegacyAbstractMapping::nbBranches_.
Referenced by bpp::LegacyProbabilisticRewardMapping::setNumberOfSites(), setNumberOfSites(), bpp::LegacyProbabilisticRewardMapping::setTree(), setTree(), bpp::LegacyRewardMappingTools::writeToStream(), and bpp::LegacySubstitutionMappingTools::writeToStream().
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
Referenced by bpp::LegacyRewardMappingTools::computeSumForBranch(), and bpp::LegacySubstitutionMappingTools::computeSumForBranch().
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 158 of file Mapping.h.
References bpp::LegacyAbstractMapping::nbSites_.
Referenced by bpp::LegacyProbabilisticRewardMapping::setTree(), setTree(), bpp::LegacyRewardMappingTools::writeToStream(), and bpp::LegacySubstitutionMappingTools::writeToStream().
|
inlinevirtual |
Definition at line 93 of file ProbabilisticSubstitutionMapping.h.
References bpp::LegacyAbstractMapping::getNodeIndex(), and mapping_.
|
inline |
Definition at line 88 of file ProbabilisticSubstitutionMapping.h.
References bpp::LegacyAbstractMapping::getNodeIndex(), and mapping_.
|
inlineoverridevirtual |
Implements bpp::LegacySubstitutionMappingInterface.
Definition at line 82 of file ProbabilisticSubstitutionMapping.h.
References substitutionCount_.
Referenced by setNumberOfSites().
|
pure virtualinherited |
index | The site index. |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
index | The site index. |
Implements bpp::LegacyMappingInterface.
Definition at line 146 of file Mapping.h.
References bpp::LegacyAbstractMapping::isEmpty(), and bpp::LegacyAbstractMapping::sitesPositions_.
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 130 of file Mapping.h.
References bpp::LegacyAbstractMapping::tree_.
Referenced by bpp::LegacyAbstractMapping::getSitePosition(), bpp::LegacyAbstractMapping::setSitePosition(), and bpp::LegacyAbstractMapping::tree().
|
inlineoverridevirtual |
Direct access to substitution numbers.
Implements bpp::LegacySubstitutionMappingInterface.
Definition at line 122 of file ProbabilisticSubstitutionMapping.h.
References mapping_.
|
inlineoverridevirtual |
Direct access to substitution numbers.
Implements bpp::LegacySubstitutionMappingInterface.
Definition at line 112 of file ProbabilisticSubstitutionMapping.h.
References mapping_.
|
default |
|
inline |
Direct access to substitution numbers.
Definition at line 132 of file ProbabilisticSubstitutionMapping.h.
References mapping_.
|
inline |
Direct access to substitution numbers.
Definition at line 142 of file ProbabilisticSubstitutionMapping.h.
References mapping_.
|
overridevirtual |
Reimplemented from bpp::LegacyAbstractMapping.
Definition at line 22 of file ProbabilisticSubstitutionMapping.cpp.
References bpp::LegacyAbstractMapping::getNumberOfBranches(), getNumberOfSubstitutionTypes(), mapping_, and bpp::LegacyAbstractMapping::setNumberOfSites().
Referenced by LegacyProbabilisticSubstitutionMapping(), and bpp::LegacySubstitutionMappingTools::readFromStream().
|
inlineoverridevirtualinherited |
Set the position of a given site.
index | The site index. |
position | The position of the site. |
Implements bpp::LegacyMappingInterface.
Definition at line 152 of file Mapping.h.
References bpp::LegacyAbstractMapping::isEmpty(), and bpp::LegacyAbstractMapping::sitesPositions_.
Referenced by bpp::LegacyRewardMappingTools::readFromStream(), and bpp::LegacySubstitutionMappingTools::readFromStream().
|
pure virtualinherited |
Set the position of a given site.
index | The site index. |
position | The position of the site. |
Implemented in bpp::LegacyAbstractMapping.
|
virtual |
(Re)-set the phylogenetic tree associated to this mapping.
tree | The new tree. |
Definition at line 9 of file ProbabilisticSubstitutionMapping.cpp.
References bpp::LegacyAbstractMapping::getNumberOfBranches(), bpp::LegacyAbstractMapping::getNumberOfSites(), mapping_, bpp::LegacyAbstractMapping::setTree(), and bpp::LegacyAbstractMapping::tree().
|
pure virtualinherited |
Implemented in bpp::LegacyAbstractMapping.
|
inlineoverridevirtualinherited |
Implements bpp::LegacyMappingInterface.
Definition at line 132 of file Mapping.h.
References bpp::LegacyAbstractMapping::isEmpty(), and bpp::LegacyAbstractMapping::tree_.
Referenced by bpp::LegacyAbstractMapping::setTree(), bpp::LegacyProbabilisticRewardMapping::setTree(), and setTree().
|
private |
Substitution numbers storage.
Numbers are stored by sites.
Definition at line 38 of file ProbabilisticSubstitutionMapping.h.
Referenced by getNumberOfSubstitutions(), operator()(), operator[](), setNumberOfSites(), and setTree().
|
privateinherited |
Definition at line 93 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::getBranchLengths(), bpp::LegacyAbstractMapping::getNodeIndex(), bpp::LegacyAbstractMapping::getNumberOfBranches(), bpp::LegacyAbstractMapping::LegacyAbstractMapping(), bpp::LegacyAbstractMapping::operator=(), and bpp::LegacyAbstractMapping::setTree().
|
privateinherited |
Definition at line 92 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::getNumberOfSites(), bpp::LegacyAbstractMapping::operator=(), and bpp::LegacyAbstractMapping::setNumberOfSites().
|
privateinherited |
Definition at line 91 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::getBranchLengths(), bpp::LegacyAbstractMapping::getNode(), bpp::LegacyAbstractMapping::getNodeIndex(), bpp::LegacyAbstractMapping::LegacyAbstractMapping(), bpp::LegacyAbstractMapping::operator=(), and bpp::LegacyAbstractMapping::setTree().
|
privateinherited |
Definition at line 90 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::getSitePosition(), bpp::LegacyAbstractMapping::operator=(), bpp::LegacyAbstractMapping::setNumberOfSites(), and bpp::LegacyAbstractMapping::setSitePosition().
|
private |
Definition at line 31 of file ProbabilisticSubstitutionMapping.h.
Referenced by getNumberOfSubstitutionTypes().
|
privateinherited |
Definition at line 89 of file Mapping.h.
Referenced by bpp::LegacyAbstractMapping::isEmpty(), bpp::LegacyAbstractMapping::LegacyAbstractMapping(), bpp::LegacyAbstractMapping::operator=(), bpp::LegacyAbstractMapping::setTree(), and bpp::LegacyAbstractMapping::tree().