|
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_READER_H_
2 #define GENESIS_TREE_FORMATS_NEWICK_READER_H_
61 struct NewickBrokerElement;
157 TokenType type = TokenType::kEnd;
162 std::string at()
const
193 Tree
read( std::shared_ptr<utils::BaseInputSource> source )
const;
220 std::shared_ptr<utils::BaseInputSource> source,
222 std::string
const& default_name =
""
232 std::vector<std::shared_ptr<utils::BaseInputSource>> sources,
234 std::string
const& default_name =
""
244 std::vector<std::shared_ptr<utils::BaseInputSource>> sources,
245 std::string
const& default_name =
""
335 std::string
const& default_name
371 void broker_to_tree_prepare_(
381 void broker_to_tree_element_(
383 std::vector<TreeLink*>& link_stack,
392 void broker_to_tree_finish_(
415 bool enable_tags_ =
false;
416 bool stop_after_semicolon_ =
false;
423 #endif // include guard
create_node_data_function create_node_data_plugin
std::function< void(NewickBrokerElement const &element, TreeNode &node) > element_to_node_function
Function type that translates from a NewickBrokerElement to a TreeNode.
std::pair< std::string, Tree > parse_named_tree(utils::InputStream &input_stream) const
Parse one named tree, i.e., a tree as described here.
std::function< void(TreeEdge &edge) > create_edge_data_function
Function type used to create the data pointer for each TreeEdge.
std::vector< finish_reading_function > finish_reading_plugins
create_edge_data_function create_edge_data_plugin
tree::TreeSet tree_set(SampleSet const &sample_set)
Return a TreeSet containing all the trees of the SampleSet.
NewickReader & operator=(NewickReader const &)=default
std::function< void(NewickBroker const &broker, Tree &tree) > prepare_reading_function
Function type that allows to do some preparatory work with the NewickBroker and Tree before the actua...
bool stop_after_semicolon() const
Return whether currently reading stops after the semicolon that finishes a Newick tree.
std::function< void(NewickBrokerElement const &element, TreeEdge &edge) > element_to_edge_function
Function type that translates from a NewickBrokerElement to a TreeEdge.
void parse_multiple_trees(utils::InputStream &input_stream, TreeSet &tree_set, std::string const &default_name) const
Parse until the end of the stream and add all Trees to the TreeSet.
std::string to_string(GenomeLocus const &locus)
std::function< void(TreeNode &node) > create_node_data_function
Function type used to create the data pointer for each TreeNode.
std::vector< element_to_edge_function > element_to_edge_plugins
Class for representing phylogenetic trees.
std::vector< prepare_reading_function > prepare_reading_plugins
std::function< void(Tree &tree) > finish_reading_function
Function type that allows to do some finalizing work with the Tree after the actual tree reading fini...
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
bool enable_tags() const
Return whether currently Newick tags are enabled.
Tree broker_to_tree_destructive(NewickBroker &broker) const
Build a Tree from a NewickBroker.
Stores a Newick tree in an intermediate format that can be further processed into a Tree.
std::vector< element_to_node_function > element_to_node_plugins
virtual ~NewickReader()=default
Tree read(std::shared_ptr< utils::BaseInputSource > source) const
Read a single Tree from an input source containing a Newick tree.
Tree broker_to_tree(NewickBroker const &broker) const
Build a Tree from a NewickBroker.
Store the information for one element of a Newick tree.
Tree parse_single_tree(utils::InputStream &input_stream) const
Parse a single tree. Depending on stop_after_semicolon(), stop after the semicolon or continue until ...