Module 2 of 4

The Distance Matrix

What happens when we compare everyone against everyone?

A single number tells us how two structures differ. But to understand evolution, we need the relationships between all structures in our dataset.

We organize these comparisons into a Distance Matrix ($\mathbf{D}$). If we have $N$ structures, $\mathbf{D}$ is an $N \times N$ grid where entry $d_{ij}$ is the distance between structure $i$ and structure $j$.

Key Properties
  • Symmetry: $d_{ij} = d_{ji}$ (Distance A $\to$ B is same as B $\to$ A).
  • Diagonal Zero: $d_{ii} = 0$ (A structure is identical to itself).
Interactive Lab

The points on the right are protein structures floating in abstract "Shape Space."

Hover a point, then click-and-drag it (A, B, C, D).

Watch how the Heatmap updates instantly.

Reading the Matrix

Try grouping A & B together and C & D together. Notice the "dark blocks" on the diagonal? These blocks are the signature of evolutionary clades.


1. Shape Space (Drag Points)
2. Resulting Distance Matrix