bpp-phyl
2.2.0
|
Data storage class for probabilistic substitution mappings. More...
#include <Bpp/Phyl/Mapping/ProbabilisticSubstitutionMapping.h>
Public Member Functions | |
ProbabilisticSubstitutionMapping (const Tree &tree, const SubstitutionCount *sc, size_t numberOfSites) | |
Build a new ProbabilisticSubstitutionMapping object. More... | |
ProbabilisticSubstitutionMapping (const Tree &tree) | |
Build a new ProbabilisticSubstitutionMapping object. More... | |
ProbabilisticSubstitutionMapping * | clone () const |
ProbabilisticSubstitutionMapping (const ProbabilisticSubstitutionMapping &psm) | |
ProbabilisticSubstitutionMapping & | operator= (const ProbabilisticSubstitutionMapping &psm) |
virtual | ~ProbabilisticSubstitutionMapping () |
size_t | getNumberOfSubstitutionTypes () const |
virtual 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) |
virtual double & | operator() (size_t nodeIndex, size_t siteIndex, size_t type) |
Direct access to substitution numbers. More... | |
virtual const double & | operator() (size_t nodeIndex, size_t siteIndex, size_t type) const |
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 & | getTree () const =0 |
const TreeTemplate< Node > & | getTree () const throw (Exception) |
virtual bool | isEmpty () const =0 |
bool | isEmpty () const |
virtual size_t | getNumberOfSites () const =0 |
size_t | getNumberOfSites () const |
virtual size_t | getNumberOfBranches () const =0 |
size_t | getNumberOfBranches () const |
virtual int | getSitePosition (size_t index) const =0 |
int | getSitePosition (size_t index) const throw (Exception) |
virtual std::vector< double > | getBranchLengths () const =0 |
virtual std::vector< double > | getBranchLengths () const |
virtual size_t | getNodeIndex (int nodeId) const =0 throw (NodeNotFoundException) |
virtual size_t | getNodeIndex (int nodeId) const throw (NodeNotFoundException) |
virtual void | setSitePosition (size_t index, int position)=0 |
Set the position of a given site. More... | |
void | setSitePosition (size_t index, int position) throw (Exception) |
Set the position of a given site. More... | |
virtual const Node * | getNode (size_t nodeIndex) const |
Private Attributes | |
const SubstitutionCount * | substitutionCount_ |
std::vector< std::vector< std::vector< double > > > | mapping_ |
Substitution numbers storage. More... | |
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 63 of file ProbabilisticSubstitutionMapping.h.
|
inline |
Build a new ProbabilisticSubstitutionMapping 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 86 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 97 of file ProbabilisticSubstitutionMapping.h.
|
inline |
Definition at line 104 of file ProbabilisticSubstitutionMapping.h.
|
inlinevirtual |
Definition at line 116 of file ProbabilisticSubstitutionMapping.h.
|
inlinevirtual |
Implements bpp::AbstractSubstitutionMapping.
Definition at line 102 of file ProbabilisticSubstitutionMapping.h.
References ProbabilisticSubstitutionMapping().
|
pure virtualinherited |
Implemented in bpp::AbstractMapping.
|
inlinevirtualinherited |
Implements bpp::Mapping.
Definition at line 222 of file Mapping.h.
References bpp::AbstractMapping::nbBranches_, and bpp::AbstractMapping::nodes_.
|
inlinevirtualinherited |
Definition at line 212 of file Mapping.h.
References bpp::AbstractMapping::nodes_.
|
pure virtualinherited |
nodeId | An id of the node to look for in the map. |
Implemented in bpp::AbstractMapping.
|
inlinevirtualinherited |
nodeId | An id of the node to look for in the map. |
Implements bpp::Mapping.
Definition at line 230 of file Mapping.h.
References bpp::AbstractMapping::nbBranches_, and bpp::AbstractMapping::nodes_.
Referenced by bpp::SubstitutionMappingTools::getCountsPerBranch(), bpp::SubstitutionMappingTools::getNormalizationsPerBranch(), getNumberOfSubstitutions(), bpp::ProbabilisticRewardMapping::getReward(), bpp::SubstitutionMappingTools::outputIndividualCountsPerBranchPerSite(), and bpp::SubstitutionMappingTools::outputTotalCountsPerBranchPerSite().
|
pure virtualinherited |
Implemented in bpp::AbstractMapping.
Referenced by bpp::SubstitutionMappingTools::computeNormForSite(), bpp::RewardMappingTools::computeSumForSite(), bpp::SubstitutionMappingTools::computeSumForSite(), and bpp::SubstitutionMappingTools::computeTotalSubstitutionVectorForSite().
|
inlinevirtualinherited |
Implements bpp::Mapping.
Definition at line 210 of file Mapping.h.
References bpp::AbstractMapping::nbBranches_.
Referenced by bpp::ProbabilisticRewardMapping::setNumberOfSites(), setNumberOfSites(), bpp::ProbabilisticRewardMapping::setTree(), and setTree().
|
pure virtualinherited |
Implemented in bpp::AbstractMapping.
Referenced by bpp::RewardMappingTools::computeSumForBranch(), and bpp::SubstitutionMappingTools::computeSumForBranch().
|
inlinevirtualinherited |
Implements bpp::Mapping.
Definition at line 208 of file Mapping.h.
References bpp::AbstractMapping::nbSites_.
Referenced by bpp::SubstitutionMappingTools::getCountsPerBranch(), bpp::SubstitutionMappingTools::outputIndividualCountsPerBranchPerSite(), bpp::SubstitutionMappingTools::outputTotalCountsPerBranchPerSite(), bpp::ProbabilisticRewardMapping::setTree(), and setTree().
|
inlinevirtual |
Definition at line 126 of file ProbabilisticSubstitutionMapping.h.
References bpp::AbstractMapping::getNodeIndex(), and mapping_.
|
inlinevirtual |
Definition at line 131 of file ProbabilisticSubstitutionMapping.h.
References bpp::AbstractMapping::getNodeIndex(), and mapping_.
|
inlinevirtual |
Implements bpp::SubstitutionMapping.
Definition at line 120 of file ProbabilisticSubstitutionMapping.h.
References bpp::SubstitutionCount::getNumberOfSubstitutionTypes(), and substitutionCount_.
Referenced by bpp::SubstitutionMappingTools::getCountsPerBranch(), and setNumberOfSites().
|
pure virtualinherited |
index | The site index. |
Implemented in bpp::AbstractMapping.
|
inlinevirtualinherited |
index | The site index. |
Implements bpp::Mapping.
Definition at line 196 of file Mapping.h.
References bpp::AbstractMapping::isEmpty(), and bpp::AbstractMapping::sitesPositions_.
|
pure virtualinherited |
Implemented in bpp::AbstractMapping.
|
inlinevirtualinherited |
Implements bpp::Mapping.
Definition at line 182 of file Mapping.h.
References bpp::AbstractMapping::isEmpty(), and bpp::AbstractMapping::tree_.
|
pure virtualinherited |
Implemented in bpp::AbstractMapping.
|
inlinevirtualinherited |
Implements bpp::Mapping.
Definition at line 180 of file Mapping.h.
References bpp::AbstractMapping::tree_.
Referenced by bpp::AbstractMapping::getSitePosition(), bpp::AbstractMapping::getTree(), and bpp::AbstractMapping::setSitePosition().
|
inlinevirtual |
Direct access to substitution numbers.
Implements bpp::SubstitutionMapping.
Definition at line 150 of file ProbabilisticSubstitutionMapping.h.
References mapping_.
|
inlinevirtual |
Direct access to substitution numbers.
Implements bpp::SubstitutionMapping.
Definition at line 160 of file ProbabilisticSubstitutionMapping.h.
References mapping_.
|
inline |
Definition at line 108 of file ProbabilisticSubstitutionMapping.h.
References mapping_, bpp::AbstractSubstitutionMapping::operator=(), and substitutionCount_.
|
inline |
Direct access to substitution numbers.
Definition at line 170 of file ProbabilisticSubstitutionMapping.h.
References mapping_.
|
inline |
Direct access to substitution numbers.
Definition at line 180 of file ProbabilisticSubstitutionMapping.h.
References mapping_.
|
virtual |
Reimplemented from bpp::AbstractMapping.
Definition at line 55 of file ProbabilisticSubstitutionMapping.cpp.
References bpp::AbstractMapping::getNumberOfBranches(), getNumberOfSubstitutionTypes(), mapping_, and bpp::AbstractMapping::setNumberOfSites().
Referenced by ProbabilisticSubstitutionMapping().
|
pure virtualinherited |
Set the position of a given site.
index | The site index. |
position | The position of the site. |
Implemented in bpp::AbstractMapping.
|
inlinevirtualinherited |
Set the position of a given site.
index | The site index. |
position | The position of the site. |
Implements bpp::Mapping.
Definition at line 202 of file Mapping.h.
References bpp::AbstractMapping::isEmpty(), and bpp::AbstractMapping::sitesPositions_.
|
virtual |
(Re)-set the phylogenetic tree associated to this mapping.
tree | The new tree. |
Definition at line 44 of file ProbabilisticSubstitutionMapping.cpp.
References bpp::AbstractMapping::getNumberOfBranches(), bpp::AbstractMapping::getNumberOfSites(), mapping_, and bpp::AbstractMapping::setTree().
|
private |
Substitution numbers storage.
Numbers are stored by sites.
Definition at line 73 of file ProbabilisticSubstitutionMapping.h.
Referenced by getNumberOfSubstitutions(), operator()(), operator=(), operator[](), setNumberOfSites(), and setTree().
|
private |
Definition at line 67 of file ProbabilisticSubstitutionMapping.h.
Referenced by getNumberOfSubstitutionTypes(), and operator=().