A toolkit for working with phylogenetic data.
v0.24.0
tree/drawing/functions.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_TREE_DRAWING_FUNCTIONS_H_
2 #define GENESIS_TREE_DRAWING_FUNCTIONS_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2020 Lucas Czech and HITS gGmbH
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lucas.czech@h-its.org>
23  Exelixis Lab, Heidelberg Institute for Theoretical Studies
24  Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
25 */
26 
40 
41 #include <string>
42 #include <vector>
43 
44 namespace genesis {
45 namespace tree {
46 
47 // =================================================================================================
48 // Newick Functions
49 // =================================================================================================
50 
57  CommonTree const& tree,
58  std::string const& newick_filename
59 );
60 
61 // =================================================================================================
62 // Phyloxml Functions
63 // =================================================================================================
64 
71  CommonTree const& tree,
72  std::string const& phyloxml_filename
73 );
74 
76  CommonTree const& tree,
77  std::vector<utils::Color> const& color_per_branch,
78  std::string const& phyloxml_filename
79 );
80 
82  CommonTree const& tree,
83  std::vector<double> const& value_per_branch,
84  utils::ColorMap const& color_map,
85  utils::ColorNormalization const& color_norm,
86  std::string const& phyloxml_filename
87 );
88 
89 // =================================================================================================
90 // Nexus Functions
91 // =================================================================================================
92 
99  CommonTree const& tree,
100  std::string const& nexus_filename
101 );
102 
104  CommonTree const& tree,
105  std::vector<utils::Color> const& color_per_branch,
106  std::string const& nexus_filename
107 );
108 
110  CommonTree const& tree,
111  std::vector<double> const& value_per_branch,
112  utils::ColorMap const& color_map,
113  utils::ColorNormalization const& color_norm,
114  std::string const& nexus_filename
115 );
116 
117 // =================================================================================================
118 // SVG Functions
119 // =================================================================================================
120 
122 {
125  bool ladderize = true;
127 };
128 
130  CommonTree const& tree,
131  LayoutParameters const& params,
132  std::string const& svg_filename
133 );
134 
136  CommonTree const& tree,
137  LayoutParameters const& params,
138  std::vector<utils::Color> const& color_per_branch,
139  std::string const& svg_filename
140 );
141 
143  CommonTree const& tree,
144  LayoutParameters const& params,
145  std::vector<double> const& value_per_branch,
146  utils::ColorMap const& color_map,
147  utils::ColorNormalization const& color_norm,
148  std::string const& svg_filename
149 );
150 
152  CommonTree const& tree,
153  LayoutParameters const& params,
154  std::vector<utils::Color> const& color_per_branch,
155  utils::ColorMap const& color_map,
156  utils::ColorNormalization const& color_norm,
157  std::string const& svg_filename
158 );
159 
161  CommonTree const& tree,
162  LayoutParameters const& params,
163  std::vector<utils::Color> const& color_per_branch,
164  std::vector<utils::Color> const& color_list,
165  std::vector<std::string> const& color_labels,
166  std::string const& svg_filename
167 );
168 
169 } // namespace tree
170 } // namespace genesis
171 
172 #endif // include guard
Tree CommonTree
Alias for a Tree with data types CommonNodeData and CommonEdgeData.
Store a list of colors and offer them as a map for values in range [ 0.0, 1.0 ].
Definition: map.hpp:61
void write_color_tree_to_phyloxml_file(CommonTree const &tree, std::vector< utils::Color > const &color_per_branch, std::string const &phyloxml_filename)
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
Header of Color class.
void write_color_tree_to_svg_file(CommonTree const &tree, LayoutParameters const &params, std::vector< utils::Color > const &color_per_branch, std::string const &svg_filename)
void write_tree_to_svg_file(CommonTree const &tree, LayoutParameters const &params, std::string const &svg_filename)
Class for representing phylogenetic trees.
Definition: tree/tree.hpp:97
void write_tree_to_nexus_file(CommonTree const &tree, std::string const &nexus_filename)
Write a nexus file containing a tree.
void write_tree_to_phyloxml_file(CommonTree const &tree, std::string const &phyloxml_filename)
Write a phyloxml file containing a tree.
void write_tree_to_newick_file(CommonTree const &tree, std::string const &newick_filename)
Write a newick file containing a tree.
void write_color_tree_to_nexus_file(CommonTree const &tree, std::vector< utils::Color > const &color_per_branch, std::string const &nexus_filename)
Base class for color normalization.
LayoutShape
Shape of the tree for drawing, either circular or rectangular.
Definition: layout_base.hpp:50
LayoutType
Type of tree for drawing, either phylogram or cladogram.
Definition: layout_base.hpp:62