A library for working with phylogenetic and population genetic data.
v0.27.0
PqueryPlacement Class Reference

#include <genesis/placement/pquery/placement.hpp>

Detailed Description

One placement position of a Pquery on a Tree.

This class is modeled after the jplace standard, which allows for multiple placement positions for a Pquery. Usually, those positions are on different branches of the tree. The property values of this class describe one such placement position.

In order to check the position of this placement on the tree, see proximal_length, pendant_length and edge(). In order to check the likelihood and probability of this placement beging placed exaclty where it is, see likelihood and like_weight_ratio.

Definition at line 75 of file placement/pquery/placement.hpp.

Public Member Functions

 PqueryPlacement ()
 Default constructor. Sets all values to 0. More...
 
 PqueryPlacement (PlacementTreeEdge &edge)
 Constructor that takes the edge where this placement is being placed at. More...
 
 PqueryPlacement (PqueryPlacement &&)=default
 
 PqueryPlacement (PqueryPlacement const &)=default
 
 ~PqueryPlacement ()=default
 
PlacementTreeEdgeedge ()
 Get the PlacementTreeEdge where this PqueryPlacement is placed. More...
 
PlacementTreeEdge const & edge () const
 Get the PlacementTreeEdge where this PqueryPlacement is placed. More...
 
PlacementEdgeData::EdgeNumType edge_num () const
 Get the edge_num where this PqueryPlacement is placed. More...
 
PqueryPlacementoperator= (PqueryPlacement &&)=default
 
PqueryPlacementoperator= (PqueryPlacement const &)=default
 
void reset_edge (PlacementTreeEdge &edge)
 Set the PlacementTreeEdge at which this PqueryPlacement is placed. More...
 

Public Attributes

double like_weight_ratio
 Likelihood weight ratio of this placement. More...
 
double likelihood
 Total likelihood of the tree with this placement attached to it. More...
 
double pendant_length
 Length of the attached branch of this placement. More...
 
double proximal_length
 Distance of this placement to the next node towards the root. More...
 

Constructor & Destructor Documentation

◆ PqueryPlacement() [1/4]

PqueryPlacement ( )
inline

Default constructor. Sets all values to 0.

Definition at line 86 of file placement/pquery/placement.hpp.

◆ PqueryPlacement() [2/4]

PqueryPlacement ( PlacementTreeEdge edge)
inlineexplicit

Constructor that takes the edge where this placement is being placed at.

Definition at line 97 of file placement/pquery/placement.hpp.

◆ ~PqueryPlacement()

~PqueryPlacement ( )
default

◆ PqueryPlacement() [3/4]

PqueryPlacement ( PqueryPlacement const &  )
default

◆ PqueryPlacement() [4/4]

PqueryPlacement ( PqueryPlacement &&  )
default

Member Function Documentation

◆ edge() [1/2]

PlacementTreeEdge& edge ( )
inline

Get the PlacementTreeEdge where this PqueryPlacement is placed.

Definition at line 202 of file placement/pquery/placement.hpp.

◆ edge() [2/2]

PlacementTreeEdge const& edge ( ) const
inline

Get the PlacementTreeEdge where this PqueryPlacement is placed.

Definition at line 194 of file placement/pquery/placement.hpp.

◆ edge_num()

PlacementEdgeData::EdgeNumType edge_num ( ) const
inline

Get the edge_num where this PqueryPlacement is placed.

This number corresponds to the edge_num property as described in the jplace standard. It is not to be confused with the index of the PlacementTreeEdge.

Definition at line 186 of file placement/pquery/placement.hpp.

◆ operator=() [1/2]

PqueryPlacement& operator= ( PqueryPlacement &&  )
default

◆ operator=() [2/2]

PqueryPlacement& operator= ( PqueryPlacement const &  )
default

◆ reset_edge()

void reset_edge ( PlacementTreeEdge edge)
inline

Set the PlacementTreeEdge at which this PqueryPlacement is placed.

This should be rarely needed. It is mostly intended for the Readers that populate the data. When setting this value, the user is responsible to make sure that the new value is actually a PlacementTreeEdge of the PlacementTree that belongs to the Sample where the Pquery of this PqueryPlacement is stored.

Definition at line 215 of file placement/pquery/placement.hpp.

Member Data Documentation

◆ like_weight_ratio

double like_weight_ratio

Likelihood weight ratio of this placement.

The likelihood weight ratio is a probability-like value of how certain the placement algorithm was when placing the Pquery at the edge of this placement. The like_weight_ratios of all placements for one Pquery sum up to 1.0. As not all of them might be stored in the Pquery, however, the sum might be lower.

This property is defined by the jplace standard.

Definition at line 137 of file placement/pquery/placement.hpp.

◆ likelihood

double likelihood

Total likelihood of the tree with this placement attached to it.

This property is defined by the jplace standard.

Definition at line 125 of file placement/pquery/placement.hpp.

◆ pendant_length

double pendant_length

Length of the attached branch of this placement.

The placement can be interpreted as a new branch on the Tree. This value then gives the length of that branch.

This property is defined by the jplace standard.

Definition at line 165 of file placement/pquery/placement.hpp.

◆ proximal_length

double proximal_length

Distance of this placement to the next node towards the root.

This value determines the distance of the placement attachement position on the edge to the next TreeNode that lies towards the root of the Tree.

This property is not defined by the jplace standard. Instead, the standard uses distal_length, which is the opposite of this value: It determines the distance to the next node that lies away from the root. We use the proximal_length instead, as it is much more convenient for most purposes. In order to obtain the distal_length, use

PqueryPlacement p;
double distal_length = p.edge().data<PlacementEdgeData>().branch_length - p.proximal_length;

This is also the formula that is internally used to convert between the two.

Definition at line 155 of file placement/pquery/placement.hpp.


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