Mutation, divergence, and homology
Most structure prediction leans on one empirical fact: proteins that share an ancestor keep their shape long after their sequences have drifted apart. Homology modeling copies a relative's structure, fold recognition asks which known fold a new sequence fits, and AlphaFold starts by gathering a sequence's relatives. Why should shape outlast sequence? The answer runs through how sequences change and which changes survive.
Evolution, in brief
All biological populations change in their genetic makeup over time. Change in the genetic composition of populations over time is called evolution.
The origin of genetic variation is mutation. A mutation is any change in the nucleotide sequences of an organism's DNA. The process of DNA replication is not perfect, and some changes appear almost every time a genome is replicated. Mutations occur randomly with respect to an organism's needs; it is natural selection acting on this random variation that results in adaptation. Most mutations are either harmful to their bearers (deleterious mutations) or have no effect (neutral mutations). But a few mutations are beneficial.
In many protein-coding genes of multicellular organisms, the mutation rate is very low (on the order of to changes per base pair of DNA per generation). As a result of mutation, different forms of a gene, known as alleles, may exist in a population.
Far more individuals of most species are born than survive to reproduce. Offspring tend to resemble their parents, but they are not identical either to their parents or to one another. Slight differences among individuals affect the chance that a given individual will survive and reproduce, which increases the frequency of the favored trait in the next generation. This is natural selection.
In small populations, genetic drift, random changes in allele frequencies from one generation to the next, may produce large changes in allele frequencies over time. Harmful alleles may increase in frequency, and rare advantageous alleles may be lost. Even in large populations, genetic drift can influence the frequencies of neutral alleles (which do not affect the survival and reproductive rates of their bearers).
As a computation, evolution is a randomized search run on a population. Every generation copies its genome (the organism's complete DNA) with a few random edits. Copies that work worse leave fewer descendants: selection. Among edits that make no difference, which ones spread is a coin toss: drift.
Two events split one lineage into two:
- When one population splits into two that no longer interbreed, they become separate species, and from then on each accumulates its own edits. The same gene in two species therefore differs more the longer ago they split: about 90 million years for human and mouse, about 430 million for human and zebrafish.
- A genome occasionally copies a whole gene by mistake (gene duplication). The two copies then sit in one species and drift apart too, often taking on different jobs.
The history of who split from whom is drawn as a phylogenetic tree: present-day sequences at the leaves, their ancestors at the internal nodes. A clade is one ancestor together with all of its descendants, a subtree.
Mutations are edits to a string
A point mutation is the addition (insertion) or subtraction (deletion) of a single base pair, or the substitution of one base pair for another.
What are the possible effects of a point mutation that occurs in the protein-coding region of a gene, such that the mRNA has a single nucleotide change? A silent mutation has no effect on the amino acid sequence of a protein, but missense, nonsense, loss-of-stop, and frame-shift mutations do result in changes in the protein, some of them drastic. Note that substitutions alter only a single codon in the mRNA, while insertions and deletions generally alter many codons.

When they occur in the coding region of a protein, single base pair changes, which cause single nucleotide changes in the mRNA, can cause silent, missense, nonsense, loss-of-stop, or frame-shift mutations.
Silent mutations are DNA substitutions that result in a change of an mRNA sense codon (one that encodes an amino acid) into another sense codon that encodes the same amino acid. A change in a codon does not necessarily mean a change in the amino acid that gets translated, because of the redundancy of the genetic code.
Missense mutations are DNA substitutions that change an mRNA sense codon into another sense codon that encodes a different amino acid, such that one amino acid substitutes for another in the encoded polypeptide. An example is the mutation that causes sickle-cell disease. The sickle allele of the gene for β-globin, a subunit of hemoglobin, differs from the wild-type allele (the common, normal version) by one base pair, resulting in a polypeptide that differs by one amino acid from the wild-type protein.
A missense mutation may result in a defective protein, but in many cases has no effect on the protein's function. For example, a hydrophilic amino acid may be substituted for another hydrophilic amino acid, so that the tertiary (and quaternary) structure of the protein is unchanged.
A nonsense mutation involves a base pair substitution that causes an mRNA sense codon to become a stop codon. A nonsense mutation results in a shortened protein, since translation does not proceed beyond the point where the mutation occurred.
Frame-shift mutations. Not all point mutations are base substitutions. A base pair may be inserted into, or deleted from, a sequence of DNA. Such changes in coding sequences are known as frame-shift mutations because they alter the mRNA reading frame (that is, consecutive triplets) in which the codons are read during translation. If a nucleotide is inserted or deleted from a codon, then the three-letter "words" are shifted as translation proceeds beyond that point, and the result is a completely different amino acid sequence. Frame-shift mutations almost always lead to the production of nonfunctional proteins.
To a programmer these are edits on a string: substitutions, insertions, and deletions. In an alignment of two proteins, insertions and deletions (together, indels) show up as gaps. Where in the codon does the genetic code's redundancy sit? Count every single-base change of every sense codon:
from Bio.Data.CodonTable import standard_dna_table as table
code = dict(table.forward_table) | {stop: "*" for stop in table.stop_codons}
for position in range(3):
same = total = 0
for codon, aa in code.items():
if aa == "*":
continue
for base in "ACGT":
if base != codon[position]:
mutant = codon[:position] + base + codon[position + 1:]
total += 1
same += code[mutant] == aa
print(f"codon position {position + 1}: {same / total:5.1%} of point mutations are silent")
codon position 1: 4.4% of point mutations are silent codon position 2: 0.0% of point mutations are silent codon position 3: 68.9% of point mutations are silent
69% of third-position changes are silent, against 4% at the first position and none at the second. So the DNA of related genes drifts faster than the proteins it encodes, and protein sequences stay comparable much further back in time.
Selection decides which changes survive
A substitution that does not change the encoded amino acid is known as a synonymous substitution (also called a silent substitution). Synonymous substitutions do not affect the functioning of a protein (although they may have other effects, such as changes in mRNA stability or translation rates) and are therefore less likely than other types of substitutions to be influenced by natural selection.
A nucleotide substitution that does change the amino acid sequence encoded by a gene is known as a nonsynonymous substitution. In general, nonsynonymous substitutions are likely to be deleterious to the organism. But not every amino acid replacement alters a protein's shape and charge (and hence its functional properties). Therefore some nonsynonymous substitutions are selectively neutral, or nearly so. Another possibility is that a nonsynonymous substitution alters a protein in a way that confers an advantage to the organism and is therefore favored by natural selection.
Synonymous substitutions accumulate over time in protein-coding genes at a much higher rate than nonsynonymous substitutions do. This is true even though the underlying mutation rates for both types of substitutions are equal (or at least similar). The reason is simple: as most nonsynonymous substitutions are harmful to the function of a gene, they are removed from the population over time through natural selection.
Motoo Kimura proposed the neutral theory in 1968. He suggested that, at the molecular level, the majority of variants found in most populations are selectively neutral. That is, most gene variants confer neither an advantage nor a disadvantage on their bearers. Therefore these neutral variants must accumulate through genetic drift rather than through positive selection.
Neutral theory does not imply that most mutations have no effect. Many mutations are rarely or never observed in populations because they are lethal or strongly detrimental, and the individuals that carry them are quickly removed through natural selection. If we compare homologous proteins from different species, some amino acid positions will remain constant under purifying selection, others will vary through neutral genetic drift, and still others will differ as a result of positive selection for change:
- If a given amino acid in a protein can be one of many alternatives (without changing the protein's function), then an amino acid replacement is neutral. In this case, the rates of synonymous and nonsynonymous substitutions in the corresponding DNA sequences are expected to be very similar, so the ratio of the two rates should be close to 1.
- If a given amino acid position is under positive selection for change, the observed rate of nonsynonymous substitutions is expected to exceed the rate of synonymous substitutions.
- If a given amino acid position is under purifying selection, then the observed rate of synonymous substitutions is expected to be much higher than the rate of nonsynonymous substitutions.
Which positions does purifying selection guard? The ones the fold depends on:
The diversity of sequences in a family of homologous proteins captures successful biological experiments in mutating a protein coding sequence without destroying its function and, what follows, its structure. We can assume that with very few exceptions, the mutations destroying a structure of a protein would not be represented among proteins existing in Nature. Therefore, the analysis of a pattern of mutations in homologous families can provide us with information about the importance of various positions along the sequence. For instance, we can expect that positions that are easily mutated are not important for function or for structure and are most likely located in exposed loops or turns. In contrast, a position in the hydrophobic core of a protein would easily accommodate only some types of mutations (hydrophobic to hydrophobic) but not others (hydrophobic to hydrophilic). In the same way, residues in active sites, on the surface, on the interface between protein domains, all have their own rules.
Code
from Bio.PDB.SASA import ShrakeRupley
from primer import structure, sequence, display_widget
MAX_ASA = {"ALA": 129, "ARG": 274, "ASN": 195, "ASP": 193, "CYS": 167, "GLN": 225, "GLU": 223,
"GLY": 104, "HIS": 224, "ILE": 197, "LEU": 201, "LYS": 236, "MET": 224, "PHE": 240,
"PRO": 159, "SER": 155, "THR": 172, "TRP": 285, "TYR": 263, "VAL": 174} # Tien et al. 2013
chain = structure("1UBQ")[0]["A"]
ShrakeRupley().compute(chain, level="R")
residues = [r for r in chain if r.id[0] == " "]
buried = "".join("b" if r.sasa / MAX_ASA[r.get_resname()] < 0.2 else "e" for r in residues)
print(f"{buried.count('b')} of {len(buried)} ubiquitin residues are buried")
display_widget(
"divergence",
"A toy model of divergence, starting from human ubiquitin. Surface positions change to any residue; "
"buried positions (underlined: less than 20% of the side chain exposed in 1UBQ, lesson 2.4) change four "
"times more slowly and mostly to similar residues. Press Play. Identity drops fast, then slows, because a "
"second change at an already-changed position can't lower identity further and sometimes changes it "
"back. On the right, Chothia and Lesk's fit (below) gives how far the core structure would have moved.",
sequence=sequence(chain), buried=buried, name="ubiquitin",
)
36 of 76 ubiquitin residues are buried
A toy model of divergence, starting from human ubiquitin. Surface positions change to any residue; buried positions (underlined: less than 20% of the side chain exposed in 1UBQ, lesson 2.4) change four times more slowly and mostly to similar residues. Press Play. Identity drops fast, then slows, because a second change at an already-changed position can't lower identity further and sometimes changes it back. On the right, Chothia and Lesk's fit (below) gives how far the core structure would have moved.
Counting differences undercounts the changes that happened:
Although it is useful in determining a minimum number of changes between two DNA sequences, the count provided by sequence alignment almost certainly underestimates the actual number of changes that have occurred since the sequences diverged. Any given change may result from multiple substitution events that occurred at a given position over time:
- Multiple substitutions. More than one change has occurred at a given position between the ancestral sequence and at least one of the observed sequences.
- Coincident substitutions. At a given position, different substitutions have occurred between the ancestral sequence and each observed sequence.
- Parallel substitutions. The same substitution has occurred independently between the ancestral sequence and each observed sequence.
- Back substitutions (also called reversions). After a change at a given position, a subsequent substitution has changed the position back to the ancestral state.
To correct for undercounting of substitutions, molecular evolutionists have developed mathematical models that describe how DNA (and protein) sequences evolve. The revised estimate accounts for the total number of substitutions likely to have occurred between two sequences, which is almost always greater than the observed number of differences.
Homologs, orthologs, paralogs, analogs
Two proteins are homologous if they descend from a common ancestral gene. Homology is a yes-or-no claim about history, so a pair can be 40% identical but not "40% homologous". Homologs that split when a species split in two are orthologs (whale and human myoglobin: the same gene in two species). Homologs split by a gene duplication inside one lineage are paralogs:
When a gene is duplicated, one copy of that gene is potentially freed from having to perform its original function. Although many extra genes disappear rapidly, some duplication events lead to the evolution of genes with new functions. Several successive rounds of duplication and mutation may result in a gene family: a group of homologous genes with related functions. An example of this process is provided by the globin gene family. Comparisons of their amino acid sequences strongly suggest that the different globins arose via gene duplications.

A globin family gene tree. The α-globin (blue) and β-globin (green) gene clusters diverged about 450 million years ago (open circle), soon after the origin of the vertebrates. The numbers estimate the DNA sequence changes along each branch.
Hemoglobin, a tetramer consisting of two α-globin and two β-globin polypeptide chains, carries oxygen in blood. Myoglobin, a monomer, is the primary O₂ storage protein in muscle. Myoglobin's affinity for O₂ is much higher than that of hemoglobin, but hemoglobin has evolved to be more diversified in its roles. It binds O₂ in the lungs or gills, where the O₂ concentration is relatively high, transports it to deep body tissues, where the O₂ concentration is low, and releases it in those tissues.
Analogs are the opposite case: proteins that look alike or do the same job without common ancestry, because evolution found the same solution twice (convergent evolution). The serine proteases chymotrypsin and subtilisin both cut proteins with the same three residues, a serine, a histidine, and an aspartate, arranged the same way in space. Yet their folds are entirely different, and nothing in their sequences suggests a relationship.
Proteins that have descended from the same ancestor retain memory of that ancestor through the sequence, structure, and function. Strong sequence similarity alone is considered to be sufficient evidence for common ancestry. Close structural and functional similarity taken together is also accepted as sufficient evidence for distant homology between proteins that lack significant sequence similarity. But neither structural nor functional similarity alone is considered to be strong evidence. Proteins of independent origin may well have similar structures due to physicochemical reasons and they may also evolve similar functions due to functional selection.
Structure outlives sequence
It is generally accepted that, in distantly related proteins, structure is more conserved than sequence. Proteins that have diverged beyond significant sequence similarity still retain the architecture and topology of their ancestral fold. The reasons for this structural conservation are not completely understood. One theory states that selective pressure originating from the physical demands on the protein chain results in protein evolution towards adopting a stable and fast folding conformation. Evolution requires that existing proteins continue to function and such processes would be interrupted if the protein's fold changed significantly. Notwithstanding, a protein fold can change in a minor way during evolution by keeping all the secondary structure elements the same, packed and connected exactly the same way, but with different organization of connecting loops.
Chothia and Lesk measured it in 1986. They superimposed the cores of pairs of homologous structures and fit the backbone RMSD of the common core against the fraction of residues that differ: Å. Identical sequences give 0.4 Å, the scatter between two crystal structures of the same protein. At 50% identity the cores differ by about 1 Å, and at 20% identity, where the sequences look unrelated, by only about 1.8 Å. The catch is that the shared core shrinks as proteins diverge; Δ measures only the part that still superimposes.
Sperm whale myoglobin and the human hemoglobin α chain are paralogs separated by hundreds of millions of years. One residue in four still matches. What does the structure do?
Code
from Bio.Align import PairwiseAligner, substitution_matrices
from Bio.PDB import Superimposer
def protein(pdb, chain):
residues = [r for r in structure(pdb)[0][chain] if r.id[0] == " "]
return sequence(structure(pdb)[0][chain]), residues
aligner = PairwiseAligner(mode="global", open_gap_score=-11, extend_gap_score=-1)
aligner.substitution_matrix = substitution_matrices.load("BLOSUM62")
mb_seq, mb = protein("1A6M", "A")
hb_seq, hb = protein("4HHB", "A")
aln = aligner.align(mb_seq, hb_seq)[0]
pairs = [(i, j) for (s, e), (t, f) in zip(*aln.aligned) for i, j in zip(range(s, e), range(t, f))]
same = sum(mb_seq[i] == hb_seq[j] for i, j in pairs)
sup = Superimposer()
sup.set_atoms([mb[i]["CA"] for i, _ in pairs], [hb[j]["CA"] for _, j in pairs])
rot, tran = sup.rotran
print(f"{same} identical of {len(pairs)} aligned residues ({same / len(pairs):.0%}); "
f"Cα RMSD over all aligned pairs {sup.rms:.1f} Å")
def trace(residues, transform=None, marks=()):
coords = [r["CA"].coord if transform is None else r["CA"].coord @ transform[0] + transform[1] for r in residues]
numbers = [r.id[1] for r in residues]
return {"coords": [[round(float(x), 2) for x in c] for c in coords],
"marks": [[numbers.index(n), f"His{n}"] for n in marks]}
display_widget(
"ca-overlay",
"Sperm whale myoglobin (1A6M) and the human hemoglobin α chain (4HHB chain A), superimposed on their "
"aligned Cα atoms. One residue in four matches; the helices still line up. The dots mark the two "
"histidines that hold the heme, conserved in both.",
traces=[{"label": "myoglobin", **trace(mb, marks=(64, 93))},
{"label": "hemoglobin α", **trace(hb, (rot, tran), marks=(58, 87))}],
)
37 identical of 141 aligned residues (26%); Cα RMSD over all aligned pairs 2.7 Å
Sperm whale myoglobin (1A6M) and the human hemoglobin α chain (4HHB chain A), superimposed on their aligned Cα atoms. One residue in four matches; the helices still line up. The dots mark the two histidines that hold the heme, conserved in both.
At 26% identity the two chains still superimpose helix for helix, with 127 of the 141 aligned Cα atoms within 3 Å of their partners (lab 5.9). But at this distance sequence comparison starts to fail:
Since evolution conserves protein structure more than protein sequence, it follows that the number of possible structure folds is less than the number of sequence families. There are a total of possible sequences of 300 residues, which is more than the number of atoms in the universe. However, evolution has selected a very small subset of those protein sequences and an even smaller number of protein folds.

Sequence identity of about 160,000 pairs of structurally similar protein chains from the PDB (2007), against the number of residues that superpose (left), and the distribution of their identities (right). Most structurally similar pairs share only 10–30% of their sequence.
A substantial number of the similar pairs of structures have sequence identities near the values of randomly selected pairs of sequences (~10%). These sequence-structure relationships include the so-called midnight zone (0–20% sequence identity) and the so-called twilight zone (20–40% sequence identity). The homology between two sequences in the midnight zone is very difficult to determine from sequence methods, and similarity can only be detected using structure alignment methods. Homology can be detected using sequence and/or structure alignment methods in the well-populated twilight zone.
It is dangerous to consider these findings as absolute. There are cases of structures containing regions of high sequence similarity, and yet sharing no or little structure similarity. The viral capsid protein (1PIV) shares an 80-residue stretch with a glycosyltransferase (1HMP) where there is over 40% sequence identity, yet the structures within those regions are completely different (mostly β versus mostly α).
Why can't identity separate relatives from strangers in the twilight zone? An alignment algorithm is an optimizer: it finds the arrangement that lines up as many similar residues as possible, so even unrelated sequences come out partly identical. Shuffle the hemoglobin sequence (same composition, no shared history) and align it to myoglobin a few hundred times:
import random
random.seed(0)
def identity(a, b):
aln = aligner.align(a, b)[0]
pairs = [(i, j) for (s, e), (t, f) in zip(*aln.aligned) for i, j in zip(range(s, e), range(t, f))]
return sum(a[i] == b[j] for i, j in pairs) / len(pairs)
shuffled = [identity(mb_seq, "".join(random.sample(hb_seq, len(hb_seq)))) for _ in range(300)]
print(f"real pair: {identity(mb_seq, hb_seq):.0%} identical")
print(f"shuffled: {sum(shuffled) / len(shuffled):.0%} on average, "
f"{sorted(shuffled)[-15]:.0%} or more in 5% of tries")
real pair: 26% identical shuffled: 24% on average, 29% or more in 5% of tries
26% for the real pair, 24% for scrambled hemoglobin, and 29% or better in one try in twenty: by identity, myoglobin and hemoglobin α look like strangers. Their structures say otherwise. Lesson 5.2 shows that the alignment score separates them easily, and lesson 5.3 reaches deeper still by comparing whole families instead of single sequences.
Folds recur, and a fold isn't a function
In SCOP, families contain protein domains that share a clear common evolutionary origin, as evidenced by sequence identity or extremely similar structure and function. Superfamilies consist of families whose proteins share very common structure and function despite low sequence identities, and therefore there is reason to believe that the different families are evolutionarily related. Folds consist of one or more superfamilies that share a common core structure (the same secondary structure elements in the same arrangement with the same topological connections).
If the proteins have the same major secondary structures in the same arrangement with the same topological connections they are classified as one fold. Different proteins with the same fold usually have peripheral elements of secondary structure and turn regions that differ in size and conformation. For proteins placed together in the same fold category, the structural similarity probably arises from the physics and chemistry of proteins favoring certain packing arrangements and chain topologies. There may be cases where a common evolutionary origin is obscured by the extent of the divergence in sequence, structure and function.
The structural similarity between seemingly unrelated proteins is often explained by "convergence" to a stable fold as opposed to divergence from a common ancestor.
Recurring folds come from both directions: divergence from one ancestor into many families (the globins, or the many enzymes built on the TIM barrel) and convergence of unrelated lineages on the few arrangements that physics favors. SCOP 1.75 (2009) recognized 1,195 folds, and new structures now rarely add one.
Nor does a shared fold fix the function. Lysozyme and α-lactalbumin are clear homologs, about 40% identical with the same fold. Lysozyme cuts bacterial cell walls. α-Lactalbumin cuts nothing; it helps make lactose in milk. Predicting function from structure means checking the specific active-site residues, which a fold match alone can't tell you.
The sequences we see are a tiny, biased sample
How large is sequence space? Count it:
import math
for L in (10, 50, 100, 300):
print(f"L = {L:3d}: 20^L = 10^{L * math.log10(20):.0f}")
print("atoms in the observable universe: about 10^80")
L = 10: 20^L = 10^13 L = 50: 20^L = 10^65 L = 100: 20^L = 10^130 L = 300: 20^L = 10^390 atoms in the observable universe: about 10^80
Sequence databases hold hundreds of millions of protein sequences, plus billions from environmental (metagenomic) sequencing, around at most. That observed set passed through two filters. Evolution started from sequences that worked and took small steps, keeping those that still folded and functioned, so real sequences cluster in families around a limited number of folds. Then people chose what to sequence: the databases over-represent well-studied organisms and are full of near-duplicates, which is why machine-learning pipelines cluster them (UniRef90 or UniRef50 keep one sequence per cluster at 90% or 50% identity) before training.
A protein language model (a neural network trained, like a text language model, to fill in missing residues from their context) learns the distribution of sequences that evolution produced and people collected. A sequence the model finds improbable can still fold: Top7, designed by computer in 2003, has a fold never seen in nature, and it is stable.
Check yourself
A surface lysine and a buried leucine in the same protein both vary across 200 homologs. Which position shows more distinct amino acids, and what replaces the leucine?
Reasoning
The surface lysine. Facing water, it's under little constraint beyond staying soluble, so many polar or charged residues (Arg, Glu, Gln, Ser, Asn…) are tolerated and drift in over time. The buried leucine is packed in the core, where a charged or polar residue would cost burial free energy and a much larger or smaller side chain would leave clashes or cavities. Variants that make it unlike leucine tend to unfold and are removed by purifying selection. Expect a few hydrophobic residues of similar size: Ile, Val, Met, perhaps Phe.
Two enzymes are 18% identical in an alignment, catalyze the same reaction, and use the same three catalytic residues in the same geometry. Can you conclude they're homologs? What would you look at to decide?
Reasoning
No. 18% identity is in the midnight zone, where shuffled sequences align about as well, and a shared catalytic geometry can be convergent, as with chymotrypsin and subtilisin. To argue homology you'd want evidence unlikely to arise independently: the same fold with the same topology (strand order and connections), catalytic residues on equivalent secondary-structure elements, a statistically significant alignment score (lesson 5.2) or a profile-based match (5.3), or a chain of intermediate relatives. The same catalytic residues placed on unrelated parts of different folds would point to convergence.
A structure-prediction pipeline finds a template 22% identical to your query over 150 residues. A colleague says it's useless because "22% is basically random". Using Chothia and Lesk and the twilight zone, give a more careful answer.
Reasoning
Identity alone can't tell whether a 22% match is real, since unrelated pairs reach that. But if the two are homologs, Chothia and Lesk's relation puts their cores only about Å apart, an excellent template core. The open question is whether the match is a true homolog, which alignment-score statistics (E-values), profile comparisons, and agreement of secondary structures can settle. Even then, expect loops and insertions to differ.
A protein language model assigns very low probability to a sequence designed by computer. Does that mean the sequence won't fold?
Reasoning
No. The model scores how typical the sequence is of the natural sequences it was trained on, a sample shaped by evolutionary history and by what people sequenced. A designed sequence can fold well yet sit far from every natural family (Top7's fold had never been seen in nature). Low likelihood means "unlike what evolution and the database contain", which correlates with trouble but isn't a physical law. Whether it folds depends on its free energy (unit 4), and only experiment settles that.