Intuition The big picture (WHY do we build trees?)
Species, genes and proteins share ancestors. If two sequences are very similar , they probably diverged recently ; if they are very different, they diverged long ago . A phylogenetic tree is just a way of drawing "who is closest to whom" so that branch lengths encode evolutionary distance and the branching pattern (topology) encodes shared ancestry . The whole game is: turn a table of sequence differences into a tree that best explains them.
Definition Core vocabulary
Leaf (tip / taxon): an observed sequence/species (present-day).
Internal node: a hypothetical common ancestor.
Branch length: amount of evolutionary change (substitutions per site).
Topology: the shape — which taxa group together.
Rooted tree: has a direction of time (one node is the ancestor of all).
Unrooted tree: shows relationships but not the direction of time.
Outgroup: a distantly related taxon added on purpose to root the tree .
There are two broad families of algorithms:
Family
Input
Idea
Distance-based
a distance matrix D i j D_{ij} D ij
cluster closest things first (UPGMA, Neighbor-Joining)
Character-based
the aligned sequences themselves
search for the tree that best explains every column (Maximum Parsimony, Maximum Likelihood, Bayesian)
Intuition WHY we need distances first
Raw sequences can't be compared directly; we first align them, then count differences. The simplest distance is the p-distance :
p = number of differing sites total aligned sites p = \frac{\text{number of differing sites}}{\text{total aligned sites}} p = total aligned sites number of differing sites
But p p p underestimates true divergence because of multiple hits (a site may mutate A→G→A and look unchanged). The Jukes–Cantor correction fixes this.
Worked example Computing a corrected distance
Two sequences differ at 60 of 300 sites ⇒ p = 0.20 \Rightarrow p = 0.20 ⇒ p = 0.20 .
d = − 3 4 ln ( 1 − 4 3 ( 0.2 ) ) = − 0.75 ln ( 0.7333 ) = 0.2326 d = -\tfrac{3}{4}\ln(1 - \tfrac{4}{3}(0.2)) = -0.75\ln(0.7333) = 0.2326 d = − 4 3 ln ( 1 − 3 4 ( 0.2 )) = − 0.75 ln ( 0.7333 ) = 0.2326
Why this step? 0.2326 > 0.20 0.2326 > 0.20 0.2326 > 0.20 — the correction added the hidden multiple hits.
U nweighted P air G roup M ethod with A rithmetic mean.
Intuition WHY it works / WHAT it assumes
Repeatedly join the two closest clusters and place their ancestor halfway between them. This assumes a molecular clock (constant substitution rate), so all leaves are equidistant from the root (an ultrametric tree).
HOW (the loop):
Find the pair ( i , j ) (i,j) ( i , j ) with smallest D i j D_{ij} D ij .
Merge them into cluster u u u ; place node at height D i j / 2 D_{ij}/2 D ij /2 .
Update distances by weighted average of cluster sizes :
D ( u ) k = n i D i k + n j D j k n i + n j D_{(u)k} = \frac{n_i D_{ik} + n_j D_{jk}}{n_i + n_j} D ( u ) k = n i + n j n i D ik + n j D j k
Repeat until one cluster remains.
Worked example UPGMA on 4 taxa
D D D : A-B=2, A-C=4, A-D=4, B-C=4, B-D=4, C-D=2.
Smallest = A-B (2) and C-D (2). Join A-B → node at height 1. Why? closest pair merges first.
Join C-D → node at height 1.
Distance (AB)-(CD) = average of A-C,A-D,B-C,B-D = 4. Join at height 2.
Result: ((A,B),(C,D)), ultrametric. ✔
Common mistake Steel-man: "UPGMA is the safe default."
Why it feels right: it's simple and always gives a rooted tree. Why it's wrong: if lineages evolve at different rates , the clock assumption fails and UPGMA groups fast-evolving taxa incorrectly (long-branch problems). Fix: use Neighbor-Joining , which does NOT assume a clock.
Intuition WHY it beats UPGMA
Instead of just "closest pair", NJ picks the pair that is closest and far from everyone else, using a correction term. This gives the minimum-evolution (shortest total branch length) tree and works even with unequal rates.
Worked example One NJ step (4 taxa)
D D D : A-B=5, A-C=9, A-D=9, B-C=10, B-D=10, C-D=8. n = 4 n=4 n = 4 .
Row sums: R A = 23 , R B = 25 , R C = 27 , R D = 27 R_A=23,\,R_B=25,\,R_C=27,\,R_D=27 R A = 23 , R B = 25 , R C = 27 , R D = 27 .
Q A B = ( 2 ) ( 5 ) − 23 − 25 = − 38 Q_{AB}=(2)(5)-23-25=-38 Q A B = ( 2 ) ( 5 ) − 23 − 25 = − 38 . Compute all → Q A B Q_{AB} Q A B is most negative.
Why join A,B? most negative Q Q Q ⇒ true neighbors. Then δ A u = 1 2 ( 5 ) + 1 4 ( 23 − 25 ) = 2 \delta_{Au}=\tfrac12(5)+\tfrac{1}{4}(23-25)=2 δ A u = 2 1 ( 5 ) + 4 1 ( 23 − 25 ) = 2 , δ B u = 3 \delta_{Bu}=3 δ B u = 3 .
Update: D u C = 1 2 ( 9 + 10 − 5 ) = 7 D_{uC}=\tfrac12(9+10-5)=7 D u C = 2 1 ( 9 + 10 − 5 ) = 7 , D u D = 7 D_{uD}=7 D u D = 7 . Continue with the reduced 3×3 matrix.
Occam's razor: prefer the tree requiring the fewest evolutionary changes (mutations) to explain the aligned columns. HOW: for each candidate topology, count the minimum substitutions per column using Fitch's algorithm (bottom-up set operations), sum over columns, pick the smallest total.
Worked example One column, tree
((A,B),(C,D)), states A=C, B=A, C=G, D=G.
Node(A,B): { C } ∩ { A } = ∅ ⇒ { C , A } \{C\}\cap\{A\}=\varnothing \Rightarrow \{C,A\} { C } ∩ { A } = ∅ ⇒ { C , A } , +1.
Node(C,D): { G } ∩ { G } = { G } \{G\}\cap\{G\}=\{G\} { G } ∩ { G } = { G } , +0.
Root: { C , A } ∩ { G } = ∅ ⇒ + 1 \{C,A\}\cap\{G\}=\varnothing \Rightarrow +1 { C , A } ∩ { G } = ∅ ⇒ + 1 . Total = 2 changes.
Why: we chose intersections when possible to avoid inventing extra mutations.
Common mistake Steel-man: "Fewer changes always = true tree."
Why it feels right: simplicity is elegant. Why it fails: under high divergence, parsimony suffers long-branch attraction — unrelated fast-evolving taxa get grouped because coincidental identical states look like shared ancestry. Fix: model-based Maximum Likelihood .
Intuition WHY use a probabilistic model
Instead of just counting, ML uses a substitution model (JC, K2P, GTR) to compute
L ( tree ) = P ( data ∣ topology , branch lengths , model ) L(\text{tree}) = P(\text{data}\mid \text{topology}, \text{branch lengths}, \text{model}) L ( tree ) = P ( data ∣ topology , branch lengths , model )
and picks the tree/branch lengths that maximize this probability. It explicitly models multiple hits and rate variation, so it's the most accurate (but computationally heavy — the number of trees explodes).
Bootstrap: resample alignment columns with replacement, rebuild the tree many times; the % of replicates showing a clade = its support (≥70% ≈ reliable).
Recall The 20% that gives 80%
Distance methods (UPGMA, NJ) = fast, need a matrix; NJ is the practical default.
UPGMA assumes a molecular clock (rooted, ultrametric); NJ does not (unrooted).
Character methods (Parsimony, ML, Bayesian) use raw columns; ML = most accurate.
JC correction fixes multiple-hit underestimation.
Long-branch attraction is the classic failure mode.
Bootstrap / posterior = statistical support.
Recall Explain to a 12-year-old (hidden)
Imagine friends who copied a story from each other and made small spelling mistakes. If two friends have almost the same mistakes, they copied recently. We draw a family tree of copies: friends with matching mistakes sit on the same little branch. UPGMA just keeps pairing the two most-alike friends. Neighbor-Joining is smarter — it also checks who is weird compared to everybody . Parsimony picks the tree that needs the fewest new spelling mistakes to explain everything. Likelihood uses probability rules for how often letters change to find the most believable tree.
Mnemonic Remember the four algorithms
"U Never Play Loud" → U PGMA, N eighbor-Joining, P arsimony, L ikelihood — ordered simple→sophisticated (distance → character → statistical).
What does a branch length in a phylogenetic tree represent? The amount of evolutionary change (substitutions per site) along that lineage.
Which assumption does UPGMA make that NJ does not? A molecular clock (constant substitution rate), giving an ultrametric rooted tree.
Why does p-distance underestimate true evolutionary distance? It ignores multiple substitutions at the same site (hidden back/parallel mutations).
State the Jukes–Cantor distance formula. d = − 3 4 ln ( 1 − 4 3 p ) d = -\tfrac{3}{4}\ln(1-\tfrac{4}{3}p) d = − 4 3 ln ( 1 − 3 4 p ) .
In Neighbor-Joining, which pair is joined? The pair with the minimum value in the Q-matrix
Q i j = ( n − 2 ) D i j − ∑ k D i k − ∑ k D j k Q_{ij}=(n-2)D_{ij}-\sum_k D_{ik}-\sum_k D_{jk} Q ij = ( n − 2 ) D ij − ∑ k D ik − ∑ k D j k .
What is the goal of Maximum Parsimony? Find the tree requiring the fewest total evolutionary changes (Occam's razor).
Name the algorithm used to count minimum changes per column in parsimony. Fitch's algorithm (set intersection/union, bottom-up).
What is long-branch attraction? Artifactual grouping of unrelated fast-evolving taxa due to coincidental shared states.
What does Maximum Likelihood maximize? P(data | topology, branch lengths, substitution model).
How is an unrooted tree usually rooted? By including an outgroup — a known distantly related taxon.
What does a bootstrap value of 90% mean? 90% of resampled datasets recovered that clade — strong support.
UPGMA cluster-distance update formula? D ( u ) k = n i D i k + n j D j k n i + n j D_{(u)k}=\dfrac{n_iD_{ik}+n_jD_{jk}}{n_i+n_j} D ( u ) k = n i + n j n i D ik + n j D j k (size-weighted average).
Sequence Alignment — provides the aligned columns/distance matrix.
Substitution Models (JC, K2P, GTR) — power distance correction & ML.
Molecular Clock Hypothesis — assumption behind UPGMA.
Bootstrap and Resampling Statistics — branch support.
Occam's Razor and Parsimony — logical basis of MP.
Homology vs Homoplasy — the signal vs noise in tree building.
UPGMA and Neighbor-Joining
Parsimony, Likelihood, Bayesian
Intuition Hinglish mein samjho
Dekho, phylogenetic tree ka pura funda simple hai: jo sequences zyada milte-julte hain, woh recently alag hue (close relatives), aur jo bahut alag hain woh bahut pehle diverge hue. Pehle hum sequences ko align karte hain, phir differences count karke ek distance matrix banate hain. Lekin seedha p-distance galat hota hai kyunki ek hi site pe multiple mutations ho sakte hain (A→G→A dikhta same), isliye Jukes-Cantor correction lagate hain — log wale formula se true distance thoda upar chala jata hai.
Do main family hain. Distance-based methods matrix se kaam karte hain: UPGMA sabse aasan hai — bas do closest clusters ko join karo aur ancestor ko beech mein (D/2 height pe) rakho. Par UPGMA ek badi assumption maanta hai — molecular clock , matlab sab lineages same rate se evolve ho rahe hain. Agar yeh galat ho (koi taxon fast mutate kare) to UPGMA galat tree deta hai. Isliye practical default hai Neighbor-Joining (NJ) — yeh Q-matrix use karke woh pair choose karta hai jo close bhi ho aur baaki sabse door bhi, isse "true neighbours" mil jaate hain, aur clock assume nahi karna padta.
Doosri family character-based hai jo directly alignment columns dekhti hai. Maximum Parsimony Occam's razor lagata hai — jis tree mein sabse kam mutations chahiye woh best (Fitch algorithm se count karo). Par high divergence pe iska classic problem hai long-branch attraction — unrelated fast taxa galat group ho jaate hain. Isliye sabse accurate hai Maximum Likelihood aur Bayesian , jo substitution model (probability) use karke most believable tree nikalte hain. Kyunki possible trees bahut zyada ho jaate hain (10 taxa = 3 crore+ trees), yeh heuristic search aur MCMC use karte hain. Tree ki reliability check karne ke liye bootstrap ya posterior probability dekho — 70-90% se upar matlab strong support. Yaad rakhna: "U Never Play Loud" = UPGMA, NJ, Parsimony, Likelihood.