bpp-phyl3  3.0.0
bpp::ProbabilisticSubstitutionMapping Class Referenceabstract

Data storage class for probabilistic substitution mappings. More...

#include <Bpp/Phyl/Mapping/ProbabilisticSubstitutionMapping.h>

+ Inheritance diagram for bpp::ProbabilisticSubstitutionMapping:
+ Collaboration diagram for bpp::ProbabilisticSubstitutionMapping:

Public Types

typedef AssociationTreeGlobalGraphObserver< PhyloNode, PhyloBranchMappingmapTree
 
typedef mapTree::EdgeIterator EdgeIterator
 
typedef mapTree::NodeIterator NodeIterator
 
typedef AssociationGraphObserver< N, E >::NodeIndex NodeIndex
 
typedef AssociationGraphObserver< N, E >::EdgeIndex EdgeIndex
 
typedef Graph::NodeId NodeGraphid
 
typedef Graph::EdgeId EdgeGraphid
 
typedef std::shared_ptr< E > Eref
 
typedef std::shared_ptr< N > Nref
 

Public Member Functions

 ProbabilisticSubstitutionMapping (const PhyloTree &tree, size_t nbTypes, size_t numberOfSites)
 Build a new ProbabilisticSubstitutionMapping object. More...
 
 ProbabilisticSubstitutionMapping (const PhyloTree &tree, size_t nbTypes, const PatternType &rootpatterns, size_t nbDistinctSites)
 the same with rootPatternLinks More...
 
 ProbabilisticSubstitutionMapping (const PhyloTree &tree)
 Build a new ProbabilisticSubstitutionMapping object. More...
 
ProbabilisticSubstitutionMappingclone () const override
 
 ProbabilisticSubstitutionMapping (const ProbabilisticSubstitutionMapping &psm)
 
ProbabilisticSubstitutionMappingoperator= (const ProbabilisticSubstitutionMapping &psm)
 
virtual ~ProbabilisticSubstitutionMapping ()
 
const PhyloBranchMappinggetBranch (unsigned int branchIndex) const override
 
PhyloBranchMappinggetBranch (unsigned int branchIndex) override
 
size_t getNumberOfBranches () const override
 
size_t getNumberOfDistinctSites () const
 
double getCount (unsigned int branchId, size_t site, size_t type) const
 Retrieve the counts, with REAL site positions. More...
 
const std::vector< double > & getCounts (unsigned int branchId, size_t site) const
 
void setNumberOfSitesAndTypes (size_t numberOfSites, size_t numberOfTypes)
 
void setNumberOfSites (size_t numberOfSites) override
 
void setNumberOfSubstitutionTypes (size_t numberOfTypes) override
 
double & operator() (unsigned int branchId, size_t siteIndex, size_t type) override
 Direct access to substitution numbers, with COMPRESSED site positions (ie site indexes) More...
 
void fillMappingVectorForSite (size_t siteIndex, VVdouble &counts) const
 Fill a VVdouble with the counts at a given site. The 1st coordinate of this VVdouble correspond to edges, ordered through their ids, & the second coordinate corresponds to the type numbers. More...
 
virtual const double & operator() (unsigned int branchId, size_t siteIndex, size_t type) const override
 Direct access to substitution numbers, with COMPRESSED site positions (ie site indexes) More...
 
bool usePatterns () const
 Does it use site patterns? More...
 
const PatternType getPatterns () const
 returns the vector of site patterns More...
 
const size_t getSiteIndex (size_t site) const
 
size_t getNumberOfSubstitutionTypes () const
 
virtual size_t getNumberOfSites () const =0
 
size_t getNumberOfSites () const
 
virtual int getSitePosition (size_t index) const =0
 
int getSitePosition (size_t index) const
 
virtual void setSitePosition (size_t index, int position)=0
 Set the position of a given site. More...
 
void setSitePosition (size_t index, int position)
 Set the position of a given site. More...
 
bool isValid () const
 
std::shared_ptr< E > getEdgeToFather (const std::shared_ptr< N > nodeObject) const
 
std::shared_ptr< E > getEdgeToFather (const NodeIndex index) const
 
void rootAt (const std::shared_ptr< N > root)
 
bool isRooted () const
 
std::shared_ptr< N > getFatherOfNode (const std::shared_ptr< N > nodeObject) const
 
bool hasFather (const std::shared_ptr< N > nodeObject) const
 
bool hasFather (const NodeIndex index) const
 
std::vector< std::shared_ptr< N > > getSons (const std::shared_ptr< N > node) const
 
std::vector< NodeIndexgetSons (const NodeIndex node) const
 
std::vector< std::shared_ptr< E > > getBranches (const std::shared_ptr< N > node) const
 
std::vector< EdgeIndexgetBranches (const NodeIndex node) const
 
std::shared_ptr< N > getSon (const std::shared_ptr< E > edge) const
 
NodeIndex getSon (const EdgeIndex edge) const
 
std::shared_ptr< N > getFatherOfEdge (const std::shared_ptr< E > edge) const
 
NodeIndex getFatherOfEdge (const EdgeIndex edge) const
 
size_t getNumberOfSons (const std::shared_ptr< N > node) const
 
std::vector< std::shared_ptr< N > > getLeavesUnderNode (std::shared_ptr< N > node) const
 
std::vector< NodeIndexgetLeavesUnderNode (NodeIndex node) const
 
std::vector< std::shared_ptr< N > > removeSons (const std::shared_ptr< N > node)
 
void removeSon (const std::shared_ptr< N > node, const std::shared_ptr< N > son)
 
void setFather (const std::shared_ptr< N > nodeObject, const std::shared_ptr< N > fatherNodeObject, const std::shared_ptr< E > edgeObject=0)
 
void addSon (const std::shared_ptr< N > nodeObject, const std::shared_ptr< N > sonNodeObject, const std::shared_ptr< E > edgeObject=0)
 
std::unique_ptr< typename AssociationTreeGraphObserver< N, E >::NodeIteratorsonsIterator (std::shared_ptr< N > node)
 
std::unique_ptr< typename AssociationTreeGraphObserver< N, E >::NodeIteratorsonsIterator (std::shared_ptr< N > node) const
 
std::unique_ptr< typename AssociationTreeGraphObserver< N, E >::EdgeIteratorbranchesIterator (std::shared_ptr< N > node)
 
std::unique_ptr< typename AssociationTreeGraphObserver< N, E >::EdgeIteratorbranchesIterator (std::shared_ptr< N > node) const
 
std::vector< std::shared_ptr< N > > getNodePathBetweenTwoNodes (const std::shared_ptr< N > nodeA, const std::shared_ptr< N > nodeB, bool includeAncestor=true) const
 
std::vector< NodeIndexgetNodePathBetweenTwoNodes (const NodeIndex nodeA, const NodeIndex nodeB, bool includeAncestor=true) const
 
std::vector< std::shared_ptr< E > > getEdgePathBetweenTwoNodes (const std::shared_ptr< N > nodeA, const std::shared_ptr< N > nodeB) const
 
std::vector< EdgeIndexgetEdgePathBetweenTwoNodes (const NodeIndex nodeA, const NodeIndex nodeB, bool includeAncestor=true) const
 
std::vector< std::shared_ptr< N > > getSubtreeNodes (const std::shared_ptr< N > localRoot) const
 
std::vector< NodeIndexgetSubtreeNodes (const NodeIndex localRoot) const
 
std::vector< std::shared_ptr< E > > getSubtreeEdges (const std::shared_ptr< N > localRoot) const
 
std::vector< EdgeIndexgetSubtreeEdges (const NodeIndex localRoot) const
 
std::shared_ptr< N > MRCA (const std::vector< std::shared_ptr< N >> vNodeObject) const
 
virtual void createNode (std::shared_ptr< N > newNodeObject)=0
 
virtual void createNode (std::shared_ptr< N > objectOriginNode, std::shared_ptr< N > newNodeObject, std::shared_ptr< E > newEdgeObject=00)=0
 
void createNode (Nref nodeObject)
 
void createNode (Nref objectOriginNode, Nref newNodeObject, Eref newEdgeObject=00)
 
virtual void createNode (std::shared_ptr< N > newNodeObject)=0
 
virtual void createNode (std::shared_ptr< N > objectOriginNode, std::shared_ptr< N > newNodeObject, std::shared_ptr< E > newEdgeObject=00)=0
 
void createNode (Nref nodeObject)
 
void createNode (Nref objectOriginNode, Nref newNodeObject, Eref newEdgeObject=00)
 
virtual void link (std::shared_ptr< N > nodeObjectA, std::shared_ptr< N > nodeObjectB, std::shared_ptr< E > edgeObject=00)=0
 
void link (Nref nodeObjectA, Nref nodeObjectB, Eref edgeObject=00)
 
virtual void link (std::shared_ptr< N > nodeObjectA, std::shared_ptr< N > nodeObjectB, std::shared_ptr< E > edgeObject=00)=0
 
void link (Nref nodeObjectA, Nref nodeObjectB, Eref edgeObject=00)
 
virtual void unlink (std::shared_ptr< N > nodeObjectA, std::shared_ptr< N > nodeObjectB)=0
 
void unlink (Nref nodeObjectA, Nref nodeObjectB)
 
virtual void unlink (std::shared_ptr< N > nodeObjectA, std::shared_ptr< N > nodeObjectB)=0
 
void unlink (Nref nodeObjectA, Nref nodeObjectB)
 
virtual void deleteNode (std::shared_ptr< N > nodeObject)=0
 
void deleteNode (Nref nodeObject)
 
virtual void deleteNode (std::shared_ptr< N > nodeObject)=0
 
void deleteNode (Nref nodeObject)
 
virtual void associateNode (std::shared_ptr< N > nodeObject, NodeGraphid node)=0
 
void associateNode (Nref nodeObject, NodeGraphid graphNode)
 
virtual void associateNode (std::shared_ptr< N > nodeObject, NodeGraphid node)=0
 
void associateNode (Nref nodeObject, NodeGraphid graphNode)
 
void associateNode (Nref nodeObject, NodeGraphid graphNode)
 
virtual void associateEdge (std::shared_ptr< E > edgeObject, EdgeGraphid edge)=0
 
void associateEdge (Eref edgeObject, EdgeGraphid graphEdge)
 
virtual void associateEdge (std::shared_ptr< E > edgeObject, EdgeGraphid edge)=0
 
void associateEdge (Eref edgeObject, EdgeGraphid graphEdge)
 
void associateEdge (Eref edgeObject, EdgeGraphid graphEdge)
 
virtual void dissociateNode (std::shared_ptr< N > nodeObject)=0
 
void dissociateNode (Nref nodeObject)
 
virtual void dissociateNode (std::shared_ptr< N > nodeObject)=0
 
void dissociateNode (Nref nodeObject)
 
virtual void dissociateEdge (std::shared_ptr< E > edgeObject)=0
 
void dissociateEdge (Eref edgeObject)
 
virtual void dissociateEdge (std::shared_ptr< E > edgeObject)=0
 
void dissociateEdge (Eref edgeObject)
 
virtual NodeGraphid getNodeGraphid (const std::shared_ptr< N > nodeObject) const=0
 
NodeGraphid getNodeGraphid (const Nref nodeObject) const
 
virtual NodeGraphid getNodeGraphid (const std::shared_ptr< N > nodeObject) const=0
 
NodeGraphid getNodeGraphid (const Nref nodeObject) const
 
virtual EdgeGraphid getEdgeGraphid (const std::shared_ptr< E > edgeObject) const=0
 
EdgeGraphid getEdgeGraphid (const Eref edgeObject) const
 
virtual EdgeGraphid getEdgeGraphid (const std::shared_ptr< E > edgeObject) const=0
 
EdgeGraphid getEdgeGraphid (const Eref edgeObject) const
 
virtual const std::shared_ptr< N > getNodeFromGraphid (NodeGraphid) const=0
 
virtual std::shared_ptr< N > getNodeFromGraphid (NodeGraphid)=0
 
Nref getNodeFromGraphid (NodeGraphid node)
 
const Nref getNodeFromGraphid (NodeGraphid node) const
 
virtual const std::shared_ptr< N > getNodeFromGraphid (NodeGraphid) const=0
 
virtual std::shared_ptr< N > getNodeFromGraphid (NodeGraphid)=0
 
Nref getNodeFromGraphid (NodeGraphid node)
 
const Nref getNodeFromGraphid (NodeGraphid node) const
 
Nref getNodeFromGraphid (NodeGraphid node)
 
const Nref getNodeFromGraphid (NodeGraphid node) const
 
virtual std::vector< std::shared_ptr< N > > getNodesFromGraphid (std::vector< NodeGraphid >) const=0
 
std::vector< NrefgetNodesFromGraphid (std::vector< NodeGraphid > nodes) const
 
virtual std::vector< std::shared_ptr< N > > getNodesFromGraphid (std::vector< NodeGraphid >) const=0
 
std::vector< NrefgetNodesFromGraphid (std::vector< NodeGraphid > nodes) const
 
std::vector< NrefgetNodesFromGraphid (std::vector< NodeGraphid > nodes) const
 
virtual std::shared_ptr< E > getEdgeFromGraphid (EdgeGraphid)=0
 
virtual const std::shared_ptr< E > getEdgeFromGraphid (EdgeGraphid) const=0
 
Eref getEdgeFromGraphid (EdgeGraphid edge)
 
const Eref getEdgeFromGraphid (EdgeGraphid edge) const
 
virtual std::shared_ptr< E > getEdgeFromGraphid (EdgeGraphid)=0
 
virtual const std::shared_ptr< E > getEdgeFromGraphid (EdgeGraphid) const=0
 
Eref getEdgeFromGraphid (EdgeGraphid edge)
 
const Eref getEdgeFromGraphid (EdgeGraphid edge) const
 
Eref getEdgeFromGraphid (EdgeGraphid edge)
 
const Eref getEdgeFromGraphid (EdgeGraphid edge) const
 
virtual std::vector< std::shared_ptr< E > > getEdgesFromGraphid (std::vector< EdgeGraphid >) const=0
 
std::vector< ErefgetEdgesFromGraphid (std::vector< EdgeGraphid > edges) const
 
virtual std::vector< std::shared_ptr< E > > getEdgesFromGraphid (std::vector< EdgeGraphid >) const=0
 
std::vector< ErefgetEdgesFromGraphid (std::vector< EdgeGraphid > edges) const
 
std::vector< ErefgetEdgesFromGraphid (std::vector< EdgeGraphid > edges) const
 
virtual std::shared_ptr< N > getRoot () const=0
 
Nref getRoot () const
 
virtual std::shared_ptr< N > getRoot () const=0
 
Nref getRoot () const
 
virtual NodeIndex getRootIndex () const=0
 
NodeIndex getRootIndex () const
 
virtual NodeIndex getRootIndex () const=0
 
NodeIndex getRootIndex () const
 
virtual bool hasNodeIndex (const std::shared_ptr< N > nodeObject) const=0
 
bool hasNodeIndex (const Nref nodeObject) const
 
virtual bool hasNodeIndex (const std::shared_ptr< N > nodeObject) const=0
 
bool hasNodeIndex (const Nref nodeObject) const
 
virtual bool hasEdgeIndex (const std::shared_ptr< E > edgeObject) const=0
 
bool hasEdgeIndex (const Eref edgeObject) const
 
virtual bool hasEdgeIndex (const std::shared_ptr< E > edgeObject) const=0
 
bool hasEdgeIndex (const Eref edgeObject) const
 
virtual NodeIndex getNodeIndex (const std::shared_ptr< N > nodeObject) const=0
 
NodeIndex getNodeIndex (const Nref nodeObject) const
 
virtual NodeIndex getNodeIndex (const std::shared_ptr< N > nodeObject) const=0
 
NodeIndex getNodeIndex (const Nref nodeObject) const
 
virtual std::vector< NodeIndexgetNodeIndexes (std::vector< std::shared_ptr< N >> nodeObjects) const=0
 
std::vector< NodeIndexgetNodeIndexes (std::vector< Nref > nodes) const
 
virtual std::vector< NodeIndexgetNodeIndexes (std::vector< std::shared_ptr< N >> nodeObjects) const=0
 
std::vector< NodeIndexgetNodeIndexes (std::vector< Nref > nodes) const
 
virtual EdgeIndex getEdgeIndex (const std::shared_ptr< E > edgeObject) const=0
 
EdgeIndex getEdgeIndex (const Eref edgeObject) const
 
virtual EdgeIndex getEdgeIndex (const std::shared_ptr< E > edgeObject) const=0
 
EdgeIndex getEdgeIndex (const Eref edgeObject) const
 
virtual std::vector< EdgeIndexgetEdgeIndexes (std::vector< std::shared_ptr< E >> edgeObjects) const=0
 
std::vector< EdgeIndexgetEdgeIndexes (std::vector< Eref > edges) const
 
virtual std::vector< EdgeIndexgetEdgeIndexes (std::vector< std::shared_ptr< E >> edgeObjects) const=0
 
std::vector< EdgeIndexgetEdgeIndexes (std::vector< Eref > edges) const
 
virtual NodeIndex setNodeIndex (const std::shared_ptr< N > nodeObject, NodeIndex index)=0
 
NodeIndex setNodeIndex (const Nref nodeObject, NodeIndex index)
 
virtual NodeIndex setNodeIndex (const std::shared_ptr< N > nodeObject, NodeIndex index)=0
 
NodeIndex setNodeIndex (const Nref nodeObject, NodeIndex index)
 
NodeIndex setNodeIndex (const Nref nodeObject, NodeIndex index)
 
virtual EdgeIndex setEdgeIndex (const std::shared_ptr< E > edgeObject, EdgeIndex index)=0
 
EdgeIndex setEdgeIndex (const Eref edgeObject, EdgeIndex index)
 
virtual EdgeIndex setEdgeIndex (const std::shared_ptr< E > edgeObject, EdgeIndex index)=0
 
EdgeIndex setEdgeIndex (const Eref edgeObject, EdgeIndex index)
 
EdgeIndex setEdgeIndex (const Eref edgeObject, EdgeIndex index)
 
virtual bool hasNode (NodeIndex nodeIndex) const=0
 
bool hasNode (NodeIndex node) const
 
virtual bool hasNode (NodeIndex nodeIndex) const=0
 
bool hasNode (Nref nodeObject) const
 
bool hasNode (NodeIndex node) const
 
bool hasNode (NodeIndex node) const
 
virtual bool hasEdge (EdgeIndex edgeIndex) const=0
 
bool hasEdge (EdgeIndex edge) const
 
virtual bool hasEdge (EdgeIndex edgeIndex) const=0
 
bool hasEdge (Eref edgeObject) const
 
bool hasEdge (EdgeIndex edge) const
 
bool hasEdge (EdgeIndex edge) const
 
virtual std::shared_ptr< N > getNode (NodeIndex nodeIndex) const=0
 
Nref getNode (NodeIndex node) const
 
virtual std::shared_ptr< N > getNode (NodeIndex nodeIndex) const=0
 
Nref getNode (NodeIndex node) const
 
Nref getNode (NodeIndex node) const
 
virtual std::shared_ptr< E > getEdge (EdgeIndex edgeIndex) const=0
 
Eref getEdge (EdgeIndex edge) const
 
virtual std::shared_ptr< E > getEdge (EdgeIndex edgeIndex) const=0
 
Eref getEdge (EdgeIndex edge) const
 
Eref getEdge (EdgeIndex edge) const
 
virtual std::unique_ptr< NodeIteratorallNodesIterator ()=0
 
virtual std::unique_ptr< NodeIteratorallNodesIterator () const=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratorallNodesIterator ()
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratorallNodesIterator () const
 
virtual std::unique_ptr< NodeIteratorallNodesIterator ()=0
 
virtual std::unique_ptr< NodeIteratorallNodesIterator () const=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratorallNodesIterator ()
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratorallNodesIterator () const
 
virtual std::unique_ptr< NodeIteratoroutgoingNeighborNodesIterator (std::shared_ptr< N > node)=0
 
virtual std::unique_ptr< NodeIteratoroutgoingNeighborNodesIterator (std::shared_ptr< N > node) const=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratoroutgoingNeighborNodesIterator (Nref node)
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratoroutgoingNeighborNodesIterator (Nref node) const
 
virtual std::unique_ptr< NodeIteratoroutgoingNeighborNodesIterator (std::shared_ptr< N > node)=0
 
virtual std::unique_ptr< NodeIteratoroutgoingNeighborNodesIterator (std::shared_ptr< N > node) const=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratoroutgoingNeighborNodesIterator (Nref node)
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratoroutgoingNeighborNodesIterator (Nref node) const
 
virtual std::unique_ptr< NodeIteratorincomingNeighborNodesIterator (std::shared_ptr< N > node)=0
 
virtual std::unique_ptr< NodeIteratorincomingNeighborNodesIterator (std::shared_ptr< N > node) const=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratorincomingNeighborNodesIterator (Nref node)
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratorincomingNeighborNodesIterator (Nref node) const
 
virtual std::unique_ptr< NodeIteratorincomingNeighborNodesIterator (std::shared_ptr< N > node)=0
 
virtual std::unique_ptr< NodeIteratorincomingNeighborNodesIterator (std::shared_ptr< N > node) const=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratorincomingNeighborNodesIterator (Nref node)
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIteratorincomingNeighborNodesIterator (Nref node) const
 
virtual std::vector< std::shared_ptr< N > > getNeighbors (const std::shared_ptr< N > node) const=0
 
virtual std::vector< NodeIndexgetNeighbors (NodeIndex node) const=0
 
std::vector< NrefgetNeighbors (const Nref node) const
 
std::vector< NodeIndexgetNeighbors (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< N > > getNeighbors (const std::shared_ptr< N > node) const=0
 
virtual std::vector< NodeIndexgetNeighbors (NodeIndex node) const=0
 
std::vector< NrefgetNeighbors (const Nref node) const
 
std::vector< NodeIndexgetNeighbors (NodeIndex node) const
 
std::vector< NodeIndexgetNeighbors (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< E > > getEdges (const std::shared_ptr< N > node) const=0
 
virtual std::vector< EdgeIndexgetEdges (NodeIndex node) const=0
 
std::vector< ErefgetEdges (const Nref node) const
 
std::vector< EdgeIndexgetEdges (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< E > > getEdges (const std::shared_ptr< N > node) const=0
 
virtual std::vector< EdgeIndexgetEdges (NodeIndex node) const=0
 
std::vector< ErefgetEdges (const Nref node) const
 
std::vector< EdgeIndexgetEdges (NodeIndex node) const
 
std::vector< EdgeIndexgetEdges (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< N > > getOutgoingNeighbors (const std::shared_ptr< N > node) const=0
 
virtual std::vector< NodeIndexgetOutgoingNeighbors (NodeIndex node) const=0
 
std::vector< NrefgetOutgoingNeighbors (const Nref node) const
 
std::vector< NodeIndexgetOutgoingNeighbors (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< N > > getOutgoingNeighbors (const std::shared_ptr< N > node) const=0
 
virtual std::vector< NodeIndexgetOutgoingNeighbors (NodeIndex node) const=0
 
std::vector< NrefgetOutgoingNeighbors (const Nref node) const
 
std::vector< NodeIndexgetOutgoingNeighbors (NodeIndex node) const
 
std::vector< NodeIndexgetOutgoingNeighbors (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< E > > getOutgoingEdges (const std::shared_ptr< N > node) const=0
 
virtual std::vector< EdgeIndexgetOutgoingEdges (NodeIndex node) const=0
 
std::vector< ErefgetOutgoingEdges (const Nref node) const
 
std::vector< EdgeIndexgetOutgoingEdges (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< E > > getOutgoingEdges (const std::shared_ptr< N > node) const=0
 
virtual std::vector< EdgeIndexgetOutgoingEdges (NodeIndex node) const=0
 
std::vector< ErefgetOutgoingEdges (const Nref node) const
 
std::vector< EdgeIndexgetOutgoingEdges (NodeIndex node) const
 
std::vector< EdgeIndexgetOutgoingEdges (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< N > > getIncomingNeighbors (const std::shared_ptr< N > node) const=0
 
virtual std::vector< NodeIndexgetIncomingNeighbors (NodeIndex node) const=0
 
std::vector< NrefgetIncomingNeighbors (const Nref node) const
 
std::vector< NodeIndexgetIncomingNeighbors (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< N > > getIncomingNeighbors (const std::shared_ptr< N > node) const=0
 
virtual std::vector< NodeIndexgetIncomingNeighbors (NodeIndex node) const=0
 
std::vector< NrefgetIncomingNeighbors (const Nref node) const
 
std::vector< NodeIndexgetIncomingNeighbors (NodeIndex node) const
 
std::vector< NodeIndexgetIncomingNeighbors (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< E > > getIncomingEdges (const std::shared_ptr< N > node) const=0
 
virtual std::vector< EdgeIndexgetIncomingEdges (NodeIndex node) const=0
 
std::vector< ErefgetIncomingEdges (const Nref node) const
 
std::vector< EdgeIndexgetIncomingEdges (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< E > > getIncomingEdges (const std::shared_ptr< N > node) const=0
 
virtual std::vector< EdgeIndexgetIncomingEdges (NodeIndex node) const=0
 
std::vector< ErefgetIncomingEdges (const Nref node) const
 
std::vector< EdgeIndexgetIncomingEdges (NodeIndex node) const
 
std::vector< EdgeIndexgetIncomingEdges (NodeIndex node) const
 
virtual std::vector< std::shared_ptr< N > > getLeavesFromNode (std::shared_ptr< N > node, unsigned int maxDepth) const=0
 
std::vector< NrefgetLeavesFromNode (Nref node, unsigned int maxDepth) const
 
virtual std::vector< std::shared_ptr< N > > getLeavesFromNode (std::shared_ptr< N > node, unsigned int maxDepth) const=0
 
std::vector< NrefgetLeavesFromNode (Nref node, unsigned int maxDepth) const
 
virtual std::vector< std::shared_ptr< N > > getAllLeaves () const=0
 
std::vector< NrefgetAllLeaves () const
 
virtual std::vector< std::shared_ptr< N > > getAllLeaves () const=0
 
std::vector< NrefgetAllLeaves () const
 
virtual std::vector< NodeIndexgetAllLeavesIndexes () const=0
 
std::vector< NodeIndexgetAllLeavesIndexes () const
 
virtual std::vector< NodeIndexgetAllLeavesIndexes () const=0
 
std::vector< NodeIndexgetAllLeavesIndexes () const
 
virtual std::vector< std::shared_ptr< N > > getAllInnerNodes () const=0
 
std::vector< NrefgetAllInnerNodes () const
 
virtual std::vector< std::shared_ptr< N > > getAllInnerNodes () const=0
 
std::vector< NrefgetAllInnerNodes () const
 
virtual std::vector< NodeIndexgetAllInnerNodesIndexes () const=0
 
std::vector< NodeIndexgetAllInnerNodesIndexes () const
 
virtual std::vector< NodeIndexgetAllInnerNodesIndexes () const=0
 
std::vector< NodeIndexgetAllInnerNodesIndexes () const
 
virtual std::vector< std::shared_ptr< N > > getAllNodes () const=0
 
std::vector< NrefgetAllNodes () const
 
virtual std::vector< std::shared_ptr< N > > getAllNodes () const=0
 
std::vector< NrefgetAllNodes () const
 
virtual std::vector< NodeIndexgetAllNodesIndexes () const=0
 
std::vector< NodeIndexgetAllNodesIndexes () const
 
virtual std::vector< NodeIndexgetAllNodesIndexes () const=0
 
std::vector< NodeIndexgetAllNodesIndexes () const
 
virtual std::unique_ptr< EdgeIteratorallEdgesIterator ()=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratorallEdgesIterator ()
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratorallEdgesIterator () const
 
virtual std::unique_ptr< EdgeIteratorallEdgesIterator ()=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratorallEdgesIterator ()
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratorallEdgesIterator () const
 
virtual std::unique_ptr< EdgeIteratoroutgoingEdgesIterator (std::shared_ptr< N > node)=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratoroutgoingEdgesIterator (Nref node)
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratoroutgoingEdgesIterator (Nref node) const
 
virtual std::unique_ptr< EdgeIteratoroutgoingEdgesIterator (std::shared_ptr< N > node)=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratoroutgoingEdgesIterator (Nref node)
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratoroutgoingEdgesIterator (Nref node) const
 
virtual std::unique_ptr< EdgeIteratorincomingEdgesIterator (std::shared_ptr< N > node)=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratorincomingEdgesIterator (Nref node)
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratorincomingEdgesIterator (Nref node) const
 
virtual std::unique_ptr< EdgeIteratorincomingEdgesIterator (std::shared_ptr< N > node)=0
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratorincomingEdgesIterator (Nref node)
 
std::unique_ptr< typename AssociationGraphObserver< N, E >::EdgeIteratorincomingEdgesIterator (Nref node) const
 
virtual std::vector< std::shared_ptr< E > > getAllEdges () const=0
 
std::vector< ErefgetAllEdges () const
 
virtual std::vector< std::shared_ptr< E > > getAllEdges () const=0
 
std::vector< ErefgetAllEdges () const
 
virtual std::vector< EdgeIndexgetAllEdgesIndexes () const=0
 
std::vector< EdgeIndexgetAllEdgesIndexes () const
 
virtual std::vector< EdgeIndexgetAllEdgesIndexes () const=0
 
std::vector< EdgeIndexgetAllEdgesIndexes () const
 
virtual std::shared_ptr< E > getEdgeLinking (std::shared_ptr< N > nodeA, std::shared_ptr< N > nodeB) const=0
 
Eref getEdgeLinking (Nref nodeA, Nref nodeB) const
 
virtual std::shared_ptr< E > getEdgeLinking (std::shared_ptr< N > nodeA, std::shared_ptr< N > nodeB) const=0
 
Eref getEdgeLinking (Nref nodeA, Nref nodeB) const
 
virtual void setEdgeLinking (std::shared_ptr< N > nodeA, std::shared_ptr< N > nodeB, std::shared_ptr< E > edge)=0
 
void setEdgeLinking (Nref nodeA, Nref nodeB, Eref edge)
 
virtual void setEdgeLinking (std::shared_ptr< N > nodeA, std::shared_ptr< N > nodeB, std::shared_ptr< E > edge)=0
 
void setEdgeLinking (Nref nodeA, Nref nodeB, Eref edge)
 
virtual void deletedEdgesUpdate (const std::vector< unsigned int > &edgesToDelete)=0
 
void deletedEdgesUpdate (const std::vector< unsigned int > &edgesToDelete)
 
virtual void deletedEdgesUpdate (const std::vector< unsigned int > &edgesToDelete)=0
 
void deletedEdgesUpdate (const std::vector< unsigned int > &edgesToDelete)
 
virtual void deletedNodesUpdate (const std::vector< unsigned int > &nodesToDelete)=0
 
void deletedNodesUpdate (const std::vector< unsigned int > &nodesToDelete)
 
virtual void deletedNodesUpdate (const std::vector< unsigned int > &nodesToDelete)=0
 
void deletedNodesUpdate (const std::vector< unsigned int > &nodesToDelete)
 
NodeIndex addNodeIndex (const Nref nodeObject)
 
NodeIndex addNodeIndex (const Nref nodeObject)
 
EdgeIndex addEdgeIndex (const Eref edgeObject)
 
EdgeIndex addEdgeIndex (const Eref edgeObject)
 
void setRoot (const Nref newRoot)
 
void setRoot (const Nref newRoot)
 
void outputToDot (const std::string &fname, const std::string &name) const
 
void outputToDot (std::ostream &out, const std::string &name) const
 
void outputToDot (const std::string &fname, const std::string &name) const
 
void outputToDot (std::ostream &out, const std::string &name) const
 
bool isLeaf (const Nref node) const
 
bool isLeaf (const NodeIndex nodeid) const
 
bool isLeaf (const Nref node) const
 
bool isLeaf (const NodeIndex nodeid) const
 
bool isLeaf (const NodeIndex nodeid) const
 
std::pair< Nref, NrefgetNodes (Eref edge) const
 
std::pair< Nref, NrefgetNodes (Eref edge) const
 
size_t getNumberOfNodes () const
 
size_t getNumberOfNodes () const
 
size_t getNumberOfEdges () const
 
size_t getNumberOfEdges () const
 
size_t getNumberOfLeaves () const
 
size_t getNumberOfLeaves () const
 
size_t getDegree (const Nref node) const
 
size_t getDegree (const Nref node) const
 
const std::shared_ptr< TreeGraphImplgetGraph () const
 
std::shared_ptr< TreeGraphImplgetGraph ()
 
std::string nodeToString (const Nref nodeObject) const
 
std::string edgeToString (const Eref edgeObject) const
 

Static Public Member Functions

static B * copy (const A &a, typename std::enable_if< !std::is_base_of< B, A >::value &&!std::is_abstract< B >::value, B * >::type *=0)
 
static B * copy (const A &a, typename std::enable_if< !std::is_base_of< B, A >::value &&std::is_abstract< B >::value, B * >::type *=0)
 
static B * copy (const A &a, typename std::enable_if< std::is_base_of< B, A >::value &&!std::is_abstract< A >::value, B * >::type *=0)
 
static B * copy (const A &a, typename std::enable_if< std::is_base_of< B, A >::value &&std::is_abstract< A >::value &&std::is_base_of< Clonable, A >::value, B * >::type *=0)
 
static B * copy (const A &a, typename std::enable_if< std::is_base_of< B, A >::value &&std::is_abstract< A >::value &&!std::is_base_of< Clonable, A >::value, B * >::type *=0)
 
static B * copy (const A &a, typename std::enable_if< std::is_base_of< B, A >::value &&std::is_abstract< A >::value &&std::is_base_of< Clonable, A >::value, B * >::type *=0)
 
static B * copy (const A &a, typename std::enable_if< std::is_base_of< B, A >::value &&std::is_abstract< A >::value &&!std::is_base_of< Clonable, A >::value, B * >::type *=0)
 

Protected Attributes

std::vector< int > sitesPositions_
 
size_t nbSites_
 
std::shared_ptr< TreeGraphImplsubjectGraph_
 

Private Types

enum  neighborType
 

Private Member Functions

std::vector< NrefgetNeighbors_ (const Nref nodeObject, neighborType type) const
 
std::vector< ErefgetEdges_ (const Nref nodeObject, neighborType type) const
 

Private Attributes

PatternType rootPatternLinks_
 Links between sites and patterns. More...
 
bool usePatterns_
 
size_t numberOfDistinctSites_
 
size_t numberOfTypes_
 
 INCOMING
 
 OUTGOING
 
 BOTH
 
std::vector< NrefgraphidToN_
 
std::vector< ErefgraphidToE_
 
std::map< Nref, NodeGraphidNToGraphid_
 
std::map< Eref, EdgeGraphidEToGraphid_
 
std::vector< NrefindexToN_
 
std::vector< ErefindexToE_
 
std::map< Nref, NodeIndexNToIndex_
 
std::map< Eref, EdgeIndexEToIndex_
 

Detailed Description

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 31 of file ProbabilisticSubstitutionMapping.h.

Member Typedef Documentation

◆ EdgeIterator

◆ mapTree

◆ NodeIterator

Constructor & Destructor Documentation

◆ ProbabilisticSubstitutionMapping() [1/4]

bpp::ProbabilisticSubstitutionMapping::ProbabilisticSubstitutionMapping ( const PhyloTree tree,
size_t  nbTypes,
size_t  numberOfSites 
)
inline

Build a new ProbabilisticSubstitutionMapping object.

Parameters
treeThe PhyloTree object to use.
nbTypesthe number of types
numberOfSitesThe number of sites to map.

Definition at line 68 of file ProbabilisticSubstitutionMapping.h.

References bpp::AssociationTreeGraphImplObserver< class, class, class >::allEdgesIterator(), numberOfDistinctSites_, and setNumberOfSubstitutionTypes().

Referenced by clone().

◆ ProbabilisticSubstitutionMapping() [2/4]

bpp::ProbabilisticSubstitutionMapping::ProbabilisticSubstitutionMapping ( const PhyloTree tree,
size_t  nbTypes,
const PatternType rootpatterns,
size_t  nbDistinctSites 
)
inline

◆ ProbabilisticSubstitutionMapping() [3/4]

bpp::ProbabilisticSubstitutionMapping::ProbabilisticSubstitutionMapping ( const PhyloTree tree)
inline

Build a new ProbabilisticSubstitutionMapping object.

Parameters
treeThe tree object to use. It will be cloned for internal use.

Definition at line 99 of file ProbabilisticSubstitutionMapping.h.

◆ ProbabilisticSubstitutionMapping() [4/4]

bpp::ProbabilisticSubstitutionMapping::ProbabilisticSubstitutionMapping ( const ProbabilisticSubstitutionMapping psm)
inline

Definition at line 108 of file ProbabilisticSubstitutionMapping.h.

◆ ~ProbabilisticSubstitutionMapping()

virtual bpp::ProbabilisticSubstitutionMapping::~ProbabilisticSubstitutionMapping ( )
inlinevirtual

Definition at line 124 of file ProbabilisticSubstitutionMapping.h.

Member Function Documentation

◆ clone()

ProbabilisticSubstitutionMapping* bpp::ProbabilisticSubstitutionMapping::clone ( ) const
inlineoverridevirtual

◆ fillMappingVectorForSite()

void ProbabilisticSubstitutionMapping::fillMappingVectorForSite ( size_t  siteIndex,
VVdouble counts 
) const

Fill a VVdouble with the counts at a given site. The 1st coordinate of this VVdouble correspond to edges, ordered through their ids, & the second coordinate corresponds to the type numbers.

Branches are read in the same order as returned by getAllEdgesIndexes() function.

Definition at line 59 of file ProbabilisticSubstitutionMapping.cpp.

References bpp::VectorTools::resize2().

◆ getBranch() [1/2]

const PhyloBranchMapping& bpp::ProbabilisticSubstitutionMapping::getBranch ( unsigned int  branchId) const
inlineoverridevirtual

◆ getBranch() [2/2]

PhyloBranchMapping& bpp::ProbabilisticSubstitutionMapping::getBranch ( unsigned int  branchIndex)
inlineoverridevirtual

◆ getCount()

double bpp::ProbabilisticSubstitutionMapping::getCount ( unsigned int  branchId,
size_t  site,
size_t  type 
) const
inline

Retrieve the counts, with REAL site positions.

Definition at line 150 of file ProbabilisticSubstitutionMapping.h.

References bpp::AssociationTreeGraphImplObserver< class, class, class >::getEdge(), and getSiteIndex().

◆ getCounts()

const std::vector<double>& bpp::ProbabilisticSubstitutionMapping::getCounts ( unsigned int  branchId,
size_t  site 
) const
inline

◆ getNumberOfBranches()

size_t bpp::ProbabilisticSubstitutionMapping::getNumberOfBranches ( ) const
inlineoverridevirtual

◆ getNumberOfDistinctSites()

size_t bpp::ProbabilisticSubstitutionMapping::getNumberOfDistinctSites ( ) const
inline

◆ getNumberOfSites() [1/2]

◆ getNumberOfSites() [2/2]

virtual size_t bpp::MappingInterface::getNumberOfSites ( ) const
pure virtualinherited
Returns
The number of sites mapped.

Implemented in bpp::AbstractMapping.

◆ getNumberOfSubstitutionTypes()

◆ getPatterns()

const PatternType bpp::ProbabilisticSubstitutionMapping::getPatterns ( ) const
inline

returns the vector of site patterns

Definition at line 213 of file ProbabilisticSubstitutionMapping.h.

References rootPatternLinks_.

◆ getSiteIndex()

◆ getSitePosition() [1/2]

int bpp::AbstractMapping::getSitePosition ( size_t  index) const
inlinevirtualinherited
Parameters
indexThe site index.
Returns
The site position corresponding to the index.

Implements bpp::MappingInterface.

Definition at line 98 of file Mapping.h.

References bpp::AbstractMapping::sitesPositions_.

◆ getSitePosition() [2/2]

virtual int bpp::MappingInterface::getSitePosition ( size_t  index) const
pure virtualinherited
Parameters
indexThe site index.
Returns
The site position corresponding to the index.

Implemented in bpp::AbstractMapping.

◆ operator()() [1/2]

virtual const double& bpp::ProbabilisticSubstitutionMapping::operator() ( unsigned int  branchId,
size_t  siteIndex,
size_t  type 
) const
inlineoverridevirtual

Direct access to substitution numbers, with COMPRESSED site positions (ie site indexes)

Warning
No index checking is performed, use with care!

Implements bpp::SubstitutionMapping.

Definition at line 195 of file ProbabilisticSubstitutionMapping.h.

References bpp::AssociationTreeGraphImplObserver< class, class, class >::getEdge().

◆ operator()() [2/2]

double& bpp::ProbabilisticSubstitutionMapping::operator() ( unsigned int  branchId,
size_t  siteIndex,
size_t  type 
)
inlineoverridevirtual

Direct access to substitution numbers, with COMPRESSED site positions (ie site indexes)

Warning
No index checking is performed, use with care!

Implements bpp::SubstitutionMapping.

Definition at line 172 of file ProbabilisticSubstitutionMapping.h.

References bpp::AssociationTreeGraphImplObserver< class, class, class >::getEdge().

◆ operator=()

◆ setNumberOfSites()

void ProbabilisticSubstitutionMapping::setNumberOfSites ( size_t  numberOfSites)
overridevirtual

◆ setNumberOfSitesAndTypes()

void ProbabilisticSubstitutionMapping::setNumberOfSitesAndTypes ( size_t  numberOfSites,
size_t  numberOfTypes 
)

◆ setNumberOfSubstitutionTypes()

void ProbabilisticSubstitutionMapping::setNumberOfSubstitutionTypes ( size_t  numberOfTypes)
overridevirtual

◆ setSitePosition() [1/2]

void bpp::AbstractMapping::setSitePosition ( size_t  index,
int  position 
)
inlinevirtualinherited

Set the position of a given site.

Warning
No index checking is performed, use with care!
Parameters
indexThe site index.
positionThe position of the site.

Implements bpp::MappingInterface.

Definition at line 103 of file Mapping.h.

References bpp::AbstractMapping::nbSites_, and bpp::AbstractMapping::sitesPositions_.

Referenced by bpp::RewardMappingTools::readFromStream(), and bpp::SubstitutionMappingTools::readFromStream().

◆ setSitePosition() [2/2]

virtual void bpp::MappingInterface::setSitePosition ( size_t  index,
int  position 
)
pure virtualinherited

Set the position of a given site.

Warning
No index checking is performed, use with care!
Parameters
indexThe site index.
positionThe position of the site.

Implemented in bpp::AbstractMapping.

◆ usePatterns()

bool bpp::ProbabilisticSubstitutionMapping::usePatterns ( ) const
inline

Does it use site patterns?

Definition at line 204 of file ProbabilisticSubstitutionMapping.h.

References usePatterns_.

Member Data Documentation

◆ nbSites_

size_t bpp::AbstractMapping::nbSites_
protectedinherited

◆ numberOfDistinctSites_

size_t bpp::ProbabilisticSubstitutionMapping::numberOfDistinctSites_
private

◆ numberOfTypes_

◆ rootPatternLinks_

PatternType bpp::ProbabilisticSubstitutionMapping::rootPatternLinks_
private

Links between sites and patterns.

The size of this vector is equal to the number of sites in the container, each element corresponds to a site in the container and points to the corresponding column in the count array of the root node. If the container contains no repeated site, there will be a strict equivalence between each site and the likelihood array of the root node. However, if this is not the case, some pointers may point toward the same element in the likelihood array.

Definition at line 50 of file ProbabilisticSubstitutionMapping.h.

Referenced by getPatterns(), getSiteIndex(), and operator=().

◆ sitesPositions_

std::vector<int> bpp::AbstractMapping::sitesPositions_
protectedinherited

◆ usePatterns_

bool bpp::ProbabilisticSubstitutionMapping::usePatterns_
private

Definition at line 52 of file ProbabilisticSubstitutionMapping.h.

Referenced by getSiteIndex(), operator=(), and usePatterns().


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