Skip to content

Commit

Permalink
fix typos/links and add melioidosis image
Browse files Browse the repository at this point in the history
  • Loading branch information
widdowquinn committed Mar 19, 2024
1 parent 9086d70 commit 273b2fb
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 39 deletions.
Binary file added assets/images/hepatic-melioidosis.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This year is the first presentation of the workshop material in this format, and
This workshop asks you to work through some computational exercises to gain some practice visualising and working with phylogenetic trees.

::: { .callout-note }
Phylogenetic trees are typically constructed _after_ sequence alignment has been performed. You learned about the fundamentals of (pairwise) sequence alignment in BM214 Workshop 2 - [slides](https://classes.myplace.strath.ac.uk/mod/resource/view.php?id=1956504), [workshop](https://sipbs-compbiol.github.io/BM214-Workshop-2/). You may find it useful to refresh your memory about pairwise alignment.
Phylogenetic trees are typically constructed _after_ sequence alignment has been performed. You learned about the fundamentals of (pairwise) sequence alignment in BM214 Workshop 2 - [slides](https://classes.myplace.strath.ac.uk/mod/resource/view.php?id=1956504), [workshop](https://sipbs-compbiol.github.io/BM214-Workshop-2/). You may find it useful to refresh your memory about this topic.
:::

::: { .callout-warning title="Important Note" }
Expand Down
6 changes: 4 additions & 2 deletions intro.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ A number of software packages are available to visualise, edit, and refine phylo
- [`figtree`]() _this is the one I use most often - LP_
- [`dendroscope`](https://www.wsi.uni-tuebingen.de/lehrstuehle/algorithms-in-bioinformatics/software/dendroscope/)

but the [interactive Tree of Life (iTol)](https://itol.embl.de/) service allows you, once you register and sign in, to edit trees directly in the browser. Traditionally, phylogenetic trees have been visualised using independent software tools like these.
but the [interactive Tree of Life (iTol)](https://itol.embl.de/) service allows you to visualise and edit trees directly in the browser. If you register and sign in, you can save your trees for future use.

::: { .callout-caution }
In this workshop we will be using the online `iToL` service to visualise and interpret trees.
:::

The `R` software ecosystem is a very powerful tool for computational biology and bioinformatics work, encompassing sequence analysis and genomics, transcriptomic and evolutionary analyses, with excellent visualisation capabilities. As `R` is also a programming language, large parts of the analysis can be automated and made reproducible, which is an advantage over independent tools, and a factor in the growing popularity of this approach. Basic competence and skills in `R` are in high demand in academia and industry.
Traditionally, phylogenetic trees have been visualised using independent software tools like these, but the `R` software ecosystem is a very powerful tool for computational biology and bioinformatics work, encompassing sequence analysis and genomics, transcriptomic and evolutionary analyses, with excellent visualisation capabilities - including for phylogenetic trees.

As `R` is also a programming language, large parts of the analysis can be automated and made reproducible, which is an advantage over independent tools, and a factor in the growing popularity of this approach. Basic competence and skills in `R` are in high demand in academia and industry.

::: { .callout-note }
You can produce equivalent trees to those you will produce in these exercises using standalone tools like `figtree` and `dendroscope`. Some tree visualisations can only be achieved in specialised packages, or with tools like `ggtree`.
Expand Down
12 changes: 6 additions & 6 deletions itol-visualisation-1.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 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 controlled through the control panel (@fig-itol-control-panel).
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%}

Expand All @@ -14,7 +14,7 @@ The default tree presented by `iToL` (@fig-tree-newick-01) is a _rectangular_ tr
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-tree-newick-05)
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%}

Expand All @@ -23,7 +23,7 @@ Broadly-speaking this means that the tree looks "rectangular" (it has lots of ri
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`. 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).
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_.**
Expand Down Expand Up @@ -70,11 +70,11 @@ Rotating the members of a clade around their common ancestor also does not affec

![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 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-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 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-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 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 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.
:::
Expand Down
38 changes: 27 additions & 11 deletions loading-tree.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ As noted in @sec-introduction, you will generally encounter phylogenetic trees a
- [`NEXUS`](https://en.wikipedia.org/wiki/Nexus_file), file ending `.nex`, `.nexus`
- [`phylip`](https://en.wikipedia.org/wiki/PHYLIP), file ending `.phy`, `.phylip`

Whichever software tool you use to read and visualise your tree, you will need to _load_ the data into that tool. In `iToL` you would need to upload the data to the server. In `figtree` or `dendroscope` you would open the file through a dialogue box. Using `ggtree` in `R`, you would write code to open the file and run commands to visualise it.
Whichever software tool you use to read and visualise your tree, you will need to _load_ your data into that tool. In `iToL` you need to upload the data to the server. In `figtree` or `dendroscope` you would open the file in the application. Using `ggtree` in `R`, you would write code to open the file and run commands to visualise it.

::: { .callout-note }
In this workshop we will be using the online `iToL` service to visualise and interpret trees. This does not require you to install any software on your machine. The `iToL` service is available at the link below.
Expand All @@ -22,8 +22,24 @@ In this workshop we will be using the online `iToL` service to visualise and int

Your tree data is in a file called `tree_newick.nwk`. This tree file describes a phylogeny with 13 samples, and it should be downloaded to your computer from the link below.

::: { .callout-note }
If you single-click on the link below, the tree file will open in your browser.

If you right-click on the link, you will see a _context menu_ with the option `Save link as…` (or similar, depending on your operating system/browser). This will allow you to save the file to your computer.
:::

- [**`tree_newick.nwk`**](https://raw.githubusercontent.com/sipbs-compbiol/BM211-Workshop-5/main/assets/trees/tree_newick.nwk)

::: { .callout-important title="Task" }
Download the tree file `tree_newick.nwk` to your computer.
:::

::: { .callout-tip collapse="true" }
## I need a hint!

Right-click on the link above and use `Save link as…` to save the file on your computer.
:::

::: { .callout-important title="Task" }
Upload the tree file `tree_newick.nwk` to `iToL`.
:::
Expand Down Expand Up @@ -68,22 +84,22 @@ The tree `iTol` presents at first (@fig-tree-newick-01) shows these relationship

![Rectangular phylogram representation of the `tree_newick.nwk` file.](assets/images/tree-newick-01.png){#fig-tree-newick-01 width=80%}

- the tree is a set of _bifurcating branches_ that spread out from the last common ancestor (LCA) and represent an **estimated** evolutionary history
- this is a _rooted tree_, so the last common ancestor (LCA) is considered to be represented at the very far left of the tree, at its _root_
- the tree is a set of _bifurcating branches_ that spread out from the most recent common ancestor (MRCA) and represent an **estimated** evolutionary history
- this is a _rooted tree_, so the most recent common ancestor (MRCA) is considered to be represented at the very far left of the tree, at its _root_
- **in this tree, _ancestors_ are on the left, and _descendants_ are on the right**
- the horizontal dimension in this plot shows the amount of genetic change since the LCA - less change towards the left-hand side, more towards the right
- the horizontal dimension in this plot shows the amount of genetic change since the MRCA - less change towards the left-hand side, more towards the right
- **this tree is a _phylogram_, which means that the lengths of the branches are meaningful and represent the amount of genetic change**

::: { .callout-note }
Branch lengths are usually drawn in units of _nucleotide substitutions per site_ - the estimated total number of nucleotide substitutions, divided by (_normalised to_) the length of the sequence.
Branch lengths are usually drawn in units of _substitutions per site_ - the estimated total number of nucleotide substitutions, divided by (_normalised to_) the length of the sequence.

You may sometimes see alternative units being used, such as estimated time, or the percentage of sites that have changed.
:::

::: { .callout-important collapse="true" }
## Question 01

In @fig-tree-newick-01 which species shows the most genetic change since the LCA?
In @fig-tree-newick-01 which species shows the most genetic change since the MRCA?

- `A`
- `E`
Expand All @@ -93,11 +109,11 @@ In @fig-tree-newick-01 which species shows the most genetic change since the LCA

### Trees and time

The general relationship between this phylogram and time is shown in @fig-tree-newick-02.
The general relationship between the phylogram you have made and time is shown in @fig-tree-newick-02.

![`iToL` phylogram annotated with _root_, _leaves_, _bifurcations_, and the relationship between ancestors and descendents.](assets/images/tree-newick-02.png){#fig-tree-newick-02 width=80%}

As the tree represents genetic change, and the rate of genetic change may not be constant in all sequences or organisms, we can't immediately interpret branch lengths as time. The best we can sometimes do is - when the sequences/organisms used to build the tree are known to exist _now_ - say that the leaves of the tree approximately represent the current date.
As the tree represents genetic change, and the rate of genetic change may not be constant in all sequences or organisms, we can't immediately interpret branch lengths in terms of _elapsed time_. But, when the sequences/organisms used to build the tree are known to exist _now_, we can say that the leaves of the tree approximately represent the current date.

::: { .callout-note }
There are phylogenetic techniques that allow us to convert genetic distances into approximate times, but they are beyond the scope of this workshop.
Expand Down Expand Up @@ -139,7 +155,7 @@ In @fig-tree-newick-01 which of the following accumulated the greatest amount of

### Clades

A _clade_ is a grouping on the tree that includes a common ancestor and all of its descendants. We call a group with these properties _monpphyletic_ (i.e. it comprises a single phylum). @fig-tree-newick-04 shows examples of clades in the `iToL` tree you generated.
A _clade_ is a grouping on the tree that includes a common ancestor and all of its descendants. We call a group with these properties _monophyletic_ (i.e. it comprises a single phylum). @fig-tree-newick-04 shows examples of clades in the `iToL` tree you generated.

![`iToL` phylogram annotated with _clades_, groupings on the tree that include a common ancestor and all its descendants. Clades can be _nested_ inside each other as a hierarchy. Clade4 (`A`, `B`, `C`) is completely contained within Clade3 (`A`, `B`, `C`, `D`, `E`).](assets/images/tree-newick-04.png){#fig-tree-newick-04 width=80%}

Expand All @@ -160,9 +176,9 @@ In @fig-tree-newick-01 which of the following groups of leaf nodes form a _clade
After successfully working through this section you should be able to:

- upload a phylogenetic tree into `iToL`
- explain the meaning of branching events and branch lengths in a phylogenetic tree
- explain the meaning of branching events and branch lengths in a phylogenetic tree, and interpret the speciation events in a tree
- explain how a phylogenetic tree represents history and ancestry
- explain the concept of a _clade_ in phylogenetics
- explain the concept of a _clade_ in phylogenetics, and identify one on a phylogenetic tree
:::

::: { .callout-important }
Expand Down
Loading

0 comments on commit 273b2fb

Please sign in to comment.