A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NewickBrokerElement Struct Reference

#include <genesis/tree/formats/newick/element.hpp>

Detailed Description

Store the information for one element of a Newick tree.

Most of the class' members are public, as it is intended to serve an an intermediate data exchange format, so different callers might need to modify its content. However, this means paying attention when working with the data, as it can be changed from anywhere.

See NewickBroker class for a description of this intermediate format.

Definition at line 60 of file element.hpp.

Public Member Functions

 NewickBrokerElement ()
 Constructor, initializes the item values. More...
 
 NewickBrokerElement (NewickBrokerElement const &)=default
 
 NewickBrokerElement (NewickBrokerElement &&)=default
 
 ~NewickBrokerElement ()=default
 
bool is_inner () const
 Return whether this is an inner node, i.e., not a leaf node. More...
 
bool is_leaf () const
 Return whether this is a leaf node. More...
 
bool is_root () const
 Return whether this is the root node of the tree. More...
 
NewickBrokerElementoperator= (NewickBrokerElement const &)=default
 
NewickBrokerElementoperator= (NewickBrokerElement &&)=default
 
int rank () const
 Returns the rank (number of immediate children) of this node. More...
 

Public Attributes

std::vector< std::string > comments
 Arbitrary strings that can be attached to a node, e.g. in Newick format via "[]". More...
 
int depth
 Depth of the node in the tree, i.e. its distance from the root. More...
 
std::string name
 Name of the node. More...
 
friend NewickBroker
 
std::vector< std::string > tags
 Arbitrary strings that can be attached to a node, e.g. in Newick format via "{}". More...
 
std::vector< std::string > values
 Numerical values associated with the node, i.e. branch lengths. More...
 

Constructor & Destructor Documentation

NewickBrokerElement ( )
inline

Constructor, initializes the item values.

Definition at line 72 of file element.hpp.

~NewickBrokerElement ( )
default

Member Function Documentation

bool is_inner ( ) const
inline

Return whether this is an inner node, i.e., not a leaf node.

Definition at line 161 of file element.hpp.

bool is_leaf ( ) const
inline

Return whether this is a leaf node.

Definition at line 150 of file element.hpp.

bool is_root ( ) const
inline

Return whether this is the root node of the tree.

Definition at line 142 of file element.hpp.

NewickBrokerElement& operator= ( NewickBrokerElement const &  )
default
NewickBrokerElement& operator= ( NewickBrokerElement &&  )
default
int rank ( ) const
inline

Returns the rank (number of immediate children) of this node.

NewickBroker::assign_ranks() has to be called before using this function. Otherwise, this function will throw an std::logic_error.

Definition at line 131 of file element.hpp.

Member Data Documentation

std::vector<std::string> comments

Arbitrary strings that can be attached to a node, e.g. in Newick format via "[]".

Definition at line 114 of file element.hpp.

int depth

Depth of the node in the tree, i.e. its distance from the root.

Definition at line 119 of file element.hpp.

std::string name

Name of the node.

In case it is a leaf, this is usually the name of the taxon represented by the node. Internal nodes are named "Internal Node" in case no name is specified in the Newick format, same applies to the (possibly virtual) root, which is named "Root Node" by default.

Definition at line 96 of file element.hpp.

friend NewickBroker

Definition at line 62 of file element.hpp.

std::vector<std::string> tags

Arbitrary strings that can be attached to a node, e.g. in Newick format via "{}".

Definition at line 109 of file element.hpp.

std::vector<std::string> values

Numerical values associated with the node, i.e. branch lengths.

In cases wehre the values need to be interpreted as edge values, this is the edge leading to this node's parent.

Definition at line 104 of file element.hpp.


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