a–c, Three stages of modelling the T. elongatus POR–Pchlide–NADPH ternary complex. The structures are aligned and superimposed. Each panel highlights one of the three structures in blue (with the other two shown in grey): crystal structure with the chosen docked Pchlide structure (a); the structure after 20-ns annealing (b); and the final representative structure (c). The flexible residues during docking are shown as a yellow ball-and-stick representation, and the Pchlide molecule is shown in green stick representation. d, Potential of mean force (PMF) calculated by umbrella sampling as a function of R 0 (Supplementary Methods) for 50-ns umbrella sampling (black), as well as for the first 20 ns (blue) and the last 20 ns (red). e, Population distributions for each bin, each sampled for 50 ns. f, Potential of mean force was calculated by umbrella sampling as a function of R 0 (distance between Pchlide Mg2+ and lower edge of the POR binding pocket) (Supplementary Methods). The dip in the potential of mean force at an R 0 of about 17 Å corresponds to the formation of a hydrogen bond between Y223 and the Pchlide keto group.