A library for working with phylogenetic and population genetic data.
v0.32.0
heat_tree.hpp
Go to the documentation of this file.
1
#ifndef GENESIS_TREE_DRAWING_HEAT_TREE_H_
2
#define GENESIS_TREE_DRAWING_HEAT_TREE_H_
3
4
/*
5
Genesis - A toolkit for working with phylogenetic data.
6
Copyright (C) 2014-2023 Lucas Czech
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 <lczech@carnegiescience.edu>
23
Department of Plant Biology, Carnegie Institution For Science
24
260 Panama Street, Stanford, CA 94305, USA
25
*/
26
34
#include "
genesis/tree/common_tree/tree.hpp
"
35
#include "
genesis/tree/drawing/layout_base.hpp
"
36
#include "
genesis/utils/containers/matrix.hpp
"
37
#include "
genesis/utils/formats/svg/svg.hpp
"
38
#include "
genesis/utils/color/color.hpp
"
39
#include "
genesis/utils/color/map.hpp
"
40
#include "
genesis/utils/color/normalization.hpp
"
41
42
#include <string>
43
#include <vector>
44
45
namespace
genesis
{
46
namespace
tree {
47
48
// =================================================================================================
49
// SVG Functions
50
// =================================================================================================
51
52
struct
HeatTreeParameters
53
{
54
// Tree parameters
55
CommonTree
tree
;
56
LayoutType
type
=
LayoutType::kCladogram
;
57
bool
ladderize
=
true
;
58
std::vector<utils::Color>
color_per_branch
;
59
utils::SvgStroke
stroke
;
60
61
// Matrix parameters
62
utils::Matrix<utils::Color>
matrix
;
63
std::vector<std::string>
column_labels
;
64
bool
matrix_as_bmp
=
false
;
65
};
66
67
utils::SvgDocument
heat_tree
(
68
HeatTreeParameters
const
& params
69
);
70
71
utils::SvgDocument
heat_tree
(
72
HeatTreeParameters
const
& params,
73
utils::ColorMap
const
& matrix_color_map,
74
utils::ColorNormalization
const
& matrix_color_norm
75
);
76
77
utils::SvgDocument
heat_tree
(
78
HeatTreeParameters
const
& params,
79
utils::ColorMap
const
& matrix_color_map,
80
utils::ColorNormalization
const
& matrix_color_norm,
81
utils::ColorMap
const
& tree_color_map,
82
utils::ColorNormalization
const
& tree_color_norm
83
);
84
85
}
// namespace tree
86
}
// namespace genesis
87
88
#endif // include guard
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::HeatTreeParameters::stroke
utils::SvgStroke stroke
Definition:
heat_tree.hpp:59
genesis::tree::LayoutType
LayoutType
Type of tree for drawing, either phylogram or cladogram.
Definition:
layout_base.hpp:62
genesis::tree::HeatTreeParameters
Definition:
heat_tree.hpp:52
genesis::utils::ColorNormalization
Base class for color normalization.
Definition:
normalization.hpp:52
map.hpp
genesis::tree::HeatTreeParameters::matrix_as_bmp
bool matrix_as_bmp
Definition:
heat_tree.hpp:64
genesis::tree::HeatTreeParameters::ladderize
bool ladderize
Definition:
heat_tree.hpp:57
layout_base.hpp
genesis::tree::HeatTreeParameters::column_labels
std::vector< std::string > column_labels
Definition:
heat_tree.hpp:63
genesis::tree::HeatTreeParameters::color_per_branch
std::vector< utils::Color > color_per_branch
Definition:
heat_tree.hpp:58
genesis::utils::Matrix
Definition:
placement/function/emd.hpp:53
genesis::utils::SvgStroke
Definition:
attributes.hpp:49
genesis::tree::Tree
Class for representing phylogenetic trees.
Definition:
tree/tree.hpp:97
genesis::tree::HeatTreeParameters::type
LayoutType type
Definition:
heat_tree.hpp:56
matrix.hpp
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
tree.hpp
color.hpp
Header of Color class.
genesis::tree::HeatTreeParameters::tree
CommonTree tree
Definition:
heat_tree.hpp:55
genesis::utils::SvgDocument
Definition:
svg/document.hpp:50
genesis::tree::LayoutType::kCladogram
@ kCladogram
genesis::tree::HeatTreeParameters::matrix
utils::Matrix< utils::Color > matrix
Definition:
heat_tree.hpp:62
svg.hpp
genesis::tree::heat_tree
utils::SvgDocument heat_tree(HeatTreeParameters const ¶ms)
Definition:
heat_tree.cpp:359
normalization.hpp
lib
genesis
tree
drawing
heat_tree.hpp
Generated on Mon Aug 5 2024 16:57:52 for genesis by
1.8.17