|
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_COLOR_WRITER_PLUGIN_H_
2 #define GENESIS_TREE_FORMATS_NEWICK_COLOR_WRITER_PLUGIN_H_
88 color_tag_prefix_ = prefix;
96 return color_tag_prefix_;
107 color_tag_suffix_ = suffix;
115 return color_tag_suffix_;
135 throw std::length_error(
136 "Color vector does not have as many elements as the tree has edges."
174 void set_color_(
NewickBrokerElement& element,
unsigned char r,
unsigned char g,
unsigned char b )
const
179 void set_color_( NewickBrokerElement& element,
utils::Color color )
const
190 element.comments.push_back(
201 std::string color_tag_prefix_ =
"&!color=";
202 std::string color_tag_suffix_ =
"";
209 #endif // include guard
NewickColorWriterPlugin()=default
virtual ~NewickColorWriterPlugin() override=default
Write a Tree to Newick format.
std::vector< prepare_writing_function > prepare_writing_plugins
Collect all functions to be called before starting the actual tree writing.
size_t index() const
Return the index of this Edge.
void color_tag_prefix(std::string const &prefix)
Set the prefix string that is used within the Newick comment before the actual color value.
utils::Color ignored_color() const
Return the currently set ignored color. See the setter for more information.
void edge_to_element(TreeEdge const &edge, NewickBrokerElement &element) const
Class for representing phylogenetic trees.
bool enable_color() const
Returns whether colors tags are written to the output.
void color_tag_suffix(std::string const &suffix)
Set the suffix string that is used within the Newick comment after the actual color value.
std::vector< edge_to_element_function > edge_to_element_plugins
Collect all functions to be called for each TreeEdge in order to translate it to a Newick representat...
NewickColorWriterPlugin & operator=(NewickColorWriterPlugin const &)=default
Plugin class for Newick output that allows coloring of edges.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Stores a Newick tree in an intermediate format that can be further processed into a Tree.
bool use_ignored_color() const
Return whether currently an ignored color is used.
std::string color_tag_prefix() const
Get the currently set prefix string. See the setter for more information.
Base class for creating plugin classes that allow coloring of Tree edges.
std::vector< utils::Color > const & edge_colors() const
Return the edge colors that are currently set.
std::string color_tag_suffix() const
Get the currently set suffix string. See the setter for more information.
void prepare_writing(Tree const &tree, NewickBroker &broker) const
Store the information for one element of a Newick tree.
void register_with(NewickWriter &writer) const
std::string color_to_hex(Color const &c, std::string const &prefix, bool uppercase, bool with_alpha)
Return a hex string representation of a Color in the format "#003366[ff]".
size_t edge_count() const
Return the number of TreeEdges of the Tree.