Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::format::newick Namespace Reference

Generic components for parsing or generating Newick strings. More...

Namespaces

namespace  extended
 Generic components for parsing or generating extended Newick strings.
 

Classes

class  Formatter
 Generic algorithm to generate the Newick formula of a tree. More...
 
class  generator
 Generate the Newick formula from an external (custom) tree class. More...
 
struct  PAUP
 Allow nested comments. More...
 
struct  PHYLIP
 Requires that an unrooted tree begin with a trifurcation; it will not "uproot" a rooted tree. More...
 
struct  remove_comments_of_depth
 Template class. More...
 
struct  remove_comments_of_depth< 0 >
 Do not remove anything. More...
 
struct  remove_comments_of_depth< 1 >
 Remove all comments substrings contained between square brackets. More...
 
struct  remove_comments_of_depth< 2 >
 Remove all comments substrings contained between square brackets of depth 2. More...
 
struct  single_function_argument
 
struct  single_function_argument< std::function< Ret(Arg)> >
 
struct  single_function_argument_impl
 
struct  TreeAlign
 Set a root node branch length to zero. Remove all nested comments. More...
 

Concepts

concept  Formattable
 Concept for label name.
 

Typedefs

template<typename P1 >
using single_function_argument_t = typename single_function_argument_impl< P1 >::type
 

Functions

template<class P1 , class P2 , class F1 , class F2 , class Policy = PAUP>
 Formatter (P1 &&, P2 &&, F1 &&, F2 &&) -> Formatter< single_function_argument_t< P1 >, P1, P2, F1, F2, Policy >
 
template<class P1 , class P2 , class F1 , class F2 , class Policy = PAUP>
auto make_formatter (P1 &&has_parent, P2 &&has_children, F1 &&label, F2 &&branch_length, Policy policy=Policy())
 to use for template lambda [](const auto& s) {} e.g. make_formatter<Node>`
 
template<class T , std::predicate< T > P1, std::predicate< T > P2, Formattable< T > F1, Formattable< T > F2, class Policy >
auto make_formatter (P1 &&has_parent, P2 &&has_children, F1 &&label, F2 &&branch_length, Policy policy=Policy())
 Can still specify type manually if you want, to use for template lambda [](const auto& s) {} e.g. make_formatter<Node>`.
 
template<typename Flavor >
std::string generate_from (quetzal::coalescence::k_ary_tree< boost::no_property, boost::no_property > const &graph, typename quetzal::coalescence::k_ary_tree< boost::no_property, boost::no_property >::vertex_descriptor root, Flavor flavor)
 
template<typename Flavor >
std::string generate_from (quetzal::coalescence::binary_tree< boost::no_property, boost::no_property > const &graph, typename quetzal::coalescence::binary_tree< boost::no_property, boost::no_property >::vertex_descriptor root, Flavor flavor)
 
template<class VertexProperty , class EdgeProperty , typename Flavor >
requires (!std::is_same_v<VertexProperty, boost::no_property> && !std::is_same_v<VertexProperty, boost::no_property>)
std::string generate_from (quetzal::coalescence::binary_tree< VertexProperty, EdgeProperty > const &graph, typename quetzal::coalescence::binary_tree< VertexProperty, EdgeProperty >::vertex_descriptor root, Flavor flavor)
 
template<class VertexProperty , class EdgeProperty , typename Flavor >
requires (!std::is_same_v<VertexProperty, boost::no_property> && !std::is_same_v<VertexProperty, boost::no_property>)
std::string generate_from (const quetzal::coalescence::k_ary_tree< VertexProperty, EdgeProperty > &graph, typename quetzal::coalescence::binary_tree< VertexProperty, EdgeProperty >::vertex_descriptor root, Flavor flavor)
 Generate a Newick string from a k-ary tree with properties.
 
template<class P1 , class P2 , class F1 , class F2 , class Policy = PAUP>
 generator (P1, P2, F1, F2, Policy pol={}) -> generator< detail::single_function_argument_t< P1 >, P1, P2, F1, F2, Policy >
 User-defined deduction guide where the node/graph type T is deduced from P1.
 
template<class VertexProperty = quetzal::format::newick::ast::node::vertex_property, class EdgeProperty = quetzal::format::newick::ast::node::edge_property>
std::tuple< quetzal::coalescence::k_ary_tree< VertexProperty, EdgeProperty >, typename quetzal::coalescence::k_ary_tree< VertexProperty, EdgeProperty >::vertex_descriptor > to_k_ary_tree (quetzal::format::newick::ast::node ast_root)
 Converts a standard Newick AST to a quetzal Tree graph.
 
template<class VertexProperty = quetzal::format::newick::ast::node::vertex_property, class EdgeProperty = quetzal::format::newick::ast::node::edge_property>
std::tuple< quetzal::coalescence::k_ary_tree< VertexProperty, EdgeProperty >, typename quetzal::coalescence::k_ary_tree< VertexProperty, EdgeProperty >::vertex_descriptor > to_k_ary_tree (const std::string &newick)
 Converts a standard Newick string to a quetzal Tree graph.
 

Detailed Description

Generic components for parsing or generating Newick strings.

  • This program is free software; you can redistribute it and/or modify /// it under the terms of the GNU General Public License as published by /// the Free Software Foundation; either version 2 of the License, or /// (at your option) any later version. /// ///

Function Documentation

◆ generator()

template<class P1 , class P2 , class F1 , class F2 , class Policy = PAUP>
quetzal::format::newick::generator ( P1  ,
P2  ,
F1  ,
F2  ,
Policy  pol = {} 
) -> generator< detail::single_function_argument_t< P1 >, P1, P2, F1, F2, Policy >

User-defined deduction guide where the node/graph type T is deduced from P1.

Remarks
Template deduction guides are patterns associated with a template class that tell the compiler how to translate a set of constructor arguments (and their types) into template parameters for the class.