TL;DR
A residue distance map is a square table. Row i and column j hold the distance between the i-th and j-th amino acid residues of a folded protein, so the table shows the whole three-dimensional shape in one grid of numbers. If each distance is replaced by yes or no, depending on whether the two residues are closer than a chosen cutoff, the result is a contact map, which is easier to read and is a common target for structure prediction.
Builds on: Protein Structure, Euclidean Distance, Matrix · Leads to: AlphaFold2, which predicts distances between residues as an intermediate step
Where it's used
Comparing protein structures. Two versions of a protein, such as a wild type and a mutant, can be compared by subtracting their distance maps. Regions where the maps differ are regions where the shape changed, even if the proteins are rotated or moved differently in space. Structural biologists use this idea when they describe how a shape changes.
Predicting structure from sequence. Structure prediction methods such as AlphaFold2 use distance information as an intermediate. Inside the network, they first predict, for each pair of residues, a distribution over distances. The most likely distance, or the probability of being in contact, then constrains the three-dimensional model that is built. Such predictions are scored in blind competitions such as CASP, against experimentally determined structures.
Finding the fold's main features. A contact map shows secondary structure at a glance. Helices and sheets leave recognisable patterns, as the realistic example below shows, so a biologist can read the architecture of a protein from its map before looking at the 3D picture.
How it works
Take four residues, each with a single point that stands for the position of its backbone carbon. These points are a toy example, not real coordinates. Let residue 1 be at (0, 0, 0), residue 2 at (3, 4, 0), residue 3 at (3, 4, 12) and residue 4 at (0, 0, 12), all in ångströms.
-
List the positions. Each residue has a point in three-dimensional space, given by its x, y and z coordinates. Here there are four points. Check: four points, each with three numbers.
-
Measure the distance for one pair. The distance between residues 1 and 2 is the straight-line distance. Subtract the coordinates, square the differences, add them and take the square root: the differences are 3, 4 and 0, so the squares add to 9 + 16 + 0 = 25, and the distance is 5. Check: the familiar 3-4-5 right triangle, lying flat in the plane.
-
Repeat for every pair. Doing the same for all pairs gives the other entries. Residues 1 and 3 differ by 3, 4 and 12, so the distance is √(9 + 16 + 144) = √169 = 13. Residues 2 and 3 differ only in z, by 12, so the distance is 12. Check: 13 is the distance across the diagonal of a box 3 by 4 by 12, and 12 is simply the height.
-
Write the table. Put each distance in its row and column. The diagonal is zero, because a residue is at distance zero from itself. The table is symmetric, because the distance from residue 1 to residue 3 is the same as from residue 3 to residue 1. Check: the entries across the diagonal mirror each other.
-
Threshold to get a contact map. Choose a cutoff, commonly 8 ångströms between the carbon atoms that mark each residue. Entries below the cutoff become 1 (in contact), and the rest become 0. With a cutoff of 8, the pair 1–2 has distance 5 and becomes 1, while the pair 1–3 has distance 13 and becomes 0. The math section works through every entry. Check: a contact map is a grid of 0s and 1s with the same shape as the distance table.
The math
Let a protein have residues, and let residue have a position in three-dimensional space. The protein's shape is the list of these positions.
Step 2 in symbols: the distance between two residues
The Euclidean distance between residues and is
Here means the length of a vector, and is measured in ångströms (1 Å = 10⁻¹⁰ metres). For the pair 1 and 2 in the walkthrough, , so .
Step 3 in symbols: the full map
Collect all pairs into an matrix whose entries are . Two properties follow directly from the formula:
The first says that a residue is at distance zero from itself. The second says the matrix is symmetric, so only the entries above the diagonal need to be computed. For the toy protein, .
Step 5 in symbols: the contact map
Given a cutoff (commonly 8 Å between the carbon atoms that mark each residue), the contact map is the matrix
With , the toy protein has (since 5 8), (since 13 is not less than 8) and (since 12 is not less than 8).
Sequence separation
Residues that are close in the chain are always close in space, so contacts between neighbours carry little information about the fold. Analyses therefore often count only pairs with a large sequence separation , and call pairs with long-range contacts.
Worked examples
Three residues have positions , and , in ångströms.
- Distance : the difference is (0, 6, 0), the squares add to 36, so .
- Distance : the difference is (0, 0, 8), the squares add to 64, so .
- Distance : the difference is (0, 6, 8), the squares add to 36 + 64 = 100, so .
- The distance table is symmetric with zeros on the diagonal: row 1 holds 0, 6, 10; row 2 holds 6, 0, 8; row 3 holds 10, 8, 0.
- With a cutoff of 8: , so . is not less than 8, so . is not less than 8, so .
- Output: the contact map has ones at (1, 2) and (2, 1), and zeros elsewhere, including the diagonal.
Use the four points from the walkthrough: , , , .
- Distance : the difference is (3, 4, 0), the squares add to 25, so .
- Distance : the difference is (0, 0, 12), the squares add to 144, so .
- Distance : the difference is (3, 4, 12), the squares add to 169, so .
- Distance : the difference is (3, 4, −12), the squares add to 169, so .
- Distance : the difference is (0, 0, 12), so .
- Distance : the difference is (3, 4, 0), so .
- Apply the cutoff of 8. The pairs (1, 2) and (3, 4) have distance 5, below 8, so they are in contact. The other four pairs are 12 or 13, so they are not.
- Output: the contact map has ones at (1, 2), (2, 1), (3, 4) and (4, 3), and zeros everywhere else.
This example shows why the map is useful: the two pairs in contact are the two edges of a flat rectangle of length 5, and the map records that structure without any of the coordinates.
An alpha helix is a coil of amino acids in which residue hydrogen-bonds to residue . The backbone carbons of residues and are therefore close together, at about 6 Å, which is within the 8 Å cutoff. Neighbouring residues and are about 3.8 Å apart, but they are excluded from long-range analyses because their sequence separation is only 1.
- Consider a helix of 30 residues. Take the pairs with . There are 26 such pairs: (1, 5), (2, 6), and so on up to (26, 30).
- Each of these pairs is about 6 Å apart, below the 8 Å cutoff, so each entry is 1.
- Plot the contact map. The ones form a band running parallel to the main diagonal, offset by 4 in each direction. Pairs with and also tend to be in contact, so the band is wider than one line.
- Read the pattern. A band offset by 3 or 4 that runs along the diagonal is the signature of a helix.
- Output: a stripe of 1s running along the diagonal and offset from it is a helix in the contact map.
Try it: Two residues of a protein lie on a sheet. Their backbone carbons are 4.5 Å apart, and their sequence separation is 30. Is this pair a contact under the 8 Å cutoff, and would it count as a long-range contact?
Answer: Yes, 4.5 Å is below 8 Å, so it is a contact. A sequence separation of 30 is at least 24, so it is also a long-range contact.
Common mistakes and tradeoffs
It is tempting to think a distance map is a picture of the protein. In fact it is a table of distances. It is unchanged if the whole protein is rotated or moved, so it captures the shape but not the orientation in space. Two different folds can give similar maps only when their residue distances are similar.
It is tempting to think a contact map always records the whole fold. In fact it depends on the cutoff. A cutoff of 8 Å is a convention, not a law of nature, and a different cutoff changes which pairs count as contacts. A pair just over the cutoff may still be a real neighbour.
It is tempting to think neighbours along the chain are informative. In fact residues and are always close, so a contact map is dominated by those trivial entries. Long-range contacts with large sequence separation carry the information about how the chain folds back on itself.
It is tempting to treat a predicted distance map as a measured one. In fact a predicted map is a model's best estimate, and it can be wrong in the regions the model is least sure about. Predicted maps should be read with their confidence.
When to use a distance map: comparing two structures without aligning them in space, reading fold patterns, and as an intermediate target for structure prediction.
When not to use it: when the actual three-dimensional arrangement matters, such as the positions of atoms in a binding pocket. A map loses the direction and orientation of each contact. Full coordinates or a 3D structure are then needed.
Alternatives: a root-mean-square deviation of aligned coordinates measures how far two structures differ after superposition. Contact maps are simpler, and they do not need alignment.
History
The first three-dimensional structures of folded proteins were determined by X-ray crystallography in the late 1950s, beginning with myoglobin. Researchers then needed ways to compare and describe shapes without relying on a single coordinate frame, because the same protein can be placed in many orientations. Distance-based descriptions were a natural answer, since distances do not depend on how a structure is oriented.
As structure databases grew, researchers used contact maps to compare folds and to look for ways to predict folds from sequence. Predicting contacts became a benchmark task, and methods that predict full distance distributions, rather than only contacts, pushed accuracy much higher. AlphaFold2, published in 2021, predicts such distances inside its network and uses them to build the final three-dimensional model.
Recap
- A protein's shape is the list of positions of its residues in three-dimensional space.
- The distance between two residues is the Euclidean distance between their positions, and collecting all these distances gives a symmetric matrix with zeros on the diagonal.
- A contact map keeps only the entries below a cutoff, usually 8 Å, and marks them as 1.
- Patterns in the map reveal the fold: helices appear as stripes offset from the diagonal, and long-range contacts show how distant parts of the chain touch.
- Read next: AlphaFold2 for how predicted distances become a structure.
Check yourself
QuestionTwo residues have coordinates (1, 2, 2) and (4, 6, 2). What is their distance?Show answer
The difference is (3, 4, 0). The squares add to 9 + 16 + 0 = 25, so the distance is 5.
QuestionWhy is the diagonal of a residue distance matrix zero, and why is the matrix symmetric?Show answer
The diagonal entry is the distance from a residue to itself, which is zero. The matrix is symmetric because : swapping the two points only flips the sign of each difference, and squaring removes the sign.
QuestionA pair of residues has distance 9 Å. With the 8 Å cutoff, is it a contact, and what value goes in the contact map?Show answer
No. Since 9 is not less than 8, the entry is 0.
QuestionWhy do analyses usually exclude pairs with small sequence separation when counting contacts?Show answer
Residues that are close along the chain are always close in space, so those pairs are almost always contacts. They say little about the fold. Long-range contacts, with a separation of at least 24 residues, show how distant parts of the chain come together.
QuestionA helix shows a stripe of contacts offset 4 from the diagonal. Why 4?Show answer
In an alpha helix, residue hydrogen-bonds to residue , and the helix's coiled geometry puts the backbone carbons of those two residues about 6 Å apart. That puts every such pair within the 8 Å cutoff, so the stripe is at offset 4.