A library for working with phylogenetic and population genetic data.
v0.27.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
genesis::tree::LayoutShape
LayoutShape
Shape of the tree for drawing, either circular or rectangular.
Definition: layout_base.hpp:50
genesis::utils::ColorMap
Store a list of colors and offer them as a map for values in range [ 0.0, 1.0 ].
Definition: map.hpp:61
genesis::tree::LayoutParameters
Definition: tree/drawing/functions.hpp:121
genesis::tree::LayoutType
LayoutType
Type of tree for drawing, either phylogram or cladogram.
Definition: layout_base.hpp:62
genesis::utils::ColorNormalization
Base class for color normalization.
Definition: normalization.hpp:52
map.hpp
genesis::tree::write_tree_to_newick_file
void write_tree_to_newick_file(CommonTree const &tree, std::string const &newick_filename)
Write a newick file containing a tree.
Definition: tree/drawing/functions.cpp:68
layout_base.hpp
genesis::tree::write_color_tree_to_phyloxml_file
void write_color_tree_to_phyloxml_file(CommonTree const &tree, std::vector< utils::Color > const &color_per_branch, std::string const &phyloxml_filename)
Definition: tree/drawing/functions.cpp:88
genesis::utils::SvgStroke
Definition: attributes.hpp:49
genesis::tree::LayoutParameters::stroke
utils::SvgStroke stroke
Definition: tree/drawing/functions.hpp:126
genesis::tree::Tree
Class for representing phylogenetic trees.
Definition: tree/tree.hpp:97
genesis::tree::LayoutShape::kCircular
@ kCircular
genesis::tree::write_tree_to_phyloxml_file
void write_tree_to_phyloxml_file(CommonTree const &tree, std::string const &phyloxml_filename)
Write a phyloxml file containing a tree.
Definition: tree/drawing/functions.cpp:79
genesis::tree::LayoutParameters::ladderize
bool ladderize
Definition: tree/drawing/functions.hpp:125
genesis::tree::CommonTree
Tree CommonTree
Alias for a Tree with data types CommonNodeData and CommonEdgeData.
Definition: placement/function/distances.hpp:55
genesis
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Definition: placement/formats/edge_color.cpp:42
genesis::tree::write_tree_to_nexus_file
void write_tree_to_nexus_file(CommonTree const &tree, std::string const &nexus_filename)
Write a nexus file containing a tree.
Definition: tree/drawing/functions.cpp:122
tree.hpp
color.hpp
Header of Color class.
genesis::tree::write_color_tree_to_svg_file
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)
Definition: tree/drawing/functions.cpp:231
genesis::tree::LayoutType::kCladogram
@ kCladogram
svg.hpp
genesis::tree::write_tree_to_svg_file
void write_tree_to_svg_file(CommonTree const &tree, LayoutParameters const &params, std::string const &svg_filename)
Definition: tree/drawing/functions.cpp:216
normalization.hpp
genesis::tree::write_color_tree_to_nexus_file
void write_color_tree_to_nexus_file(CommonTree const &tree, std::vector< utils::Color > const &color_per_branch, std::string const &nexus_filename)
Definition: tree/drawing/functions.cpp:131
genesis::tree::LayoutParameters::shape
LayoutShape shape
Definition: tree/drawing/functions.hpp:123
genesis::tree::LayoutParameters::type
LayoutType type
Definition: tree/drawing/functions.hpp:124