Differential dynamic microscopy

Do these proteins attract or repel?

Proteins are far too small to see in a microscope, yet a bright-field movie of a protein solution holds how fast they diffuse, and so how large they are. Filmed at a few concentrations, it also tells whether they repel or attract each other, through two numbers used to judge whether a protein formulation will stay stable: the diffusion interaction parameter kD and the second virial coefficient B2. Here you can check what differential dynamic microscopy (DDM) finds on simulated protein solutions (Guidolin et al. 2023).

Try this first: does adding salt make antibodies repel each other more, or less? Predict, then watch the page check it.

How deep do you want to go?
Simulating the movie...
Live simulated bright-field movie

Hands on

The bench

Choose the protein, its charge and the salt in the buffer, then the microscope and the camera (controls on the left, or just below on a phone). The bench records four movies at one concentration and takes about ten seconds; the concentration series of step 7 takes about a minute. "Copy a link to this setup" gives an address that opens the bench with the same settings.

1

Set up the microscope

The microscope sees a round field 25 mm across in its image plane. A camera chip covers a rectangle in it, and you choose which part of the chip to read out. Proteins scatter very little light, so the setup is chosen to catch as much of it as possible: plain bright field, the condenser aperture closed down so that the light is nearly coherent, a bright lamp that fills each pixel close to its capacity, and pixels binned 2 x 2.

How one protein looks

What this step gives: the finest stripes the movie can hold, and how much light each protein changes in them: the objective, the condenser and the lamp decide both.

The math: a movie of billions of proteins

The proteins are not followed one by one: billions of them sit below the field of view. The movie is built from their number density ρ(r, t). Each protein changes the light by the same faint image K(q, z), which depends on how far it is from focus; it is computed as for a particle on the sizing page (Mie scattering of a sphere with the dry volume of the protein, from its mass and a partial specific volume of 0.73 mL/g, and a refractive index nliquid + (dn/dc) / v, with dn/dc = 0.185 mL/g; the partially coherent light of the condenser; scalar optics). The Fourier transform of the image is then

F(q, t) ∝ (1/Lz) Σn K̂n(q) ρn(q, t),    K̂n(q) = ∫ K(q, z) cos[kn(z − zbottom)] dz,    kn = nπ / Lz

a sum over the modes of the density between the two walls of the chamber, Lz apart. Each mode ρn fluctuates as an independent random process with variance N S(0) (N proteins in the box, S(0) their structure factor at the scale of the microscope) and correlation time 1 / [Dc (q2 + kn2)], with Dc the collective diffusion coefficient. S(0) and Dc come from how the proteins interact (step 7). Over the exposure the camera averages each mode, drawn exactly from its statistics. Each pixel then gets the background light, the change made by the proteins, shot noise and read noise.

2

Record a movie

32-bit, photoelectrons per pixel; opens in ImageJ, Fiji and fastDDM.

Four movies of the same sample are recorded and analysed together: each one is short, because proteins move fast, and the browser can hold only so many frames.

What this step gives: a stack of frames and the time of each. The time between frames and the length of the movie set the fastest and the slowest changes that can be measured.

In fastDDM

The structure function below is the same as fastDDM's. With your own movies you would start from the image files:

import fastddm as fd
img_seq = fd.read_images(file_names)
3

Subtract two frames

Subtract a frame from one taken a little later. Everything that stays still cancels out; what is left is what moved, plus the camera noise.

What this step gives: for every pair of frames a delay apart, an image of what changed. Random motion usually makes the difference grow with the delay; directed motion can also make it swing up and down.

The math: the difference image
ΔI(x; t, Δt) = I(x, t + Δt) − I(x, t)
4

Split it into stripe patterns

Strength of each pattern in the difference (click it, or use the sliders)
The pattern you picked
How much of each pattern is left
-10, gone1, all there

Any image can be built by adding up stripe patterns of different spacing and direction. The Fourier transform tells how much of each pattern the difference image contains, averaged over the whole movie. The centre of the map holds wide stripes, the edge fine ones.

The charts further down label each pattern by q, a number that grows as the stripes get finer: q = 2π divided by the stripe spacing, in inverse micrometres. Stripes 1 µm apart have q of about 6.

Here each pattern is a ripple in the number of proteins: a few more along the bright stripes, a few fewer along the dark ones. Diffusion smooths every ripple out, the fine ones first. The camera noise adds the same amount to every pattern at every delay, so it can be told apart from the proteins, which add more the longer the delay.

The second map shows how much of each pattern is left after the delay: red where it is still all there, the colour of the page where it has faded.

The dashed circle on the strength map marks the finest pattern the objective can resolve.

What this step gives: for each stripe spacing (each q, one ring of the map) and each delay, how much the movie has changed.

The math: structure function of a protein solution
d(q, Δt) = ⟨ |F[ΔI](q; t, Δt)|2 ⟩ = A(q) [1 − f(q, Δt)] + B,    f(q, Δt) = Σn wn(q) e−Dc(q2 + kn2)Δt

with A(q) ∝ N S(0) Σn |K̂n(q)|2 and weights wn ∝ |K̂n(q)|2 that add up to 1: the modes of the density along the axis of the microscope, seen through the depth of field of step 1. B is the camera noise. The amplitude is proportional to the concentration and to S(0), the structure factor at wave vectors far below one over the size of a protein (q Rh is about 0.01 here): this is what step 7 uses. Map axes: qx to the right, qy up.

With evenly spaced frames, as here, fastDDM gives the same structure function:

dqt = fd.ddm(img_seq, range(1, len(img_seq) // 2))   # lags in frames
dqt.pixel_size = 0.65        # um, the pixel of this setup (step 2)
dqt.set_frame_rate(500)     # frames per second of this setup: sets the delays in seconds
aa = fd.azimuthal_average(dqt, bins=bins, range=(0, dqt.ky[-1]))
5

Watch each pattern change

For each stripe spacing, follow how much of the pattern is left as the delay grows. Fine stripes (red) fade first, wide ones (blue) last: to smooth out a wider ripple, the proteins have to travel further. Proteins are tiny next to the stripes, so a single number, how fast they spread, sets the fading of every pattern.

The points are measured: how different two frames a delay apart look, with the camera noise taken away and divided by the full change, then turned around so that 1 means the whole pattern is still there and 0 that it is gone. They scatter because the proteins change the light so little.

The points are f(q, Δt) = 1 − (d − B) / (A S̄), the lines the model fitted at each q (step 6); S̄ = Σ wn S(xn) ≤ 1 is the part of each pattern left to fade once the exposure has blurred the fastest changes, so that every curve ends at 0. The order of the analysis. d is measured first and B comes from the camera; A and D are fitted together at each q, and the points follow from A.

The numbers behind this chart: how much of each pattern is left against the delay
Predict first: the antibody is 5.3 nm in radius, and the bench holds 8 mg/mL of it in a buffer with little salt, where the antibodies carry the same charge. Read as the motion of one protein alone, will the size DDM finds come out smaller, larger, or the same?

What this step gives: how fast each pattern fades, and whether one diffusion coefficient describes them all.

6

How fast the proteins spread

From each pattern the page reads how fast the proteins spread: the diffusion coefficient. Patterns too faint against the camera noise, or that fade faster than one frame or more slowly than the movie lasts, are left out; the others are averaged. With the temperature and the viscosity of the buffer, the Stokes-Einstein relation turns the diffusion coefficient into a radius. But at any concentration the proteins feel each other, so this is an apparent radius.

At each q the model of step 4 is fitted to d(q, Δt), with B from the camera: A and D. The patterns that pass the checks below are averaged (weighted mean of ln D). The Stokes-Einstein relation gives an apparent hydrodynamic radius Rapp = kBT / 6πηD; it equals Rh only at zero concentration, since D = Dc = D0 (1 + kD c).

How fast the proteins spread, read from each pattern
    The numbers behind this chart: diffusion coefficient found at each q
    Signal A(q) and camera noise B. The proteins make a weak signal: at every q it is far below the camera noise (the result box says by how much). It still stands out because each point averages many pairs of frames and many patterns of the same ring; a q is left out where A is less than three times its own uncertainty (the hollow dots here and in the chart above).
    The numbers behind this chart: signal and noise amplitudes
    What the analysis is told, and what it finds

    Told (inputs): the pixel size, the frame rate and the exposure time, the camera noise (from the mean count and the read noise), and the optics of the microscope with the thickness of the chamber, for the motion along its axis; the temperature and the viscosity of the buffer, only to turn D into a radius.

    Found from the movies: D and A at each q, and their averages.

    In this simulation the analysis uses the same model of the optics that made the movie, so agreement here shows that the analysis recovers what was simulated under those assumptions; with a real microscope the optics are another input that can be wrong.

    What this step gives: the collective diffusion coefficient at one concentration, and an apparent radius; it becomes the size of one protein only when extrapolated to zero concentration (step 7).

    The math: the fit at each q
    d(q, Δt) = A Σn wn [S(xn) − K(xn) e−ΓnΔt] + B,    Γn = D (q2 + kn2),   xn = Γn Te
    S(x) = 2 (x − 1 + e−x) / x2,    K(x) = 2 (cosh x − 1) / x2

    The weights wn come from the optics (step 4): proteins moving up and down through the depth of field change the image too. S and K account for the exposure Te, during which the patterns keep changing; for Te = 0 both are 1. Fit. B = 2 (mean count + read noise2), from the camera. At each D the best A follows by linear least squares; D is searched on a logarithmic grid and refined by golden sections, with weights (number of Fourier modes × pairs of frames) / d2. Uncertainties from a jackknife that leaves out one of five parts of one movie at a time. Checks. A q is left out when no decay is found, when A is below three times its uncertainty (lost in the camera noise), when the decay is slower than half the movie or faster than one frame, when ln D is uncertain by more than 0.5, or when D is more than three times off the median of the others.

    What the page does not fix. On twelve independent samples of the antibody at 115 mM salt and 30 mg/mL, D came out 0.4 % low on average, with a scatter of 0.4 % from sample to sample: about half the uncertainty the page quotes, which errs on the cautious side. The offset moves by a few tenths of a percent when the depth-of-field or the exposure correction is switched off (without the first, D comes out 0.3 % high); we have not traced it further. Earlier tests that showed a 1-4 % offset in Rh used the same random sample at every concentration, which made the points of a series move together. Interactions beyond first order in the concentration, and their effect on the hydrodynamic part of kD, are left out of the simulation as well as of the analysis.

    7

    Interactions from a concentration series

    Repeat the measurement at five concentrations, and the interactions show. Two things change how fast a crowd of proteins evens out its ripples as it gets denser. Repulsion between the proteins speeds this up and attraction slows it down. And each protein, as it moves, drags the liquid and so its neighbours along, which slows the crowd down too, even for proteins that only bump into each other. How the diffusion coefficient changes with the concentration holds both effects: its slope is the diffusion interaction parameter, kD. How strong the ripples are holds only the first, and gives the second virial coefficient (B2 per pair of proteins, or A2 per gram, as on this page): proteins that repel keep evenly spread, so the signal per protein drops as the concentration rises, while proteins that attract cluster a little, and it grows. Where the straight line through the diffusion coefficients meets zero concentration is one protein on its own: its infinite-dilution hydrodynamic radius, the radius of a sphere that would diffuse as the protein does with no other protein around.

    To first order in the concentration c, Dc = D0 (1 + kD c) and, since the amplitude grows as c S(0) with S(0) = 1 / (1 + 2A2Mc), ⟨A⟩ = k c / (1 + c/c0) with c0 = 1/(2A2M), the Debye-Zimm relation of static light scattering written for DDM (Guidolin et al. 2023, eq. 5). The constant k holds the optics, which are not calibrated, so A2 comes from the shape of the curve alone. The fits give D0 (hence Rh), the diffusion interaction parameter kD and the static second virial coefficient A2 = B2NA / M2. B2 is the second virial coefficient per pair of molecules, a volume; A2 is the same quantity per gram (mol mL/g2), the form light scattering reports, and the one Guidolin et al. call B2. A2 measures the interactions alone, while kD = 2A2M − kH also holds kH, the hydrodynamic drag between neighbours, which is there even for hard spheres: a negative kD does not by itself mean that the proteins attract. The intercept D0 gives the infinite-dilution hydrodynamic radius. The optics cancel in the ratio of amplitudes, because every movie is filmed the same way.

    Do these proteins attract or repel? In this buffer with little salt the antibodies repel each other, and kD is about 14 mL/g. Predict first: the salt goes from 15 to 115 mM. Does kD go up, go down, or stay the same?

    What this step gives: the hydrodynamic radius of one protein on its own (at infinite dilution), and two measures of how proteins interact: kD from how they move, A2 (or B2) from how they arrange. Both assume a first-order dependence on concentration, which holds at low concentration only.

    A question to think about: At 115 mM salt the antibody's A2 is still positive, yet its kD is negative. How can the same proteins look repulsive in one measure and attractive in the other?

    A2 counts everything that keeps two proteins apart, and their size alone makes it positive: hard spheres give A2 = 4 vh / M. kD = 2 A2 M − kH also counts the drag of each protein on its neighbours through the liquid, kH = 6.55 vh, which slows the crowd. So kD turns negative as soon as A2 drops below 3.3 vh / M, a little under the value for hard spheres: a weak attraction is enough, long before A2 itself turns negative.

    The math: from the pair potential to kD and A2

    Each protein is a hard sphere of radius Rh (σ = 2Rh) with a net charge Z, screened by the salt (Debye-Hueckel), and a short-range attraction of depth ε at contact and range δ = 0.3 nm:

    U(r) / kBT = Z2 λB e−κ(r − σ) / [(1 + κσ/2)2 r] − ε σ e−(r − σ)/δ / r,    r > σ

    with λB the Bjerrum length, the distance at which two elementary charges in water interact with an energy of kBT (0.71 nm at room temperature), and 1/κ the Debye length, the distance over which the salt screens a charge, 0.30 nm / √(I in mol/L) for a monovalent salt. Then

    Symbols: M, the molar mass of the protein (g/mol); NA, Avogadro's number (6.022 × 1023 per mol, not the numerical aperture NA of the optics); c, the concentration in g/mL.

    B2 = 2π ∫0∞ [1 − e−U(r)/kBT] r2 dr,    A2 = B2 NA / M2,    kD = 2A2M − kH,    kH = 6.55 vh

    with vh = 4πRh3NA / 3M, the hydrodynamic volume per gram. Hard spheres give A2 = 4vh / M and kD = 1.45 vh (Batchelor 1976; Felderhof 1978). How the charge and the attraction change the hydrodynamic part is left out: kH is that of hard spheres (Batchelor 1972). D0 = kBT / 6πηRh. The movie uses these S(0) and Dc; the page shows a warning when 2A2Mc or kDc exceeds 0.5, where the first-order description is stretched.

    Fit. Weighted straight lines through Dc(c) and through c/⟨A⟩ = (1 + c/c0)/k, the same model as eq. 5 of Guidolin et al., with the uncertainties of step 6 (scaled up when the points scatter more than they allow). The amplitude ⟨A⟩ is the mean over q = 0.6-2.5 µm−1, where the signal is strongest with the optics here (the paper used 0.5-0.8 µm−1, the broad peak of its A(q)); after the first line it is fitted again at each concentration with D fixed on the line. In Python, with the values of each concentration:

    import numpy as np
    c = np.array([2.3, 4.5, 7.5, 11.3, 15.0])       # mg/mL
    D = np.array([...])                            # um^2/s, from step 6 at each c
    sD = np.array([...])                           # their uncertainties
    b, a = np.polyfit(c, D, 1, w=1 / sD)            # slope, intercept
    kD = b / a * 1e3                               # mL/g
    Rh = 1.380649e-23 * T / (6 * np.pi * eta * a * 1e-12)   # m
    Settings used for this run
    
              

    In a real experiment

    What matters

    Each card sets the bench to a typical case and shows where to look; some also run the series of step 7. Use "Back to the standard sample" to start again.

    What this page adds to the published methods

    Guidolin et al. (2023) measured the size of proteins and their kD with bright-field DDM, from the diffusion coefficient at several concentrations. The steps below are not in the papers we cite: we added them while testing the page against its own simulations, and some may exist elsewhere. At the "Addict" level each can be switched off, and the result table shows a baseline: the published steps alone, as implemented here, on the same movies (one exponential per q, frames taken as instants, the amplitudes from their own fits). This baseline is one implementation of the published steps, run on movies from this page's own simulation: it shows what each added step changes here, not how the published method performs in general.

    Glossary

    Numerical aperture (NA)
    How wide a cone of light the objective collects, or the condenser sends: n sin(half-angle). A larger NA resolves finer details and keeps a thinner layer in focus.
    Wave vector q
    Describes a stripe pattern of the image: q = 2π divided by the stripe spacing, in µm-1. Not the wave number of the light, k = 2πn/λ.
    Structure function d(q, Δt)
    The average strength of pattern q in the difference of two frames taken Δt apart.
    Amplitude A and noise B
    A(q): how much pattern q changes once the sample has fully renewed it. B: what the camera noise adds, at every delay.
    Intermediate scattering function f(q, Δt)
    How much of pattern q is still there after a delay Δt: 1, all of it; 0, gone.
    Hydrodynamic radius
    The radius of a sphere that would diffuse as the particle or protein does (Stokes-Einstein relation).
    Self and collective diffusion
    Self: how one particle wanders among the others. Collective: how ripples in the number of particles even out.
    Mean squared displacement
    The average of the squared distance the particles travel in a given time.
    Storage and loss moduli G', G''
    How elastic and how viscous a material is, at an angular frequency ω (rad/s; the frequency in hertz is ω/2π).
    Molar mass M
    The mass of one mole of a protein, in g/mol; a protein of 148 kDa has M = 148 000 g/mol.
    Second virial coefficient
    How two molecules interact, on balance: B2 per pair of molecules (a volume), A2 = B2NA/M2 per gram (mol mL/g2), with NA Avogadro's number. Positive: they keep apart; negative: they attract.
    Diffusion interaction parameter kD
    How fast collective diffusion changes with the concentration: D = D0(1 + kDc). It holds the interactions and the drag of neighbours through the liquid.

    About this tool

    This page is a simple tool, generated with Claude Opus 5.5, that simulates a realistic microscopy experiment in which DDM is used to measure the size of proteins and how they interact. The microscope, light sources and cameras are modelled mostly on the instruments of our SoMeX lab. The proteins are spheres with a charge and a short-range attraction, described to first order in their concentration; how they move and arrange follows from that, and the movie is built from their density rather than from single molecules. The aim is not to produce research-quality data, but to give anyone thinking of using DDM an idea of what it can measure on proteins, and of what limits it.

    If you find something that looks wrong or does not work, please let us know through the contact page.

    To cite this page: R. Cerbino, DDM, hands on: proteins, rcerbino.github.io/ddm/proteins/ (2026), with the date you used it.

    Go further