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

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

Detailed Description

A name of a Pquery and its multiplicity.

This class is modeled after the jplace standard, which allows for multiple names for a Pquery. This is useful if there are identical sequences in the original data for which the phylogenetic placement was carried out. The placements of those sequences can then be treated as one entity, i.e., one Pquery, while still maintaining all their identifiers (names).

Furthermore, each such name can have a multiplicity, which can be used to store, e.g., the number of replicates of the original sequence. It is used as a factor for the weights of PqueryPlacements in some calculations.

Definition at line 55 of file name.hpp.

Public Member Functions

 PqueryName ()=default
 Default constructor. Initializes the name to an empty string and the multiplicity to 1.0. More...
 
 PqueryName (PqueryName &&)=default
 
 PqueryName (PqueryName const &)=default
 
 PqueryName (std::string const &name, double multiplicity=1.0)
 Constructor that takes a name and optionally a multiplicity. More...
 
 ~PqueryName ()=default
 
 operator std::string & ()
 Implicit conversion to std::string that returns the name for simplicity. More...
 
 operator std::string const & () const
 Implicit conversion to std::string that returns the name for simplicity. More...
 
PqueryNameoperator= (PqueryName &&)=default
 
PqueryNameoperator= (PqueryName const &)=default
 

Public Attributes

double multiplicity = 1.0
 Multiplicity of the name. More...
 
std::string name
 Name for a Pquery. More...
 

Constructor & Destructor Documentation

◆ PqueryName() [1/4]

PqueryName ( )
default

Default constructor. Initializes the name to an empty string and the multiplicity to 1.0.

◆ PqueryName() [2/4]

PqueryName ( std::string const &  name,
double  multiplicity = 1.0 
)
inlineexplicit

Constructor that takes a name and optionally a multiplicity.

Definition at line 72 of file name.hpp.

◆ ~PqueryName()

~PqueryName ( )
default

◆ PqueryName() [3/4]

PqueryName ( PqueryName const &  )
default

◆ PqueryName() [4/4]

PqueryName ( PqueryName &&  )
default

Member Function Documentation

◆ operator std::string &()

operator std::string & ( )
inline

Implicit conversion to std::string that returns the name for simplicity.

Definition at line 92 of file name.hpp.

◆ operator std::string const &()

operator std::string const & ( ) const
inline

Implicit conversion to std::string that returns the name for simplicity.

Definition at line 100 of file name.hpp.

◆ operator=() [1/2]

PqueryName& operator= ( PqueryName &&  )
default

◆ operator=() [2/2]

PqueryName& operator= ( PqueryName const &  )
default

Member Data Documentation

◆ multiplicity

double multiplicity = 1.0

Multiplicity of the name.

This property is defined by the jplace standard. It is used as a count for e.g., the abundance of this Pquery (respectively this name). For some calculations, this value is used as a factor for the placment weights (see PqueryPlacement::like_weight_ratio). Thus, by default, the value is initialized to 1.0.

If a Pquery has multiple names, all their multiplicities are added when being used as a weight factor.

Definition at line 131 of file name.hpp.

◆ name

std::string name

Name for a Pquery.

This property is defined by the jplace standard. It does not need to be unique. However, using unique names certainly makes iditifying Pqueries easier.

Definition at line 118 of file name.hpp.


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