Learning Lab · Building a model

Reconstructing a structure from contacts

Turn a contact map into 3D coordinates by fitting distances. Then do it again from a different random start and see how much the answer moves.

The previous section asked which polymer model chromatin resembles. This one asks a different question: given a contact map from a real experiment, how do you produce a three-dimensional model of that particular region, and how much should you trust it?

The oldest approach is the most direct. Convert contact frequencies into target distances, then find coordinates that satisfy them as well as possible. Frequent contact means short distance, and a common choice is a power law, \(d_{ij} \propto f_{ij}^{-1/\alpha}\). The fit minimises a stress function,

\[\sigma = \sum_{i<j} w_{ij}\left(|\mathbf{r}_i - \mathbf{r}_j| - d_{ij}\right)^2\]

with weights \(w_{ij}\) that count short distances more heavily, because a high contact count constrains a distance tightly while a count of zero says almost nothing.

The demo does exactly this by stress majorisation, starting from randomly scattered beads. The target distances are generated from a known structure with two domains, so unlike a real experiment there is a ground truth to check against. Measurement noise is added to the targets, since converting counts into distances is never exact.

The experiment worth watching

Let it run. Each fit converges, the run ends, and a new one starts from a fresh random configuration. The panel on the right records the final stress of each completed run.

Two things should stand out.

The structures are not the same. The distance RMSD between consecutive solutions stays stubbornly non-zero, and is of the same order as the RMSD from the ground truth. The rotating structures visibly differ in how the two domains sit relative to each other. Only pairs that are actually in contact are restrained, so the data pin down each domain internally while leaving real freedom in how the domains are arranged, exactly as a sparse experimental contact map does.

The stress does not fully expose that. Repeat runs land tens of per cent apart in stress rather than a few, so it is not the case that every solution scores identically. But the score is a poor guide to the thing you care about: two runs can differ substantially in stress and hardly at all in structure, or land close in stress with domains arranged differently. Ranking by stress does not rank by correctness.

Two controls make this sharper. Raise the contact distance cutoff towards its maximum and the problem becomes over-determined, the spread collapses, and every run recovers the truth. That is the regime a full distance matrix would put you in, and it is not the regime Hi-C is in. Lower it, restraining only close contacts, and the freedom returns. Turning up the noise does the same thing for a different reason.

Why this matters for interpretation

A published Hi-C-derived structure is a solution to this problem, and the fact that a solver converged says only that it found a minimum, not that the minimum is unique.

Underneath is a more fundamental issue, and it is not a defect of the algorithm. A Hi-C contact map is an average over millions of cells. If half the cells have a loop and half do not, the average map shows a loop at half intensity, and the fitting procedure will faithfully produce a single structure with a half-strength loop, which is a conformation that may exist in no cell at all. Restraint-based reconstruction returns the best consensus, and a consensus is not a member of the population unless the population is homogeneous.

This is one of the main reasons the field moved towards mechanistic models of the kind in the rest of this section. A simulation with loop extrusion or epigenetic attraction generates an ensemble of conformations, from which a contact map can be computed and compared with the measurement. The comparison runs in the direction that preserves the cell-to-cell variability instead of averaging it away at the first step.

Reconstruction remains useful, especially for single-cell contact data where there is no averaging to worry about, and as a quick way of visualising what a map implies. The habit worth keeping is the one this page makes concrete: run it more than once, and report the spread alongside the structure.

Current stress
Iterations this run
Completed runs
Stress difference, last two runs
Distance RMSD, last two runs
Distance RMSD from ground truth
Pairs actually restrained

Why it matters · A single structure fitted to a contact map is one solution among many that fit equally well. The spread between repeat runs is part of the result and should be reported with it.