#include <genesis/tree/formats/newick/element.hpp>
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 (long depth) | |
Constructor, initializes the item values and sets the depth. More... | |
NewickBrokerElement (NewickBrokerElement &&)=default | |
NewickBrokerElement (NewickBrokerElement const &)=default | |
NewickBrokerElement (std::string const &name, long depth) | |
Constructor, initializes the item values and sets the name and the depth. More... | |
~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... | |
NewickBrokerElement & | operator= (NewickBrokerElement &&)=default |
NewickBrokerElement & | operator= (NewickBrokerElement const &)=default |
long | 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... | |
long | 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... | |
|
inline |
Constructor, initializes the item values.
Definition at line 73 of file element.hpp.
|
inlineexplicit |
Constructor, initializes the item values and sets the depth.
Definition at line 81 of file element.hpp.
|
inline |
Constructor, initializes the item values and sets the name and the depth.
Definition at line 89 of file element.hpp.
|
default |
|
default |
|
default |
|
inline |
Return whether this is an inner node, i.e., not a leaf node.
Definition at line 179 of file element.hpp.
|
inline |
Return whether this is a leaf node.
Definition at line 168 of file element.hpp.
|
inline |
Return whether this is the root node of the tree.
Definition at line 160 of file element.hpp.
|
default |
|
default |
|
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 149 of file element.hpp.
std::vector<std::string> comments |
Arbitrary strings that can be attached to a node, e.g. in Newick format via "[]".
Definition at line 132 of file element.hpp.
long depth |
Depth of the node in the tree, i.e. its distance from the root.
Definition at line 137 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 114 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 127 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 122 of file element.hpp.