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

#include <genesis/tree/common_tree/newick_reader.hpp>

Inherited by PlacementTreeNewickReader, CommonTreeNewickReader, IndexedAttributeTreeNewickReader, KeyedAttributeTreeNewickReader, and SimpleNewickTreeNewickReader.

Detailed Description

Provide a set of plugin functions for NewickReader to read a CommonTree.

Definition at line 50 of file tree/common_tree/newick_reader.hpp.

Public Member Functions

 CommonTreeNewickReaderPlugin ()=default
 
 CommonTreeNewickReaderPlugin (CommonTreeNewickReaderPlugin &&)=default
 
 CommonTreeNewickReaderPlugin (CommonTreeNewickReaderPlugin const &)=default
 
virtual ~CommonTreeNewickReaderPlugin ()=default
 
double default_branch_length () const
 Get the default branch length used when there is none given for an edge. More...
 
self_typedefault_branch_length (double value)
 Set the default branch length used when there is none given for an edge. More...
 
std::string const & default_inner_name () const
 Get the default named used when there is none given for an inner node. More...
 
self_typedefault_inner_name (std::string const &value)
 Set the default named used when there is none given for an inner node. More...
 
std::string const & default_leaf_name () const
 Get the default named used when there is none given for a leaf node. More...
 
self_typedefault_leaf_name (std::string const &value)
 Set the default named used when there is none given for a leaf node. More...
 
std::string const & default_root_name () const
 Get the default named used when there is none given for the root node. More...
 
self_typedefault_root_name (std::string const &value)
 Set the default named used when there is none given for the root node. More...
 
void element_to_edge (NewickBrokerElement const &element, TreeEdge &edge) const
 
void element_to_node (NewickBrokerElement const &element, TreeNode &node) const
 
CommonTreeNewickReaderPluginoperator= (CommonTreeNewickReaderPlugin &&)=default
 
CommonTreeNewickReaderPluginoperator= (CommonTreeNewickReaderPlugin const &)=default
 
void register_with (NewickReader &reader) const
 
bool replace_name_underscores () const
 Return whether currently this plugin replaces underscores with spaces. More...
 
self_typereplace_name_underscores (bool value)
 Set whether to replace all underscores ('_') in names with spaces (' '). More...
 
self_typeset_default_names (std::string const &value)
 Shorthand to set the default names for leaf, inner and root node at once, to one value. More...
 
bool use_default_names () const
 Return whether currently default names are activated in this plugin. More...
 
self_typeuse_default_names (bool value)
 Set whether to replace unnamed nodes with a default name. More...
 

Public Types

using self_type = CommonTreeNewickReaderPlugin
 

Constructor & Destructor Documentation

◆ CommonTreeNewickReaderPlugin() [1/3]

◆ ~CommonTreeNewickReaderPlugin()

virtual ~CommonTreeNewickReaderPlugin ( )
virtualdefault

◆ CommonTreeNewickReaderPlugin() [2/3]

◆ CommonTreeNewickReaderPlugin() [3/3]

Member Function Documentation

◆ default_branch_length() [1/2]

double default_branch_length ( ) const
inline

Get the default branch length used when there is none given for an edge.

Definition at line 80 of file tree/common_tree/newick_reader.hpp.

◆ default_branch_length() [2/2]

self_type& default_branch_length ( double  value)
inline

Set the default branch length used when there is none given for an edge.

By default, this is 1.0.

Definition at line 90 of file tree/common_tree/newick_reader.hpp.

◆ default_inner_name() [1/2]

std::string const& default_inner_name ( ) const
inline

Get the default named used when there is none given for an inner node.

Definition at line 116 of file tree/common_tree/newick_reader.hpp.

◆ default_inner_name() [2/2]

self_type& default_inner_name ( std::string const &  value)
inline

Set the default named used when there is none given for an inner node.

Definition at line 124 of file tree/common_tree/newick_reader.hpp.

◆ default_leaf_name() [1/2]

std::string const& default_leaf_name ( ) const
inline

Get the default named used when there is none given for a leaf node.

Definition at line 99 of file tree/common_tree/newick_reader.hpp.

◆ default_leaf_name() [2/2]

self_type& default_leaf_name ( std::string const &  value)
inline

Set the default named used when there is none given for a leaf node.

Definition at line 107 of file tree/common_tree/newick_reader.hpp.

◆ default_root_name() [1/2]

std::string const& default_root_name ( ) const
inline

Get the default named used when there is none given for the root node.

Definition at line 133 of file tree/common_tree/newick_reader.hpp.

◆ default_root_name() [2/2]

self_type& default_root_name ( std::string const &  value)
inline

Set the default named used when there is none given for the root node.

Definition at line 141 of file tree/common_tree/newick_reader.hpp.

◆ element_to_edge()

void element_to_edge ( NewickBrokerElement const &  element,
TreeEdge edge 
) const
inline

Definition at line 242 of file tree/common_tree/newick_reader.hpp.

◆ element_to_node()

void element_to_node ( NewickBrokerElement const &  element,
TreeNode node 
) const
inline

Definition at line 219 of file tree/common_tree/newick_reader.hpp.

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ register_with()

void register_with ( NewickReader reader) const
inline

Definition at line 254 of file tree/common_tree/newick_reader.hpp.

◆ replace_name_underscores() [1/2]

bool replace_name_underscores ( ) const
inline

Return whether currently this plugin replaces underscores with spaces.

See the setter replace_name_underscores( bool ) for details.

Definition at line 196 of file tree/common_tree/newick_reader.hpp.

◆ replace_name_underscores() [2/2]

self_type& replace_name_underscores ( bool  value)
inline

Set whether to replace all underscores ('_') in names with spaces (' ').

This is demanded by the original definition of the Newick format, see http://evolution.genetics.washington.edu/phylip/newicktree.html However, because under most common circumstances, it is more confusing than helpful, we decided to deactivate this by default. Thus, the default for this setting is false.

Definition at line 209 of file tree/common_tree/newick_reader.hpp.

◆ set_default_names()

self_type& set_default_names ( std::string const &  value)
inline

Shorthand to set the default names for leaf, inner and root node at once, to one value.

Definition at line 151 of file tree/common_tree/newick_reader.hpp.

◆ use_default_names() [1/2]

bool use_default_names ( ) const
inline

Return whether currently default names are activated in this plugin.

See the setter use_default_names( bool ) for details.

Definition at line 164 of file tree/common_tree/newick_reader.hpp.

◆ use_default_names() [2/2]

self_type& use_default_names ( bool  value)
inline

Set whether to replace unnamed nodes with a default name.

Common is false. In this case, nodes without names in the Newick tree are simply unnamed, i.e., their name is the emptry string.

If set to true, unnamed nodes are named using one of the default names:

These default names can be changed by using default_leaf_name( std::string const& ), default_inner_name( std::string const& ) and default_root_name( std::string const& ), or by using set_default_names( std::string const& ) to set all three at once.

Definition at line 185 of file tree/common_tree/newick_reader.hpp.

Member Typedef Documentation

◆ self_type


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