- Biotechnology: bioinformatics, biological data and the computer
How do you build a phylogenetic tree from DNA?
To build a phylogenetic tree from DNA, align the sequences, count the differences between every pair, and join the most similar pair first. Then treat that pair as one group, work out its average distance to the others and join the next closest, until all are in one tree. Fewer differences mean a more recent common ancestor.
The topic explained
Differences as a measure of kinship
A phylogenetic tree is a diagram of how living things, or their genes, are related by descent. Its tips, the leaves, are the sequences being compared; each point where branches meet, a node, stands for an inferred common ancestor. The idea that lets DNA draw such a tree is simple: mutations build up over generations, so two lineages that split recently share more of their sequence than two that split long ago.
The first step is an alignment, setting the sequences side by side so that matching positions line up, as in the four invented 12-letter sequences here. Then the differences are counted for each pair. A and B differ in only 2 positions, C differs from each of them in 6, and D differs from all three in 8. A common misreading is that the tree shows one species turning into another. The leaves are all living today; the tree shows ancestors they shared.
From a table of distances
The counts go into a distance table, one number for each pair. The table is symmetric, since A to C is the same as C to A, with zeros on the diagonal. It already holds the answer, but not yet in the shape of a tree.
Raw counts are not quite the whole story. Over a long time one position can change twice, for example from A to G and back to A, and the second change hides the first. Raw counts therefore underestimate the distance between distant sequences, and real programs correct for this with a model of how bases change. Positions where one sequence has a gap need a rule too. For short, closely related sequences like these, plain counts are a fair estimate.
Joining the closest pair, step by step
A simple distance method, UPGMA, works like this. Find the smallest number in the table: A and B, 2. Join them, placing their ancestor at half that distance, 1, from each tip. Now treat AB as one group and average its distances to the rest: to C, ; to D, . The smallest is now AB to C, 6, so C joins at height 3. Last, D joins all three at height 4, the root.
Students often read the order of the leaves from top to bottom as the order of relatedness. What matters is where branches meet: A and C share an ancestor at height 3, while A and D share one only at the root. Branches can also be rotated around a node without changing the tree at all.
What the method assumes
UPGMA assumes that every lineage changes at about the same rate, a molecular clock. When rates differ, it can join the wrong pair, so other methods are used too: neighbor joining allows unequal rates, and maximum likelihood tests which tree best explains the sequences under a model of mutation. Comparing the sequences of ribosomal RNA, Carl Woese and George Fox showed in 1977 that the archaea form a separate group of life, a discovery made from a tree. The same steps now trace the spread of viruses and the origin of crops. To judge a tree, scientists rebuild it many times from resampled positions of the alignment and report how often each branch appears; a branch that appears nearly every time is well supported.
Practice: phylogenetic trees
For 11th grade biotechnology students. Answer each question from the sheet, show your calculations, then check your answers.
Free, no sign-up. The answer key prints on the second page. Regenerating a new worksheet on the same topic needs a free account.
What do the leaves and the nodes of a phylogenetic tree stand for?
Count the differences between C (ACGTCATGAGCT) and A (GCACTGCGAGCT), and between C and B (ATACTGCGAGCT), and fill in the hidden cells.
Which species joins the others at the root? Explain from the distance table.
Fill in step 4 and calculate the distance from the group AB to C.
Three species have the distances P to Q 4, P to R 10 and Q to R 10. Which pair joins first, and at what heights are the two joins?
A student says: in the tree, A is drawn next to C, so A is more closely related to C than to D. Is that right?
Why can UPGMA give a wrong tree when one lineage mutates much faster than the others?
Common questions
What is a phylogenetic tree?
A diagram of evolutionary relationships. Its leaves are the species or genes compared, its nodes are inferred common ancestors, and its branches show the lines of descent between them.
How do you read a phylogenetic tree?
Follow two leaves back to the node where their branches meet: that node is their most recent common ancestor. The more recent that node, the more closely related they are; the order of leaves on the page does not matter.
What is the difference between UPGMA and neighbor joining?
Both build a tree from a distance table. UPGMA assumes every lineage changes at the same rate; neighbor joining allows different rates on different branches, so it is more often used for real data.
Why do scientists use ribosomal RNA genes for trees of all life?
Every cell has ribosomes, so the gene exists in all living things, and parts of it change slowly enough to compare even very distant groups, such as bacteria and archaea.
Can a tree prove how species evolved?
A tree is an inference, the best explanation of the data under a method's assumptions. Different genes or methods can give slightly different trees, so scientists test how well supported each branch is.

Still have a question? Ask Lessi
Any question about this subject. Lessi answers right here, step by step.
Try asking
Asking needs a free account; your question is kept while you sign up. Answers are written by AI and can contain mistakes. Lessi doesn’t give medical or legal advice.
Learn it with a teacher
Learn this topic live with Lessi
Lessi, the AI teacher, explains it out loud on a board, with short quizzes, at your pace. The first 60 minutes are free.