6  Session 6: Protein Structure

Note

Sources for this page: Petras Kundrotas’s KB8029 lecture “Protein Structure” (Feb 2026) — this page follows its structure for the levels- of-structure and structure-prediction material, adapted and substantially shortened, not copied verbatim; Wikipedia, Protein structure, Alpha helix, Beta sheet, Anfinsen’s dogma, Homology modeling, Threading (protein sequence), Root-mean-square deviation of atomic positions, Template modeling score, CASP — CC BY-SA 4.0; RCSB PDB-101 — CC BY 4.0; Baldwin & Chothia (1979), “Haemoglobin: the structural changes related to ligand binding and its allosteric mechanism,” Journal of Molecular Biology 129:175-220 (PubMed). Structural-classification and structural-alignment sources: Murzin, Brenner, Hubbard & Chothia (1995), “SCOP: a structural classification of proteins database for the investigation of sequences and structures,” J. Mol. Biol. 247:536-540 (PubMed); Orengo, Michie, Jones, Jones, Swindells & Thornton (1997), “CATH — a hierarchic classification of protein domain structures,” Structure 5:1093-1108 (PubMed); Cheng, Schaeffer, Liao et al. (2014), “ECOD: an evolutionary classification of protein domains,” PLoS Computational Biology 10:e1003926 (PubMed); Lau, Bordin, Kandathil et al. (2024), “Exploring structural diversity across the protein universe with The Encyclopedia of Domains,” Science 386:eadq4946 (PubMed); Holm & Sander (1993), “Protein structure comparison by alignment of distance matrices” (DALI), J. Mol. Biol. 233:123-138 (PubMed); Zhang & Skolnick (2005), “TM-align: a protein structure alignment algorithm based on the TM-score,” Nucleic Acids Research 33:2302-2309 (PubMed); van Kempen, Kim, Tumescheit, Mirdita, Lee, Gilchrist, Söding & Steinegger (2024), “Fast and accurate protein structure search with Foldseek,” Nature Biotechnology 42:243-246 (PubMed) — CC BY 4.0 (Foldseek paper). The two real crystal structures used below and in the notebook, PDB entries 2HHB (deoxy hemoglobin) and 1HHO (oxy hemoglobin), were fetched live from the PDB archive — structure coordinate data is CC0 1.0 (public domain), as is a third real structure used below, 1EMA (green fluorescent protein), as are 3RGK (human myoglobin, a K45R variant), 1OJ6 (human neuroglobin) and 1IDR (M. tuberculosis truncated hemoglobin N). All secondary-structure counts, distances, distance maps, alignments, TM-scores and rendered figures below were computed fresh for this page and its notebook using Biopython, a locally-run PyMOL (open-source), TM-align (through tmtools), and a locally-run Foldseek (open-source), not taken from the lecture’s own numbers or images; CATH and Pfam classifications were fetched live from the PDBe and InterPro APIs.

TipTense and relaxed

Haemoglobin walks into a bar. The bartender says: “You look tense.”

Haemoglobin: “Give me some oxygen and I’ll relax.”

6.1 Learning goals

By the end of this session you should be able to:

  • describe the four levels of protein structure, using haemoglobin, and name the computational task that belongs to each;
  • represent a structure as coordinates, as a distance map and as a contact map, and explain what each makes easy to see;
  • explain the difference between a sequence alignment and a structure alignment, and why structure is often more conserved than sequence;
  • interpret RMSD and TM-score, and explain at a conceptual level how DALI and Foldseek compare structures;
  • explain why a single PDB entry is not necessarily “the” structure of a protein;
  • state secondary-structure prediction as a supervised learning problem: what goes in, what comes out.

The question for this session is: what information about a protein is contained in its sequence, what becomes visible only in 3D, and how can computers connect the two? Sessions 3–5 worked with sequences, retrieving them, aligning them and searching for families. In Session 3 you also found structures, but only as database records (a PDB entry, an AlphaFold model). In this session the structure itself becomes the data. Its coordinates can be turned into distances, secondary structure, domains and interfaces, and compared with other structures. The course’s globin thread continues as well. In Session 3 you looked up HBB’s identifiers, in Session 4 you aligned globin sequences and in Session 5 you searched for the globin family, and now you compare globin structures.

6.2 Sequence becomes structure

6.2.1 Four levels, four computational tasks

A protein starts as a polypeptide chain, a linear polymer of amino acids, which folds into a 3D shape. Structural biology describes the result at four levels, and in this course each level comes with its own computational problem:

Table 6.1: The four levels of protein structure and where they appear in the course.
Level What it is Computational task Where in the course
Primary the amino-acid sequence alignment, BLAST, profiles Sessions 3–5
Secondary local backbone shapes: α-helix, β-strand, coil prediction from sequence Sessions 7–11
Tertiary the 3D fold of one chain structure comparison, prediction this session; Session 12
Quaternary several chains packed together interfaces, complexes this session; Session 12
  • An α-helix is a coil held together by hydrogen bonds between the backbone N-H and C=O groups of residues four apart. A β-sheet is built from extended β-strands that are hydrogen-bonded edge to edge. Everything else is called coil. Programs such as DSSP assign these labels from the coordinates of a solved structure.
  • The tertiary fold is held together mainly by the hydrophobic effect (non-polar side chains bury themselves away from water), together with hydrogen bonds, electrostatic interactions and van der Waals contacts.
  • Many proteins work as a single chain, while others assemble into complexes of two to hundreds of chains.

6.2.2 Haemoglobin: all four levels in one protein

Haemoglobin is a heterotetramer of two α-globin chains (141 residues) and two β-globin chains (146 residues; β-globin is HBB, this course’s running example since Session 3). Each chain folds on its own and carries an oxygen-binding haem group. Using PyMOL’s secondary-structure algorithm (dss), the notebook computes that one β chain is 118 of 146 residues (80.8%) α-helix and 0% β-strand. The PDB entry’s own annotation, which Session 7 uses, gives 117 helical residues, because the two methods differ slightly in where exactly a helix ends.

Figure 6.1: PDB entry 2HHB, human deoxyhaemoglobin: two α chains (blue/cyan), two β chains (salmon/pink), four haem iron atoms (orange spheres). Rendered from the real structure with PyMOL.

6.2.3 Does the sequence determine the structure?

Whether a computer can predict a structure at all depends on how much of it the sequence determines. In the 1960s Christian Anfinsen showed that ribonuclease, unfolded in the test tube, refolds into its active shape on its own once the denaturant is removed. For many small globular proteins, then, the sequence contains enough information to specify the native fold under the right conditions, and this principle is what makes structure prediction possible. It is not a law for every protein, however. Some proteins need chaperones to fold efficiently, many need a ligand, cofactor or binding partner, some switch between alternative states (haemoglobin itself, below), and intrinsically disordered regions have no single fold.

Two kinds of interaction build a fold. Local interactions, between residues close in sequence, form secondary structure. The hydrogen bonds of an α-helix, for example, connect residues \(i\) and \(i+4\). Long-range interactions, between residues far apart in sequence but close in space, pack the helices and strands into a tertiary structure. Local structure can therefore be partly guessed from a short window of sequence (Session 7), whereas long-range structure cannot, which is why tertiary-structure prediction is so much harder.

6.2.4 A structure as a matrix: distance and contact maps

A structure file is a list of atomic coordinates, but coordinates are not always the most useful representation. An alternative is the distance between every pair of residues, which for a chain of \(L\) residues gives an \(L \times L\) distance map. Thresholding the distance map gives a contact map, with 1 where two residues are close (here, Cβ atoms within 8 Å) and 0 elsewhere. Unlike coordinates, both maps stay the same however the protein is rotated or moved, so two structures can be compared without first superimposing them.

Figure 6.2: Three representations of β-globin (2HHB, chain B). Left: the 3D structure, coloured from the N-terminus (blue) to the C-terminus (red). Middle: the distance map. Right: the contact map, with the eight α-helices of the PDB file as red bars. The band along the diagonal is each helix in contact with itself (local interactions); the off-diagonal stripes are helices packed against each other (long-range interactions).

This representation returns twice later in the course. First, an \(L \times L\) map looks like an image, which is why image-processing networks (CNNs, Session 10) turned out to be good at predicting contacts. Second, coevolution, contact prediction and AlphaFold’s “pair representation” (Session 12) all work on residue-pair information like this.

TipRepresentations

The same protein can be represented as a sequence, a profile (Session 5), a set of coordinates, a distance or contact map, or a learned embedding (Session 11). The choice of representation determines which patterns are easy to see and, later in the course, which patterns a model can easily learn.

6.2.5 Looking at structures: PyMOL

To look at a structure yourself, you need a molecular viewer. PyMOL is, with ChimeraX, one of the two most widely used, and its open-source version is free. It loads a structure directly from the PDB and shows it as cartoon (secondary structure as ribbons and arrows, as in the figures above), as sticks (every bond, useful for a side chain or ligand) or as spheres (every atom, useful for packing). It also measures distances and angles directly from the coordinates. This session’s lab uses PyMOL hands-on, but you do not need to install the program: open-source PyMOL is also a Python library, which the lab notebook installs on Colab. You type the same commands as in PyMOL’s own command line, and the notebook draws the picture. The course notebook drives PyMOL the same way, so that its figures and measurements are reproducible.

6.2.6 Further reading

6.3 Comparing proteins in 3D

6.3.1 Sequence alignment versus structure alignment

Session 4 defined an alignment as a hypothesis about which residues correspond. A sequence alignment decides this from the sequences alone, using substitution scores. A structure alignment decides it from the 3D coordinates, by asking which residues occupy the same position in the two folds. The notebook compares β-globin both ways with five proteins, ranging from a close paralog to an unrelated fold:

Table 6.2: Five proteins compared with β-globin, by sequence and by structure.
Compared with β-globin Sequence identity* Sequence-only score (shuffled max) Residue pairs agreeing TM-score
α-globin (human, 2HHB) 43% 288 (43) 95% 0.88
myoglobin (human, 3RGK) 25% 111 (46) 97% 0.91
neuroglobin (human, 1OJ6) 22% 89 (41) 66% 0.82
truncated haemoglobin N (M. tuberculosis, 1IDR) 16% 28 (49) 0% 0.57
GFP (jellyfish, 1EMA) 6% 25 (50) — 0.33

*Identity over the structurally aligned residues. “Sequence-only score” is the best Smith–Waterman alignment with BLOSUM62, and the number in brackets is the highest score among 200 alignments against shuffled versions of the same sequence. “Residue pairs agreeing” is the fraction of structurally aligned pairs that the sequence alignment also pairs up. TM-scores are normalised by the length of β-globin.

The table is best read from top to bottom. For α-globin and myoglobin, the sequence alignment has a strong signal and pairs up almost exactly the same residues as the structure alignment. (Session 5 showed that BLAST, with default settings, nevertheless missed myoglobin, because a heuristic search can skip an alignment that an exhaustive one finds.) For neuroglobin the sequence signal is still clear, but a third of the pairs are wrong, because the gaps are in the wrong places. For the bacterial truncated haemoglobin, the sequence alignment does no better than shuffled sequences and pairs up none of the right residues. The structure alignment nevertheless finds a shared globin fold over more than 100 residues. This is the central lesson: structure is more conserved than sequence. When the sequence evidence fades, structure can still reveal a relationship.

6.3.2 Measuring structural similarity: RMSD and TM-score

To compare structures, we need a number for how similar they are. RMSD (root-mean-square deviation) is the most direct measure. It is the root-mean-square distance between corresponding atoms after the two structures have been optimally superimposed. RMSD is simple, but it grows with protein length, and one badly placed loop can inflate it even when the rest of the fold matches. RMSD also depends on which atoms are compared. A superposition can be restricted to the residues that fit well, and a very low RMSD over a short fragment says nothing about the rest of the proteins. An RMSD should therefore always be given together with the number of aligned residues, for example “1.5 Å over 140 residues”. The TM-score avoids these problems. It weights each residue pair by how close it is, so that small deviations count fully and large ones hardly at all, and it normalises by protein length. It runs from 0 to 1 (identical). Unrelated proteins typically score around 0.2–0.3, and scores above about 0.5 usually mean the same overall fold. This is a rule of thumb, not a law. The truncated haemoglobin above (0.57) and GFP (0.33) are clear cases, but scores in between need other evidence.

6.3.3 DALI: comparing distance maps

If two proteins have the same fold, their distance maps should look alike, even when their sequences do not. DALI (Holm & Sander, 1993) uses this idea to compare structures. Rather than superimposing coordinates, it looks for residue correspondences that make the patterns of intramolecular distances agree.

Figure 6.3: Distance maps of β-globin, human myoglobin and GFP. The first two are almost indistinguishable although only a quarter of their residues are identical; GFP’s β-barrel gives a completely different pattern.

The analogy with sequence alignment is direct:

  • Sequence alignment compares residues along two sequences.
  • DALI compares patterns of residue–residue geometry.

DALI and TM-align (Zhang & Skolnick, 2005), which finds the superposition that maximises the TM-score, are accurate and still used for careful pairwise comparisons. They are, however, far too slow to search hundreds of millions of structures.

6.3.4 Foldseek: structure search at sequence-search speed

Session 5 ended with MMseqs2, which searches billions of sequences. Foldseek (van Kempen, Steinegger et al., 2024), from the same group, does the same for structures:

The key idea of Foldseek is a change of representation. For each residue, Foldseek looks at the local 3D environment (the geometry between that residue and its closest neighbour in space) and assigns one of 20 discrete structural states, the 3Di alphabet. A structure thus becomes a string of 3Di letters, one per residue. Two structures can then be compared with fast sequence-alignment machinery (the same prefilter-and-align approach as MMseqs2) instead of expensive geometric superposition:

3D coordinates
   → local geometry around each residue
   → one 3Di state per residue
   → a structural "sequence"
   → fast alignment and database search

This makes it possible to search the hundreds of millions of structures in the AlphaFold Database and the PDB in seconds to minutes. Foldseek is tens of thousands of times faster than TM-align at comparable sensitivity.

NoteMachine-learning preview: a learned representation

Nobody designed the 20 states of Foldseek’s 3Di alphabet by hand. Instead, a machine-learning model (a variational autoencoder) was trained on pairs of structurally aligned residues to find a compact set of recurring 3D environments that are conserved between related structures. You do not need to know how such a model works. The point is that a useful representation can itself be learned from data. In Session 5, humans chose both the representation (amino acids) and the scoring scheme (BLOSUM62), whereas in Foldseek, machine learning helped choose the representation. Sessions 7–12 build up the machinery behind models that learn increasingly powerful representations.

A worked comparison. We ran Foldseek locally on three structures: the two haemoglobin states used on this page (2HHB, deoxy; 1HHO, oxy) and green fluorescent protein (1EMA). Matching α-to-α or β-to-β chains between 2HHB and 1HHO, which are the same protein in two states, gives a TM-score of 0.98 and an RMSD of 0.7 Å, about as similar as two independently solved structures get. α against β globin (43% identical) still gives a TM-score of 0.90–0.91 (RMSD 1.7–1.8 Å). Searching 2HHB against GFP, in contrast, returns no hits, even with a loosened significance threshold.

6.3.5 Further reading

6.4 Domains, complexes and conformational states

6.4.1 Structural domains

A domain is a compact, semi-independent unit of a structure, which is often able to fold on its own and is reused in many different proteins. Sessions 3 and 5 met domains from the sequence side, as Pfam families built from profile HMMs. Structural classifications instead group domains by their 3D shape, which, as the table above showed, can reveal relationships that sequence misses.

CATH (Orengo et al., 1997) classifies domains in four levels: Class (mainly α, mainly β, α/β, few secondary structures), Architecture (the overall arrangement of secondary-structure elements), Topology (how they are connected, that is, the fold), and Homologous superfamily (domains with evidence of common ancestry). β-globin’s domain is 1.10.490.10: Mainly Alpha → Orthogonal Bundle → Globin-like → Globins. So are myoglobin, neuroglobin and the M. tuberculosis truncated haemoglobin from the table above. Pfam, which works from sequence, needs a separate family for the truncated haemoglobin (PF01152, “Bacterial-like globin”, not PF00042, “Globin”) and connects the two only at the level of a clan. GFP, in contrast, is in CATH class 2 (Mainly Beta), Beta Barrel.

Three other classifications exist, each with a different philosophy: SCOP (Murzin et al., 1995; expert manual curation), ECOD (Cheng et al., 2014; organised by evolutionary relationship), and TED (Lau, Bordin et al., 2024; domains parsed automatically from the entire AlphaFold Database, hundreds of millions of predicted structures). They do not always agree on where one domain ends or on how distant superfamilies group together. Knowing that several classifications exist, and why, therefore matters more than picking one.

6.4.2 Quaternary structure, interfaces and ligands

Beyond single chains, a complex is held together by interfaces, patches of surface where two chains touch. Interfaces are usually more hydrophobic and more conserved than the rest of the surface. Many proteins also bind ligands, small molecules or ions such as haemoglobin’s haem groups. Interfaces and ligand-binding sites are where much of a protein’s function happens, and predicting them is one of the open problems of Session 12.

6.4.3 One protein, more than one structure: haemoglobin T and R

A PDB entry is one snapshot of one state. Haemoglobin has two classic states, deoxy (T, tense; 2HHB) and oxy (R, relaxed; 1HHO). Each chain hardly changes between them (TM-score 0.98), but the two α/β pairs rotate relative to each other by about 13–15° (Baldwin & Chothia, 1979; the third discussion problem measures it). The notebook measures one consequence: the distance between the iron atoms of the two β-chain haems is about 5 Å shorter in the oxy state. This quaternary change is how haemoglobin binds oxygen cooperatively, since binding at one subunit makes binding at the others easier.

It follows that a PDB structure is not necessarily “the” structure of a protein. Proteins can occupy different conformational states depending on ligands, partners and conditions. This matters whenever a predicted model is compared with “the” experimental structure, and it is one of the limitations that Session 12 returns to, because AlphaFold usually predicts one state.

6.4.4 Further reading

6.5 From structure back to sequence prediction

6.5.1 Secondary structure as a prediction target

Given only the sequence, could a computer predict which residues become helix, strand or coil? Stated as a learning problem, the task is:

input:   the sequence (or its profile), one window per residue
target:  H (helix), E (strand) or C (coil) for every residue

The training labels come from solved structures, assigned by DSSP as in the notebook. What information could help the prediction? The residue itself is one source, because some amino acids favour helices, others strands, and proline and glycine break both. Its neighbours in the sequence are another. A third, from Session 5, is how that position varies across homologous sequences, that is, a profile. Sessions 7–11 develop the machinery for learning such mappings, and the course returns to this problem in Sessions 7, 9 and 10 and in the capstone project.

6.5.2 Predicting the whole fold

Predicting the full 3D structure has been one of biology’s hardest problems for decades. Since 1994 the CASP competition (Critical Assessment of Structure Prediction) has tested methods blindly, on structures that are solved but not yet published. The classical strategies each build on something you have already met:

  • Physics (de novo or ab initio modelling) searches for the lowest-energy arrangement of the chain, using physical interactions. It is rigorous in principle, but so expensive that it long worked only for small proteins. Rosetta (Baker lab) assembles structures from short fragments of known structures, and it grew into a tool for protein design.
  • Comparative (homology) modelling finds a related protein of known structure (Sessions 4–5) and builds the model on it as a template. It is reliable when a template exists, but useless for a new fold. The table above shows why it works: related sequences share their structure.
  • Contact prediction uses the fact that residues that touch tend to mutate together. Large alignments (Session 5) therefore reveal which pairs are in contact and fill in a contact map like the one above.
  • Deep learning arrived with AlphaFold2 (2020), which combines learned representations, evolutionary information and geometry, and was the breakthrough in CASP14. David Baker, Demis Hassabis and John Jumper shared the 2024 Nobel Prize in Chemistry for protein design and structure prediction. Session 12 covers AlphaFold, once Sessions 7–11 have built up the neural-network machinery.

In terms of representations, the course’s path from here is:

sequence
  → profile / evolutionary information      (Session 5)
  → learned representation                  (Sessions 7–11)
  → local structure, contacts, distances    (Sessions 7, 10, 12)
  → 3D structure                            (Session 12)

6.5.3 Further reading

6.6 The course notebook

notebooks/session06-protein-structure-in-code.ipynb fetches the two haemoglobin structures (deoxy 2HHB, oxy 1HHO) and makes each level of structure concrete. It reads the chains and residues from the file, computes the secondary structure with PyMOL (and compares it with the PDB annotation that Session 7 uses), and renders an image of the tetramer. It also draws β-globin’s distance and contact maps, builds the sequence-versus-structure alignment table above, and measures the iron-to-iron distance that changes by about 5 Å between the two states. Open it in Google Colab via the badge at the top of the notebook page to edit and run it yourself.

6.7 Check your understanding

The questions below give immediate feedback and cover the sections above. They are in the same style as the course’s live in-class peer-instruction quizzes, and the full question bank is in quizzes/session06.md in the repository.

6.8 The lab

The whole lab runs in notebooks/session06-lab.ipynb on Colab, in the browser or from VS Code; nothing is installed on your own computer. It starts with PyMOL, run as a Python library inside the notebook, on three structures beyond haemoglobin. An HIV envelope glycoprotein trimer with an antibody (7LXM) is used for representations, chains and structural alignment (cealign). A chitinase with bound metal ions and an inhibitor (8C6Z) is used for ligands and charged residues. Human neuroglobin (1OJ6) is used for the central comparison, which you run with TM-align:

same protein, experimental vs. AlphaFold prediction  → nearly identical
a different globin (hemoglobin)                       → same fold
GFP                                                   → unrelated fold

Here AlphaFold DB simply supplies a structure to inspect, and Session 12 asks how that prediction is produced and how to decide which parts of it to trust. You then search the whole PDB with neuroglobin through the Foldseek web server’s API, and the lab ends with a structural domain lookup in CATH. An optional tip shows how to view structures directly in VS Code with the Protein Viewer extension.

6.8.1 Submitting this lab

This lab is administered through Canvas, not through this book. See the course’s Canvas page for the current quiz, the deadline and how to submit.

6.9 What’s next

This session gave you structural properties that are worth predicting from sequence. Session 7 starts building the machinery to predict them. It returns to the weighted sum that a PSSM computes, \(S(x) = \sum_i w[i, x_i]\), and formalises it as a perceptron whose weights are learned from labelled examples. It then applies the perceptron to the secondary structure you met in this session, through Rost & Sander’s PHD method, and shows why the helix you saw in PyMOL can be hard to predict from a window of residues.