A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DefaultTreeNewickWriterPlugin Class Reference

#include <genesis/tree/default/newick_writer.hpp>

Inherited by PlacementTreeNewickWriter, and DefaultTreeNewickWriter.

Detailed Description

Provide a set of plugin functions for NewickWriter to write a DefaultTree.

Definition at line 50 of file tree/default/newick_writer.hpp.

Public Member Functions

 DefaultTreeNewickWriterPlugin ()=default
 
 DefaultTreeNewickWriterPlugin (DefaultTreeNewickWriterPlugin const &)=default
 
 DefaultTreeNewickWriterPlugin (DefaultTreeNewickWriterPlugin &&)=default
 
virtual ~DefaultTreeNewickWriterPlugin ()=default
 
int branch_length_precision () const
 Get the currently set maximum precision (in number of digits) used for printing the branch_length floating point numbers. More...
 
self_typebranch_length_precision (int value)
 Set the maximum precision (in number of digits) used for printing the branch_length floating point numbers. More...
 
std::string const & default_inner_name () const
 Get the named used to filter out an inner node name. More...
 
self_typedefault_inner_name (std::string const &value)
 Set the named used to filter out an inner node name. More...
 
std::string const & default_leaf_name () const
 Get the named used to filter out a leaf node name. More...
 
self_typedefault_leaf_name (std::string const &value)
 Set the named used to filter out a leaf node name. More...
 
std::string const & default_root_name () const
 Get the named used to filter out the root node name. More...
 
self_typedefault_root_name (std::string const &value)
 Set the named used to filter out the root node name. More...
 
void edge_to_element (TreeEdge const &edge, NewickBrokerElement &element) const
 
self_typeenable_branch_lengths (bool value)
 Set whether to write branch lengths. More...
 
bool enable_branch_lengths () const
 Get whether currently any branch lengths are written. More...
 
self_typeenable_names (bool value)
 Set whether to write node names at all. More...
 
bool enable_names () const
 Get whether currently any node names are written at all. More...
 
void node_to_element (TreeNode const &node, NewickBrokerElement &element) const
 
DefaultTreeNewickWriterPluginoperator= (DefaultTreeNewickWriterPlugin const &)=default
 
DefaultTreeNewickWriterPluginoperator= (DefaultTreeNewickWriterPlugin &&)=default
 
void register_with (NewickWriter &writer) const
 
bool replace_name_spaces () const
 Return whether currently this plugin replaces spaces with underscores. More...
 
self_typereplace_name_spaces (bool value)
 Set whether to replace all spaces (' ') in names with underscores ('_'). 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 default named nodes with an empty string. More...
 

Public Types

using self_type = DefaultTreeNewickWriterPlugin
 

Constructor & Destructor Documentation

virtual ~DefaultTreeNewickWriterPlugin ( )
virtualdefault

Member Function Documentation

int branch_length_precision ( ) const
inline

Get the currently set maximum precision (in number of digits) used for printing the branch_length floating point numbers.

Definition at line 243 of file tree/default/newick_writer.hpp.

self_type& branch_length_precision ( int  value)
inline

Set the maximum precision (in number of digits) used for printing the branch_length floating point numbers.

Default is 6.

Definition at line 254 of file tree/default/newick_writer.hpp.

std::string const& default_inner_name ( ) const
inline

Get the named used to filter out an inner node name.

Definition at line 97 of file tree/default/newick_writer.hpp.

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

Set the named used to filter out an inner node name.

Definition at line 105 of file tree/default/newick_writer.hpp.

std::string const& default_leaf_name ( ) const
inline

Get the named used to filter out a leaf node name.

Definition at line 80 of file tree/default/newick_writer.hpp.

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

Set the named used to filter out a leaf node name.

Definition at line 88 of file tree/default/newick_writer.hpp.

std::string const& default_root_name ( ) const
inline

Get the named used to filter out the root node name.

Definition at line 114 of file tree/default/newick_writer.hpp.

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

Set the named used to filter out the root node name.

Definition at line 122 of file tree/default/newick_writer.hpp.

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

Definition at line 287 of file tree/default/newick_writer.hpp.

self_type& enable_branch_lengths ( bool  value)
inline

Set whether to write branch lengths.

Definition at line 225 of file tree/default/newick_writer.hpp.

bool enable_branch_lengths ( ) const
inline

Get whether currently any branch lengths are written.

Definition at line 234 of file tree/default/newick_writer.hpp.

self_type& enable_names ( bool  value)
inline

Set whether to write node names at all.

If disabled, no names are written for any node.

Definition at line 208 of file tree/default/newick_writer.hpp.

bool enable_names ( ) const
inline

Get whether currently any node names are written at all.

Definition at line 217 of file tree/default/newick_writer.hpp.

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

Definition at line 264 of file tree/default/newick_writer.hpp.

void register_with ( NewickWriter writer) const
inline

Definition at line 296 of file tree/default/newick_writer.hpp.

bool replace_name_spaces ( ) const
inline

Return whether currently this plugin replaces spaces with underscores.

See the setter replace_name_spaces( bool ) for details.

Definition at line 183 of file tree/default/newick_writer.hpp.

self_type& replace_name_spaces ( bool  value)
inline

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

This is the reverse of DefaultTreeNewickReaderPlugin::replace_name_underscores(). It is activated by default, as it does no harm on already existing underscores. However, as spaces cannot be part of names in Newick, if it is deactivated (set to false), all names that contain spaces are instead wrapped in quotation marks by the NewickWriter, see NewickWriter::quotation_marks( std::string const& ) for details.

Definition at line 197 of file tree/default/newick_writer.hpp.

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 132 of file tree/default/newick_writer.hpp.

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 145 of file tree/default/newick_writer.hpp.

self_type& use_default_names ( bool  value)
inline

Set whether to replace default named nodes with an empty string.

This setting activates the "reverse" operation of DefaultTreeNewickReaderPlugin::use_default_names( bool ). Thus, when the default names are set to the same values as in the reader plugin, reading a Newick tree and then writing it again should yield the same names in the Newick tree again.

Default is false. In this case, all node names are written to the Newick tree, indepentenly of whether they match the default names.

If set to true, a node that has one of the default names will result in an empty node name in the Newick tree:

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 172 of file tree/default/newick_writer.hpp.

Member Typedef Documentation


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