|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_TREE_FORMATS_NEWICK_SIMPLE_TREE_H_
2 #define GENESIS_TREE_FORMATS_NEWICK_SIMPLE_TREE_H_
123 static std::unique_ptr< SimpleNewickNodeData >
create()
128 virtual std::unique_ptr< BaseNodeData >
recreate()
const override
133 virtual std::unique_ptr< BaseNodeData >
clone()
const override
182 static std::unique_ptr< SimpleNewickEdgeData >
create()
187 virtual std::unique_ptr< BaseEdgeData >
recreate()
const override
192 virtual std::unique_ptr< BaseEdgeData >
clone()
const override
235 auto const& orig_node =
dynamic_cast< CommonNodeData const&
>( node_data );
236 attr_node->
name = orig_node.name;
242 auto const& orig_edge =
dynamic_cast< CommonEdgeData const&
>( edge_data );
253 #endif // include guard
Tree convert(Tree const &source, std::function< std::unique_ptr< BaseNodeData >(BaseNodeData const &node_data)> node_data_converter, std::function< std::unique_ptr< BaseEdgeData >(BaseEdgeData const &edge_data)> edge_data_converter)
Create a tree with the same topology as the source tree, while converting its data.
virtual ~SimpleNewickNodeData() override=default
virtual std::unique_ptr< BaseNodeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
SimpleNewickTree convert_common_tree_to_simple_newick_tree(CommonTree const &source)
Helper function that takes a CommonTree (or any Tree with Node and Edge data derived from it) and tur...
Base class for storing data on Edges of a Tree.
virtual std::unique_ptr< BaseNodeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.
SimpleNewickNodeData & operator=(SimpleNewickNodeData &&)=delete
Class for representing phylogenetic trees.
Data class for SimpleNewickTreeNodes.
std::vector< std::string > values
Numerical values associated with the node, excluding branch lengths.
static std::unique_ptr< SimpleNewickNodeData > create()
double branch_length
Branch length of the edge.
static std::unique_ptr< SimpleNewickEdgeData > create()
std::string name
Name of the node.
virtual std::unique_ptr< BaseEdgeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
virtual std::unique_ptr< BaseEdgeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
virtual ~SimpleNewickEdgeData() override=default
Base class for storing data on Nodes of a Tree.
std::vector< std::string > comments
List of comments such as NHX elements.
Common class containing the commonly needed data for tree edges.
Common class containing the commonly needed data for tree nodes.
SimpleNewickEdgeData()=default
SimpleNewickNodeData()=default
Data class for SimpleNewickTreeEdges.
std::vector< std::string > tags
Arbitrary strings that can be attached to a node via curly brackets "{}".
SimpleNewickEdgeData & operator=(SimpleNewickEdgeData &&)=delete