> For the complete documentation index, see [llms.txt](https://genomania.gitbook.io/project/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://genomania.gitbook.io/project/genomics/phylogenetics/phylogenetic-trees-by-hand.md).

# Phylogenetic trees by hand

1\) Start with aligned sequences:

![Aligned sequences A-F](https://3363968408-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYj6uvddIn47keHPo3S%2F-LZNPCKi9zW0MNOwNQSj%2F-LZNPuR0R08tyNxdnNVO%2Fimage.png?alt=media\&token=da8e1d79-3e6a-499e-9eab-b5eb23fdeb49)

2\) Build a table of all of the differences between two sequences. For example, sequences A and B have 9 differences

![Just an example showing there are 9 differences between A and B](https://3363968408-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYj6uvddIn47keHPo3S%2F-LZNPCKi9zW0MNOwNQSj%2F-LZNQ9axihJrGH5pAayf%2Fimage.png?alt=media\&token=040e8daa-e4b9-4058-a31d-0e1389a03baf)

![The actual table we've made of all the differences. Try it yourself!](https://3363968408-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYj6uvddIn47keHPo3S%2F-LZNPCKi9zW0MNOwNQSj%2F-LZNQHM6KQuiNJTlhTWe%2Fimage.png?alt=media\&token=a161f6a9-ef31-4416-883b-b7758761d031)

3\) Find a pair of sequences that has the fewest differences. In this case, there's a tie--(B and E) and (A and C) each only have 2 differences. Draw branches to connect those pairs.

![We connected (A and C) and (B and E)](https://3363968408-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYj6uvddIn47keHPo3S%2F-LZNPCKi9zW0MNOwNQSj%2F-LZNQjzp8btlULvmRAsX%2Fimage.png?alt=media\&token=8885ac91-e8c6-45fe-ab70-78b8507f18a3)

4\) Re-do the table (from step 2) but with A-C and B-E as one group. To find the number of differences between a group (like (A and C)) and a single sequence (like D) just take the average. For example, D has 4 differences with A and 5 differences with C, so it has 4.5 differences with (A and C).&#x20;

![Our first table with combined sequences!](https://3363968408-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYj6uvddIn47keHPo3S%2F-LZNPCKi9zW0MNOwNQSj%2F-LZNR_938NnTVJZBLTO-%2Fimage.png?alt=media\&token=762155bc-4d9f-47e7-9462-d088af25c805)

Now we just keep repeating steps 3 and 4, like so:

(3 again) The two sequences that have the fewest differences are (A and C) and D. So let's combine those.&#x20;

![Making progress!](https://3363968408-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYj6uvddIn47keHPo3S%2F-LZNPCKi9zW0MNOwNQSj%2F-LZNRuDAipx3GHVIaUKq%2Fimage.png?alt=media\&token=e2a2d561-7f11-4474-9cf8-3e898014c7b9)

(4 again) make the new table

![More tables!](https://3363968408-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYj6uvddIn47keHPo3S%2F-LZNPCKi9zW0MNOwNQSj%2F-LZNS39n2gGCgpHEYsVK%2Fimage.png?alt=media\&token=5e6e8107-d73f-438a-83af-2136f93792a1)

(3 again) The sequences with the fewest differences are (A and C and D) and (B and E). Combine those

![This is starting to look legit](https://3363968408-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYj6uvddIn47keHPo3S%2F-LZNPCKi9zW0MNOwNQSj%2F-LZNSDvNBLe2O7DUTRTC%2Fimage.png?alt=media\&token=458f4971-a7ac-4376-a46f-17f77606c7de)

At this point, we don't need to make another table because we only have 1 sequence left (poor F). So let's just throw that on the end:

![That's our tree!](https://3363968408-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LYj6uvddIn47keHPo3S%2F-LZNPCKi9zW0MNOwNQSj%2F-LZNSd32Bq0ye5_V72x9%2Fimage.png?alt=media\&token=d6ab5952-3e55-4886-b8ca-e11aa05455e6)

{% embed url="<https://www.youtube.com/watch?v=09eD4A_HxVQ>" %}
