-
Notifications
You must be signed in to change notification settings - Fork 0
/
itol-visualisation-1.qmd
205 lines (121 loc) · 11.9 KB
/
itol-visualisation-1.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# Types of Phylogenetic Tree {#sec-itol-visualise}
## Introduction
In this section, we will work through some of the visualisation options available in `iToL` to explore how the same phylogenetic tree can be presented to accentuate different aspects of the data. These options are managed through the control panel (@fig-itol-control-panel).
![The `iTol` control panel. Options in this menu allow you to change the way the tree is visualised.](assets/images/itol-control-panel.png){#fig-itol-control-panel width=80%}
## Cladograms and Phylograms
The default tree presented by `iToL` (@fig-tree-newick-01) is a _rectangular_ tree.
::: { .callout-note }
You can see from @fig-itol-control-panel that the `Rectangular` mode is selected by default.
:::
Broadly-speaking this means that the tree looks "rectangular" (it has lots of right angles) in a way that other tree representations do not. More specifically, every bifurcation is presented as a kind of "T-junction" where the ancestral lineage splits into two descendant lineages that leave the bifurcation at right angles (@fig-itol-tree-newick-05)
![The default `iToL` view of the uploaded `tree_newick.nwk` tree is a _rectangular_ tree - specifically a _phylogram_.](assets/images/tree-newick-05.png){#fig-itol-tree-newick-05 width=80%}
::: { .callout-tip title="Two forms of rectangular tree"}
1. a tree in which the branch lengths are proportional to the genetic change represented by the tree - this is called a _phylogram_
2. a tree in which the branch lengths carry no meaning, or are an arbitrary length - this is called a _cladogram_
:::
You can toggle between these two forms of _rectangular_ tree in `iTol` by changing the `Branch lengths:` option from `Use` to `Ignore` (@fig-itol-control-panel). A cladogram shows the order of branching events, but does not provide visual information about the genetic change between nodes on the tree (branching events or leaves).
::: { .callout-tip }
**The order of branching events in a tree is referred to as its _topology_.**
:::
![By setting the `Branch lengths:` option to `ignore`, `iToL` will show a _rectangular_ _cladogram_.](assets/images/tree-newick-06.png){#fig-itol-tree-newick-06 width=80%}
## Tree rotation
Rotating a tree does not change its content or the relationships it describes. All four trees in @fig-four-rotated-trees show exactly the same information. These trees were generated by setting the `Rotation` value in the `iToL` control panel (@fig-itol-control-panel).
::: { .callout-tip collapse="true"}
## Scaling and rotating trees in `iToL`
To rotate your tree in `iToL`, use the `Rotation` setting in the `Mode Options` part of the `Basic` tab:
![The `Basic` tab has a `Rotation` setting that you can use to rotate your tree through any angle](assets/images/itol-control-panel.png){#fig-itol-rotation width=80%}
Changing the _scaling_ of the tree (stretching or compressing it in any direction) also does not change the information presented. The trees in @fig-four-rotated-trees were scaled horizontally by 50% using the `Advanced` tab of the `iToL` control panel (@fig-itol-control-panel-02).
![The advanced tab of the `iTol` control panel. Options in this menu allow you to change the way the tree is visualised.](assets/images/itol-control-panel-02.png){#fig-itol-control-panel-02 width=80%}
:::
::: {#fig-four-rotated-trees layout-ncol=2 width=80%}
![Default rotation, 0 degrees](assets/images/tree-newick-06.png){#fig-no-rotation width=80%}
![90 degrees rotation](assets/images/tree-newick-07.png){#fig-90deg-rot height=20% width=80%}
![180 degrees rotation](assets/images/tree-newick-08.png){#fig-180deg-rot width=80%}
![270 degrees rotation](assets/images/tree-newick-09.png){#fig-270deg-rot height=20% width=80%}
The same cladogram, rotated through 90, 180, and 270 degrees. The tree shows exactly the same information in each rotation.
:::
## Rotating clades
Rotating the members of a clade around their common ancestor also does not affect the content of the tree - and specifically leaves its _topology_ (branching order) unchanged - even if it makes the tree appear visually quite different. The four trees in @fig-four-rotated-clades have exactly the same topology.
::: {#fig-four-rotated-clades layout-ncol=2}
![The phylogram prior to any rotation, with the clade containing (`I`, `J`, `K`, and `L`) highlighted.](assets/images/tree-newick-10.png){#fig-clade-rot1}
![The phylogram in @fig-clade-rot1 after rotating the clade containing (`I`, `J`, `K`, and `L`) around their common ancestor. This does not change the topology of the tree.](assets/images/tree-newick-11.png){#fig-clade-rot2}
![The phylogram in @fig-clade-rot2 after rotating the clade containing (`F`, `G`, and `H`) around their common ancestor. This does not change the topology of the tree.](assets/images/tree-newick-12.png){#fig-clade-rot3}
![The phylogram in @fig-clade-rot3 after rotating the clade containing (`A`, `B`, `C`, and `D`) around their common ancestor. This does not change the topology of the tree.](assets/images/tree-newick-13.png){#fig-clade-rot4}
The same cladogram, progressively rotating clades so that node order increases along the tree. The tree shows exactly the same information in each rotation - the _topology_ (branching order) of the tree remains unchanged.
:::
::: { .callout-tip collapse="true"}
## Rotating a clade in `iToL`
To rotate a clade in `iTol`, select the clade in the tree by clicking on its ancestral branch:
![Select a clade in `iTol` by clicking on its ancestral branch](assets/images/itol-select clade.png){#fig-itol-select-clade width=80%}
This will bring up a _context menu_ that includes the action to `Rotate children`. Clicking on the `Rotate children` action will rotate the two "child" branches of the clade around their common ancestor.
![The clade _context menu_, showing the `Rotate children` action.](assets/images/itol-clade-context.png){#fig-itol-clade-context width=80%}
![The result of rotating a clade](assets/images/itol-rotate-clade.png){#fig-itol-rotate-clade width=80%}
:::
## Non-rectangular trees
Phylogenetic trees do not need to be rectangular and, even if drawn using different forms, still present the same information as their rectangular counterparts.
### Slanted cladogram
The angle formed at each branching event doesn't need to be rectangular (at 90 degrees) - it can be narrower, as in a _slanted cladogram_. @fig-slanted-comparison shows rectangular and slanted cladograms of the same tree. Being cladograms they provide only topology information, and this is the same in both renderings.
::: {#fig-slanted-comparison layout-ncol=2}
![Rectangular cladogram.](assets/images/tree-newick-15.png){#fig-rect-clad}
![Slanted cladogram.](assets/images/tree-newick-14.png){#fig-rect-clad}
A rectangular and a slanted cladogram of the same phylogenetic tree, presenting identical evolutionary information.
:::
::: { .callout-tip collapse="true"}
## Drawing a slanted cladogram in `iToL`
To generate a slanted cladogram in `iTol`, select `Yes` for the `Slanted` option in the `Basic` tab:
![The `Basic` tab has a `Rotation` setting that you can use to rotate your tree through any angle](assets/images/itol-control-panel-slanted.png){#fig-itol-slanted width=80%}
:::
### Circular phylogram
It is increasingly common, as datasets increase in size, to see _circular phylograms_ in publications. These place the root at the centre of a circle and show the branches as radii with branching points moving away from the centre as genetic changes increase.
Rendering a tree in circular form does not change the information being presented, in comparison with a rectangular phylogram, as can be seen in @fig-circular-comparison.
::: {#fig-circular-comparison layout-ncol=2}
![Rectangular phylogram](assets/images/tree-newick-17.png){#fig-rect-phyl}
![Circular phylogram](assets/images/tree-newick-16.png){#fig-circ-phyl}
A rectangular and a circular phylogram of the same phylogenetic tree, presenting identical evolutionary information.
:::
::: { .callout-tip collapse="true"}
## Drawing a circular phylogram in `iToL`
To generate a circular phylogram in `iTol`, select `Circular` mode in the `Basic` tab, and ensure that `Branch lengths` is set to `Use`:
![Use the `Circular` mode to generate a circular tree in `iToL`](assets/images/itol-control-panel-circular.png){#fig-itol-circular width=80%}
:::
::: { .callout-caution title="Pros and cons of circular phylograms" collapse="true"}
**Pros**
- Circular trees are efficient with space
- Circular trees are especially useful for fitting large trees into a small space, such as a journal page.
**Cons**
- It can be difficult to read the labels on circular trees easily
- Due to the way they are presented, especially for trees with lots of data, it can be difficult to see the branching order of nodes close to the root.
:::
### Unrooted trees
All the trees you have seen so far have an implied _root_ - a single ancestral point from which all the sequences or species represented on the tree have descended. In terms of all like on Earth, we would call this root the [Last Universal Common Ancestor (LUCA)](https://astrobiology.nasa.gov/news/looking-for-luca-the-last-universal-common-ancestor/). For most trees we work with as scientists, the common ancestor would be much more recent than LUCA.
::: { .callout-tip collapse="true"}
## Rooted vs Unrooted Trees
Some tree reconstruction methods, such as UPGMA or Neighbour-Joining (NJ) automatically produce _rooted_ trees, because of the way their algorithms work.
Other, more accurate and precise, phylogenetic reconstruction methods such as Maximum Likelihood (ML) and Bayesian approaches produce _unrooted_ trees. These methods do not tell the user where the root of the tree is likely to be, so we often include an _outgroup_ - a species/sequence, or set of species/sequences that we already believe to be _ancestral to_ the part of the tree we're more focused on. This allows us to determine the most likely order of divergenece in that part of the tree.
For example, if we wanted to produce a phylogenetic tree for primates, we would choose an _outgroup_ such as lagomorphs (rabbits, hares, etc.) oor colugos (Dermoptera), that diverged from an earlier common ancestor with primates (@Perelman2011-jg).
:::
Unrooted trees, like that in @fig-unrooted-comparison, appear to extend out from a central point, **but that central point may or may not be the real root of the tree.** In @fig-unrooted-comparison, the rectangular tree implies that the root, i.e. the point at which the last common ancestor diverged into the ancestor of `M` and the ancestor of the remaining species, lies somewhere between M and the last common ancestor of `J` and `D`, **_not_** at the central junction in the tree.
::: {#fig-unrooted-comparison layout-ncol=2}
![Rectangular phylogram](assets/images/tree-newick-17.png){#fig-rect-phyl2}
![Unrooted phylogram](assets/images/tree-newick-18.png){#fig-unrooted}
Rectangular and unrooted phylograms of the same phylogeny.
:::
::: { .callout-tip collapse="true"}
## Drawing an unrooted tree in `iToL`
To generate an unrooted tree in `iTol`, select `Unrooted` mode in the `Basic` tab:
![Use the `Circular` mode to generate an unrooted tree in `iToL`](assets/images/itol-control-panel-unrooted.png){#fig-itol-unrooted width=80%}
:::
## Summary
::: { .callout-note title="Well Done!"}
After successfully working through this section you should be able to:
- explain the difference between a phylogram and cladogram
- generate a rectangular phylogram and a rectangular cladogram using `iToL`
- describe and interpret the _topology_ of a tree
- describe and interpret _branch lengths_ of a tree
- explain how rotation of a tree, and clades within the tree, affects what the tree represents
- generate slanted cladograms, unrooted trees, and circular trees using `iToL`
:::
::: { .callout-important }
**Please complete the workshop by answering the questions below in the formative quiz on MyPlace**
- [MyPlace formative quiz]({{< var myplace.quiz2 >}})
:::