From primordial clocks to circadian oscillators

Circadian rhythms play an essential part in many biological processes, and only three prokaryotic proteins are required to constitute a true post-translational circadian oscillator1. The evolutionary history of the three Kai proteins indicates that KaiC is the oldest member and a central component of the clock2. Subsequent additions of KaiB and KaiA regulate the phosphorylation state of KaiC for time synchronization. The canonical KaiABC system in cyanobacteria is well understood3–6, but little is known about more ancient systems that only possess KaiBC. However, there are reports that they might exhibit a basic, hourglass-like timekeeping mechanism7–9. Here we investigate the primordial circadian clock in Rhodobacter sphaeroides, which contains only KaiBC, to elucidate its inner workings despite missing KaiA. Using a combination of X-ray crystallography and cryogenic electron microscopy, we find a new dodecameric fold for KaiC, in which two hexamers are held together by a coiled-coil bundle of 12 helices. This interaction is formed by the carboxy-terminal extension of KaiC and serves as an ancient regulatory moiety that is later superseded by KaiA. A coiled-coil register shift between daytime and night-time conformations is connected to phosphorylation sites through a long-range allosteric network that spans over 140 Å. Our kinetic data identify the difference in the ATP-to-ADP ratio between day and night as the environmental cue that drives the clock. They also unravel mechanistic details that shed light on the evolution of self-sustained oscillators.

Circadian rhythms play an essential part in many biological processes, and only three prokaryotic proteins are required to constitute a true post-translational circadian oscillator 1 . The evolutionary history of the three Kai proteins indicates that KaiC is the oldest member and a central component of the clock 2 . Subsequent additions of KaiB and KaiA regulate the phosphorylation state of KaiC for time synchronization. The canonical KaiABC system in cyanobacteria is well understood [3][4][5][6] , but little is known about more ancient systems that only possess KaiBC. However, there are reports that they might exhibit a basic, hourglass-like timekeeping mechanism [7][8][9] . Here we investigate the primordial circadian clock in Rhodobacter sphaeroides, which contains only KaiBC, to elucidate its inner workings despite missing KaiA. Using a combination of X-ray crystallography and cryogenic electron microscopy, we find a new dodecameric fold for KaiC, in which two hexamers are held together by a coiled-coil bundle of 12 helices. This interaction is formed by the carboxy-terminal extension of KaiC and serves as an ancient regulatory moiety that is later superseded by KaiA. A coiled-coil register shift between daytime and night-time conformations is connected to phosphorylation sites through a long-range allosteric network that spans over 140 Å. Our kinetic data identify the difference in the ATP-to-ADP ratio between day and night as the environmental cue that drives the clock. They also unravel mechanistic details that shed light on the evolution of self-sustained oscillators.
Circadian clocks are self-sustained biological oscillators that are ubiquitously found in prokaryotic and eukaryotic organisms. In eukaryotes, these systems are complex and highly sophisticated, whereas in prokaryotes, the core mechanism is regulated by a post-translational oscillator that can be reconstituted in vitro with ATP and three proteins (encoded by kaiA, kaiB and kaiC) 1 . Seminal work on the KaiABC system has resulted in a comprehensive understanding of its circadian clock. KaiC is the central component that autophosphorylates by binding to KaiA and autodephosphorylates following association with KaiB 3-6 . The interplay among these three proteins has been shown in vitro to constitute a true circadian oscillator characterized by persistence, resetting and temperature compensation. Consequently, the KaiABC system is considered an elegant and the simplest implementation of a circadian rhythm. The evolutionary history of kai genes established kaiC as the oldest member dating back around 3.5 billion years ago. Subsequent additions of kaiB and most recently kaiA formed the extant kaiBC and kaiABC clusters, respectively 2,10 . Notably, some studies of more primitive organisms that lack kaiA hinted that the kaiBC-based systems might already provide a basic, hourglass-like timekeeping mechanism [7][8][9] . Contrary to the self-sustained oscillators found in cyanobacteria, such a timer requires an environmental cue to drive the clock and for the daily flip of the hourglass. The central role of circadian rhythms in many biological processes, controlled by the day and night cycle on Earth, makes their evolution a fascinating topic.
Here we investigate such a primitive circadian clock through biochemical and structural studies of the KaiBC system of the purple, nonsulfur photosynthetic proteobacterium R. sphaeroides KD131 (hereafter, its components are referred to as KaiB RS and KaiC RS ). The organism shows sustained rhythms of gene expression in vivo, but whether kaiBC is responsible for this observation remains inconclusive in the absence of a kaiC knockout 11 . A previous study of the closely related bacterium Rhodopseudomonas palustris that used a knockout strain demonstrated causality between the proto-circadian rhythm of nitrogen fixation and expression of the kaiC gene 9 . Here through in vitro experiments, we discover that KaiBC RS is a primordial circadian clock with a mechanism that is different from the widely studied circadian oscillator in Synechococcus elongatus PCC 7942 (hereafter, its components are referred to as KaiA SE , KaiB SE and KaiC SE ) [3][4][5][6] . We identify an environmental cue that regulates the phosphorylation state and consequently produces a 24 h clock in vivo as the switch in the ATP-to-ADP ratio between day and night. Our results from kinetic studies combined with X-ray and cryogenic electron microscopy (cryo-EM) structures of the relevant states unravel a long-range allosteric pathway that is crucial for the function of the hourglass and sheds light on the evolution of self-sustained Article oscillators. Notably, we find a new protein fold for KaiC RS and uncover a register shift in the coiled-coil domain that spans around 115 Å as the key regulator in this system, which shows structural similarities to dynein signalling 12 .

The C-terminal tail is a primitive regulatory moiety
To gain insight into the evolution of the kaiBC cluster, we constructed a phylogenetic tree of kaiC after the emergence of kaiB (Fig. 1a, Extended Data Fig. 1a and Supplementary Datasets 1 and 2). The first question we sought to answer is how KaiC RS and other members in the clade can autophosphorylate despite having no KaiA. KaiA is known to be crucial for this function in the canonical KaiABC system at its optimum temperature. We observed a large clade that exhibits a C-terminal tail about 50 amino acids longer compared with kaiC in other clades (Extended Data Fig. 1b). This C-terminal extension near the A loop is predominantly found in the kaiC2 subgroup, which was previously annotated as having two serine phosphorylation sites instead of the Thr-Ser pair found in the kaiC1 and kaiC3 subgroups [13][14][15] (Extended Data Fig. 1b). In S. elongatus, the binding of KaiA SE to the A loop of KaiC SE tethers them in an exposed conformation 16 that activates both autophosphorylation and nucleotide exchange 17 . Given the proximity of the extended C-terminal tail to the A loop, we conjectured that it could serve as the 'primitive' regulatory moiety that was made redundant with the appearance of KaiA.
To test our hypothesis, we first measured the autophosphorylation and nucleotide exchange rates in KaiC RS , which both depend on the presence of KaiA in the KaiABC SE system. We observed an autophosphorylation rate for KaiC RS that was about 16-fold higher than for KaiC SE activated by KaiA SE (6.5 ± 1.0 h −1 compared with 0.40 ± 0.02 h −1 , respectively; Fig. 1b and Extended Data Fig. 2a-e). Similarly, the nucleotide exchange rate was faster in KaiC RS compared with KaiC SE , even in the presence of KaiA SE (18.0 ± 1.5 h −1 compared with 4.7 ± 0.3 h −1 , respectively; Fig. 1c and Extended Data Fig. 2f). Our data show that KaiC RS can perform both autophosphorylation and nucleotide exchange on its own and does so faster than its more recently evolved counterparts.

A coiled-coil interaction assembles a KaiC RS dodecamer
To mechanistically assess how KaiC in kaiA-null systems accomplishes autophosphorylation, we turned to structural biology. The crystal structure of KaiC RS , unlike KaiC from cyanobacteria, revealed a homododecamer that consisted of two homohexameric domains joined by a 12-helical coiled-coil domain that is formed by the extended C-terminal tail (Protein Data Bank (PDB) identifier: 8DBA; Fig. 1d (Fig. 1e). The existence of such an extended conformation following binding of KaiA has been previously proposed 18 . This hypothesis was based on the perceived hyperphosphorylation and hypophosphorylation that occurred after removing the A loop or disrupting KaiA binding, respectively 18 (Fig. 1e). The loss of interaction between the A loop and the 422 loop (just 10 residues apart from the phosphorylation sites) results in closer proximity between the hydroxyl group of Ser431-Thr432 and the γ-phosphate of ATP, thereby, facilitating the phosphoryl transfer step 20 . Furthermore, the sequence similarity between KaiC RS and KaiC SE is less than 30% for the A loop and residues considered important for stabilization of this loop in its buried orientation (that is, the 422 loop and residues 438-444) (Fig. 1e). Together, our structural and kinetic data support the idea that an exposed A loop is key for the KaiA-independent enhancement of nucleotide exchange and hence autophosphorylation in KaiC RS and perhaps other KaiBC-based systems. We then questioned whether the purpose of the coiled-coil domain is to 'pull up' the A loop or to actively participate in nucleotide exchange and autophosphorylation of KaiC. To further understand its role, we generated a truncation at residue Glu490 based on the phylogenetic tree and crystallographic information (KaiC RS -Δcoil) (Extended Data Fig. 1b) to disrupt the coiled-coil interaction between the two hexamers. The crystal structure of KaiC RS -Δcoil (PDB: 8DB3; Fig. 2a,b and Extended Data Table 1), its size-exclusion chromatogram and analytical ultracentrifugation profile (Extended Data Fig. 3a-c) showed a hexameric structure with no coiled-coil interaction. Nucleotide exchange rates in the CII domain for KaiC RS -Δcoil and the wild-type protein were comparable (19.1 ± 0.8 h −1 and 18.0 ± 1.5 h −1 , respectively; Extended Data Fig. 3d). The phosphorylation rates were also similar (5.5 ± 0.4 h −1 and 7.4 ± 0.3 h −1 for KaiC RS -Δcoil and wild type, respectively; Extended Data Fig. 3e,f). These results indicate that the extended A loop and not the coiled-coil interaction plays a pivotal part in nucleotide exchange and autophosphorylation in KaiC RS . The results also provide a potential mechanism of autophosphorylation in other KaiBC-based systems that lack a coiled-coil bundle. Notably, the coiled-coil bundle provides additional hexameric stability. In detail, the KaiC RS dodecamer is stable for extended periods of time in the presence of only ADP (Extended Data Fig. 3g,h) Fig. 2 | A coiled-coil partner switch coupled to an allosteric network in the CII domain promotes autodephosphorylation. a, X-ray structure of KaiC RS -Δcoil was solved in the C222 1 space group and contained three monomers in the asymmetric unit, with ADP present in all active sites. The obtained electron density map allowed for model building up to Pro463, which indicated that the truncation at position 490 results in enhanced flexibility beyond Pro463. Phosphorylation of Ser414 (pS414) was observed in chain B (cyan) as shown by the electron density mF o -DF c polder map (green mesh, 3σ contour level). b, Assembly analysis using the PISA software 37 revealed a hexamer as the most probable quaternary structure (top view). c, Structural comparison of the coiled-coil domain for unphosphorylated KaiC RS (dark and light green; X-ray structure) and the KaiC RS -S413E/S414E phosphomimetic mutant (dark and light blue; cryo-EM structure). d, Overlay of interacting dimers of the structures in c using the CII domain of chain A as a reference (dark shades; bottom). Unphosphorylated KaiC RS (dark green) interacts with the opposite partner on the right (light green), whereas KaiC RS -S413E/S414E (dark blue) interacts with the partner on the left (light blue). The hydrophobic packing in the coiled-coil domain is mediated by only the Cβ atoms of alanine and arginine residues in unphosphorylated KaiC RS , but involves the entire side chain of leucine and isoleucine residues in the phosphomimetic structure.

A long-range allosteric network in KaiC RS
The change in phosphorylation state of KaiC has been well established to be the central feature for the circadian rhythm 22,23 . Notably, when comparing the unphosphorylated form of full-length KaiC RS (PDB: 8DBA) and its phosphomimetic mutant (S413E/S414E; PDB: 8FWI) (Extended Data Fig. 4 and Extended Data Table 2), we observed two distinct coiled-coil interactions. Following phosphorylation, the coiled-coil pairs swap partners by interacting with the other neighbouring chain from the opposite hexamer, which resulted in a register shift that propagated around 115 Å along the entire coiled-coil ( Fig. 2c and Extended Data Fig. 5). In the phosphomimetic state, the register comprised bulkier hydrophobic residues that resulted in a more stable interaction than for the dephosphorylated form ( Fig. 2d and Extended Data Fig. 3g). Furthermore, the C-terminal residues of KaiC RS -S413E/ S414E interacted with the CII domain of the opposite hexamer, whereas the lack of electron density for the last 30 residues in the wild-type structure indicates more flexibility in the dephosphorylated state. We discovered that these conformational changes in the coiled-coil domain seemed to be coupled through a long-range allosteric network to the phosphorylation sites. The rotameric states of residues Ser413, Ser414, Trp419, Val421, Tyr436, Leu438, Val449 and Arg450 moved concertedly and pointed towards the nucleotide-binding site when the protein was phosphorylated or pointed away in the absence of a phosphate group (Fig. 2e, Extended Data Fig. 5d and Supplementary Video 1). We propose that the proximity of the nucleotide to the phosphorylated residue facilitated more efficient phosphoryl transfer. We therefore experimentally determined the impact of the coiled-coil domain on the autodephosphorylation rate of KaiC RS . The wild-type protein dephosphorylated comparatively quickly (observed rate constant = 11.5 ± 0.8 h −1 ) in the presence of only ADP. By contrast, little dephosphorylation was observed for KaiC RS -Δcoil ( Fig. 2f and Extended Data Fig. 3i), for which allosteric propagation was disrupted (Extended Data Fig. 5d). Consistent with this accelerated dephosphorylation rate mediated by the coiled-coil domain, our crystallographic data showed a phosphate group on Ser414 for KaiC RS -Δcoil but not for the wild-type protein ( Fig. 2a and Extended Data Fig. 5d).

The ATP-to-ADP ratio resets the clock
It was notable that KaiC RS can autodephosphorylate on its own despite being constitutively active for phosphorylation owing to its extended A loop conformation. In the canonical kaiABC system, the interaction between KaiB and KaiC is required to provide a new binding interface that sequesters KaiA from its activating binding site, thereby promoting autodephosphorylation at the optimum temperature of the organism [24][25][26] . We therefore sought to discover whether the KaiC RS system can oscillate and whether there is a regulatory role for KaiB RS in this process. Comparing the in vitro phosphorylation states of KaiC RS in the absence and presence of KaiB RS showed an initial, rapid phosphorylation followed by an oscillatory-like pattern in the presence of KaiB RS (hereafter referred to as KaiBC RS ), whereas KaiC RS alone remained phosphorylated (Fig. 3a,b). Notably, the ATP consumption during the reaction with KaiB RS was significantly higher than without (Fig. 3a). As noted above, KaiC RS will also dephosphorylate completely in the presence of only ADP (Fig. 2f). These results suggest that the phosphorylation state   of KaiC RS and the observed oscillatory half-cycle ( Fig. 3a,b) is probably related to a change in the ATP-to-ADP ratio. We conjectured that this could constitute the environmental cue to reset the timer. To test our hypothesis, an ATP-recycling system was added after complete dephosphorylation of KaiBC RS . As predicted, KaiC RS was able to restart the cycle and phosphorylate again (Extended Data Fig. 6a). We note that in vivo, the ATP-to-ADP ratio will not vary as substantially as in this in vitro experiment, as nucleotide homeostasis is tightly regulated. To mimic the day and night period for R. sphaeroides, we repeated the experiments while keeping the ATP-to-ADP ratio constant (mostly ATP at daytime owing to photosynthesis compared with 25:75% ATP-to-ADP during night time) 27 . In the presence of high ATP (that is, mimicking daytime), KaiC RS remained single or double phosphorylated ( Fig. 3c and Extended Data Fig. 6b) irrespective of KaiB RS . By contrast, a constant 25:75% ATP-to-ADP ratio (that is, mimicking night time) resulted in a much higher fraction of dephosphorylated KaiC RS in the presence of KaiB RS (Fig. 3c). Moreover, when the ATP-to-ADP ratio was flipped to mimic daytime, KaiC RS was able to phosphorylate again (Fig. 3c, around the 28 h mark). Our data support the notion that the phosphorylation behaviour of KaiBC RS strongly depends on the ATP-to-ADP ratio and demonstrate that the physical binding of KaiB RS results in a higher level of KaiC RS dephosphorylation at night time.
Next we investigated the accelerated ATPase activity observed in KaiC RS after the formation of the complex. The ATPase activity reported for KaiC SE is low (about 15 ATP molecules per day per molecule of KaiC SE ) and was proposed as a reason for the slowness of circadian oscillation 28 . KaiC RS alone shows a significantly faster ATPase rate than KaiC SE , which is further enhanced by binding of KaiB RS (208 ± 19 and 1,557 ± 172 ATP molecules day per day per KaiC RS , respectively; left two bars in Fig. 3d and Extended Data Fig. 6c-g). Furthermore, KaiC RS does not exhibit  Article temperature compensation for its ATPase activity (temperature coefficient Q 10 about 1.9; Extended Data Fig. 6c), a feature that is present in KaiC SE and proposed to be a prerequisite for self-sustained rhythms 28 . The deviation from unity for Q 10 is consistent with our earlier observation that the KaiBC RS system is not a true circadian oscillator but rather an hourglass timer (Fig. 3b).   Fig. 9b).

Structure of the KaiBC RS complex
The bound state of KaiB RS adopts the same fold-switch conformation as observed for KaiB TE (ref. 25 ) and suggests that this is the canonical binding-competent state (Fig. 4b). Following binding of KaiB RS , the CI-CI interfaces loosen up (Fig. 4c), which enables the formation of a tunnel that connects bulk solvent to the position of the hydrolytic water in the active sites ( Fig. 4d and Extended Data Fig. 9c). There are other lines of evidence for the weakened interactions within the CI domains. First, KaiB RS binding to either KaiC RS -CI domain (Extended Data Fig. 10a) or KaiC RS -Δcoil (that is, missing the C-terminal extensions; Extended Data Fig. 10b) resulted in disassembly of the hexameric KaiC RS structure into its monomers. By contrast, full-length KaiC RS maintained its oligomeric state following binding of KaiB RS , which is probably due to the stabilization provided by the coiled-coil interaction. Second, a decrease in melting temperature (T m ) of KaiC RS was observed with increasing KaiB RS concentration (Extended Data Fig. 10c). There was no interaction between neighbouring KaiB RS molecules within the complex (Extended Data Fig. 9b), which suggests that there is a non-cooperative assembly of KaiB RS to KaiC RS . This result is contrary to what has been observed for KaiBC SE and KaiBC TE complexes 31,32 . Furthermore, we noted that KaiB-bound structures in phosphomimetic variants of KaiC RS (Fig. 4c,d) and KaiC SE (ref. 26 ) have ADP bound in their CI domain. This result demonstrates that the post-hydrolysis state is also the binding-competent state for KaiB RS . To test this hypothesis, a His-tagged KaiB RS protein was used in pull-down assays to detect its physical interaction with wild-type and mutant forms of KaiC RS bound with either ADP or ATP. Nearly all KaiB RS was complexed to ADP-bound KaiC RS , whereas less than 30% co-eluted in the ATP-bound form, regardless of the phosphorylation state ( Fig. 4e and Extended Data Fig. 10d,e). The formation of complexes depended inversely on the ATP-to-ADP ratio (Extended Data Fig. 10f). We performed fluorescence anisotropy competition experiments to obtain a more quantitative description of the binding interaction between KaiC RS and KaiB RS . Highly similar dissociation constant (K d ) values were obtained for unphosphorylated, wild-type KaiC RS (Fig. 4f) and its phosphomimetic form (Extended Data Fig. 10g) bound with ADP (0.42 ± 0.03 μM and 0.79 ± 0.06 μM, respectively). No measurable binding curves were obtained for ATP-bound phosphorylated wild-type KaiC RS (Fig. 4f) or for KaiC RS -S413E/S414E (Extended Data Fig. 10g) with ATP-recycling system, which is probably due to the small fraction of complex present. Our data show that the post-hydrolysis state in the CI domain is key for KaiB RS binding, whereas the phosphorylation state of KaiC RS has only a marginal effect.
In summary, we demonstrate that binding of KaiB RS at the CI domain in the post-hydrolysis state facilitates the hydrolysis of transiently formed ATP after dephosphorylation of KaiC RS in the CII domain (Fig. 4g). Our fluorescence experiments ( Fig. 3g and Extended Data Fig. 8f) detected a conformational change in the CII domain following KaiB RS binding, but we did not observe major structural changes in the cryo-EM structures. Based on the temperature dependence of the fluorescence amplitudes (Extended Data Fig. 8f), we conjecture that the inability to detect conformational differences is probably because of the low temperature. As the CII domain prefers to bind ATP over ADP (Extended Data Fig. 10h), ATP hydrolysis in the CII domain stimulated by KaiB RS is particularly important to keep KaiC RS in its dephosphorylated state at night time. During this period, the exogenous ATP-to-ADP ratio remains sufficiently high to otherwise result in ATP-binding in the CII active site (Fig. 3c and Extended Data Fig. 6b).

Discussion
The KaiBC RS system studied here represents a primordial, hourglass timekeeping machinery, and its mechanism provides insight into more evolved circadian oscillators such as KaiABC. The dodecameric KaiC RS showed constitutive kinase activity owing to its extended C-terminal tail that forms a coiled-coil bundle with the opposing hexamer. This structure elicits a conformation akin to the exposed A loop conformation in KaiAC SE , and autophosphorylation occurs within half an hour. In the KaiABC SE system, the transition from unphosphorylated to double phosphorylated KaiC takes place over about 12 h, and the fine-tuning of this first half of the circadian rhythm is accomplished by the emergence of KaiA SE during evolution. The second clock protein, KaiB, binds the CI domain with the same fold-switched state in both systems. The interaction is controlled by the phosphorylation state in the KaiABC SE system, and its sole function is to sequester KaiA SE from the activating binding site, whereas KaiB binding directly accelerates ATPase activity in the KaiBC RS system regardless of the phosphorylation state. The KaiBC RS system requires an environmental switch in the ATP-to-ADP concentration to reset the clock. The system therefore follows the day-night schedule when nucleotide concentrations inherently fluctuate in the organism. By contrast, the self-sustained oscillator KaiABC SE remains functional over a wide range of nucleotide concentrations and responds to changes in the ATP-to-ADP ratio by changing its phosphorylation period and amplitude to remain entrained with the day-night cycle 33 .
The newly reported structural fold of KaiC utilizes the versatile coiled-coil architecture as part of a long-range allosteric network that regulates KaiC RS dephosphorylation. Nature uses conformational changes in coiled-coil domains for a variety of regulatory functions 34 , including the activity of the motor protein dynein in the cellular transport of cargo along the actin filament 12 . A similar register shift, although in a coiled-coil interaction formed by only two helices, is used in dynein motility. Given that this simple heptad repeat sequence emerged multiple times and is found throughout all kingdoms of life 35 , it is an example of convergent evolution.

Online content
Any methods, additional references, Nature Portfolio reporting summaries, source data, extended data, supplementary information, acknowledgements, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at https://doi.org/10.1038/s41586-023-05836-9.

Construct of KaiC and KaiB expression vectors
The wild-type KaiC RS (GenBank identifier: ACM04290.1) and KaiB RS (GenBank: WP_002725098.1) from R. sphaeroides strain KD131/KCTC 12085 (equivalent: Cereibacter sphaeroides strain KD131) constructs used in this paper were ordered from GenScript (Supplementary Table 1). Codon-optimized plasmids for KaiC RS and KaiB RS were subcloned into NcoI/KpnI sites of the pETM-41 vector. A QuikChange II Site-Directed Mutagenesis kit (Agilent Technologies) was used to generate single mutant, double mutant and truncated versions of KaiC RS . The truncated KaiC RS (KaiC RS -Δcoil and KaiCI RS ) were generated by introducing stop codons in the KaiC RS wild-type plasmid. All primers were ordered from Genewiz (Supplementary Table 2). The presence of the intended KaiC RS mutations in the plasmid was confirmed by DNA sequencing by Genewiz using primers ordered from the same company (listed in Supplementary Table 2).
Both KaiC SE and KaiA SE plasmids were a gift from E. K. O'Shea. Expression and purification were performed according to a previously described procedure 6 .

Expression and purification of KaiC RS and KaiB RS from R. sphaeroides
KaiC RS , KaiC RS mutants and KaiB RS were expressed in Escherichia coli BL21(DE3) cells (New England Biolabs) harbouring the plasmid pETM-41 containing the kaiC RS or kaiB RS gene. Three colonies from a freshly prepared transformation plate were inoculated into 1 litre of TB medium containing 50 μg ml -1 kanamycin. This culture was grown at 25 °C with shaking at 220 r.p.m. for 48 h without IPTG induction (leaky expression). The cells were pelleted by centrifugation at 4,200 r.p.m. for 15 min at 4 °C and stored at −80 °C.
Frozen cell pellets of KaiC RS and KaiC RS mutants were resuspended into lysate buffer (buffer A C-RS ) containing 1× EDTA-free protease inhibitor cocktail (Thermo Fisher Scientific), DNAse I (Sigma Aldrich) and lysozyme (Sigma Aldrich), and the lysate was sonicated for 10-15 min (20 s on, 30 s off, output power less than 40%) on ice followed by centrifugation at 18,000 r.p.m. at 4 °C for 45 min to remove cell debris. The lysate was filtered through a 0.45 μm filter and then loaded on HisTrap HP prepacked Ni-sepharose columns (Cytiva) pre-equilibrated with buffer A C-RS at 0.5 ml min -1 . The column was washed with buffer A C-RS at 1 ml min -1 until the UV absorbance returned to baseline. Impurities were then washed with 15% buffer B C-RS , and the protein was eluted with 50% buffer B C-RS . The eluted complex was diluted with 1.5-fold dialysis buffer C-RS then subjected to in-house prepared His-tagged TEV protease (1:10, TEVP:KaiC RS molar ratio) cleavage to remove the His 6 -MBP tag from KaiC RS (wild-type and mutants) overnight at 4 °C in 6-8 kDa snakeskin dialysis tubing (Thermo Fisher Scientific) that was exchanged against dialysis buffer C-RS . Cleaved KaiC RS was filtered through a 1 μm filter and once again loaded onto HisTrap HP prepacked Ni-sepharose columns at 0.5 ml min -1 to remove His-tagged TEV protease, His 6 -MBP tag and uncleaved protein. The flow through was concentrated using a Millipore Amicon Ultra-15 centrifugal filter device (10 kDa cut-off) and immediately passed through a HiPrep Sephacryl S-400 HR column (Cytiva) pre-equilibrated with buffer C C-RS . Protein was purified to homogeneity with a single band on Bis-Tris 4-12% gradient SDS-PAGE gel (Genscript) at 62.5 kDa. All protein purification steps were done at 4 °C or on ice. Protein was aliquoted and flash-frozen before storage at −80 °C until further use. The protein concentration was measured using a Microplate BCA Protein Assay kit (Thermo Fisher Scientific) on a SpectraMax MiniMax 300 imaging cytometer using BSA as a standard curve. Typical yields of KaiC RS (wild-type and mutants) were 20-40 mg l -1 of culture.
The purification of KaiB RS was similar to KaiC RS , but with slight modifications as outlined below. After sonication and centrifugation to remove cell debris, the lysate was filtered through a 0.22 μm filter and then passed through HisTrap HP prepacked Ni Sepharose columns, pre-equilibrated with buffer A B-RS . The column was washed with buffer A B-RS until the UV absorbance returned to baseline. Impurities were washed with 5% buffer B B-RS , and the protein was eluted with 50% buffer B B-RS . The fusion protein was concentrated down to around 30 ml using Amicon stirred cells (Millipore Sigma) with 10 kDa cut-off. In-house prepared His-tagged TEV protease was added, and the fusion protein was cleaved overnight at 4 °C in a 3.5 kDa dialysis cassette that was exchanged against dialysis B-RS buffer. The cleaved KaiB RS was passed through HisTrap HP prepacked Ni-sepharose columns and concentrated down to about 10 ml using a Millipore Amicon Ultra-15 centrifugal filter device (3.5 kDa cut-off). The protein sample was then loaded onto a 26/60 Superdex S75 gel-filtration column (Cytiva) pre-equilibrated with buffer C B-RS at 4 °C. The eluted protein was loaded onto Q-sepharose HP columns pre-equilibrated with buffer D B-RS to remove ATPase contamination. The protein was eluted out in the flow through. A gradient from 0 to 100% buffer E B-RS was passed through Q-sepharose HP columns to ensure that no KaiB RS was bound to the columns. Protein was purified to homogeneity with the single band on Bis-Tris 4-12% gradient SDS-PAGE gels at 10.3 kDa. Protein was aliquoted and flash-frozen before storage at −80 °C until use. The protein concentration was measured using a Microplate BCA Protein Assay kit (Thermo Fisher Scientific) on a SpectraMax MiniMax 300 imaging cytometer using BSA as a standard curve. Typical yields of KaiB RS were 30-40 mg l -1 of culture.

Phylogenetic tree of KaiC
Protein sequences used in this study were identified in a multistep process. In the first step, a selection of sequences was identified using the BLASTP algorithm, utilizing a query based on the protein sequence for KaiC from S. elongatus (GenBank: WP_011242648.1) 38 . The query was run against NCBI's non-redundant protein database with the exclusion of models or uncultured and environmental sample sequences. A multiple sequence alignment of the selected 1,538 sequences was generated using MAFFT [39][40][41] (Supplementary Dataset 1). This alignment was used as input to generate an initial phylogenetic tree for KaiC with RAxML (v.8.2.9) 42 using the PROTGAMMALG model. The generated tree was then used to identify the emergence of KaiB to create the final tree that focused on systems containing either KaiBC or KaiABC. To do so, a BLASTP search was performed for each branch tip with the KaiB sequence from S. elongatus, with the results restricted to the organism at which the branch tip was identified from. The observed branch point of emergence of KaiB agrees well with previous results in which it was shown that KaiB is mainly seen in non-archaea, non-proteobacteria 2 .
To ensure the best possible sequence coverage, a BLASTP search using KaiB as query (GenBank: WP_011242647.1) was performed. The resulting sequences were then used to identify the organisms that they came from, which allowed us to create a list of organisms with an identified KaiB sequence. This list was then used to select for a subsequent BLASTP search using KaiC as query and therefore to identify only KaiC sequences for organisms that contain both KaiB and KaiC. A spot check was run to confirm that, for example, KaiA was indeed found among all cyanobacteria identified except for Prochlorococcus marinus. The obtained sequences were trimmed down to only include sequences with a sequence homology of 90% or less using CD-HIT 43 to arrive at a total of 401 sequences. For the calculation of the phylogenetic tree, RecA from S. elongates was added to serve as the outgroup. Sequences were aligned using MAFFT [39][40][41] (Supplementary Dataset 2) with the E-INS-I algorithm 44 . The multiple sequence alignment was then used as input for the phylogenetic tree calculation with IQ-TREE (v.1.6.beta5), using the LG-substitution matrix 45 with the freeRate model (using 10 categories; LG+R10) 46,47 . To enable determination of branch support, an aBayes test 48 , a SH-aLRT test (20,000 bootstrap replicates 49 ) and an ultrafast bootstrap (20,000 bootstrap replicates 50 ) were performed (Supplementary Dataset 1; branch supports in order: SH-aLRT support (%)/aBayes support/ultrafast bootstrap support (%)).
The PEG 400 in the KaiC RS crystallization solution acted as a cryoprotectant, whereas KaiC RS -Δcoil crystals were cryoprotected in LV Cryo Oil (MiTeGen). Single crystals were cooled in liquid nitrogen, and X-ray diffraction images were collected at ALS beamline 8.2.1 at 100 K (data collection details are described in Extended Data Table 1). The data were indexed and integrated in iMosflm 51 , and scaled and merged in Aimless 52 .
To obtain a structural model of KaiC RS , first the KaiC RS -Δcoil structure was solved by molecular replacement in MRage 53 using the KaiC RS sequence (residues 1-490) as input to search for homologues in the PDB database. The initial KaiC RS -Δcoil structure based on the KaiC SE (PDB: 1TF7 (ref. 36 )) was manually rebuilt in Coot (v.0.9.81) 54 and refined in Phenix (v.1.20.1-4487) 55 . Finally, the KaiC RS -Δcoil structure was used as the molecular replacement search model in Phaser 56 to solve the full-length KaiC RS structure.
The assigned space groups were validated in Zanuda 57 , and the position of the asymmetric unit in the unit cell was standardized using Achesym 58 . KaiC RS coiled-coil registers were analysed using SamCC-Turbo (v.0.0.2) with the default socket cut-off value of 7.4 (ref. 59 ). The images of protein structures were rendered using PyMOL (v.2.6.0) 60 .
Tunnel detection and calculation were performed using CAVER 3.0.2 PyMOL plugin 61 , with the minimum probe radius varying between 0.9 and 1.1. Default values were used for all other parameters. All atoms except waters were used in the calculation. The residue selection for starting point consisted of Glu62, Glu63 and ADP602. The catalytic position of the water in the CI domain was modelled from the crystal structure of the transition-state analogue-bound F 1 -ATPase (PDB: 1w0j, water 2,064 from chain D 62 ).

Cryo-EM and image processing
For preparation of EM grids, 3-4 μl of 4.3 mg ml -1 (per monomer concentration) of sample in 20 mM MOPS pH 6.50, 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 2 mM ATP was applied to glow-discharged 1.2/1.3 400 mesh C-flat carbon-coated copper grids (Protochips). The grids were frozen using a Vitrobot Mark IV (ThermoFisher) at 4 °C and 95% humidity, with a blot time of 4 s. All datasets were collected on a Titan Krios operated at an acceleration voltage of 300 keV, with a GIF quantum energy filter (Gatan) and a GATAN K2 Summit direct electron detector controlled by SerialEM 63 .
Inspection of the raw cryo-EM images revealed some heterogeneity in the relative orientations between individual hexamers of the dodecameric particles, presumably due to inherent flexibility in the coiled-coil regions, which limited the resolution to 3.3-3.4 Å. To obtain higher resolution reconstructions, the dodecamers were split and processed as individual hexamers, with C6 symmetry being applied throughout processing. To reconstitute the full dodecamer reconstruction, two copies of the hexamer reconstruction were overlaid on top of each other using the 'fit in map' function in Chimera 64 to fit one hexamer into the lower resolution end density of the other. The overlaid hexamers were then combined, creating a new map in which each voxel takes the value from the hexamer with highest absolute value.
For KaiC RS -S413E/S414E alone, a dataset of approximately 2,500 movies was collected. The movies were recorded with a pixel size of 1.074 Å, including 70 frames and with an exposure rate of 1.31 e − per Å 2 per frame. Approximately 825,000 particles were picked, and after 2D classification, around 320,000 particles from good class averages were carried forward for further processing. The final measured resolution of the reconstruction was 2.9 Å (Extended Data Fig. 4a).
For the KaiC RS -S413E/S414E:KaiB RS complex, a dataset of around 2,000 movies was collected. The movies were recorded with a pixel size of 1.023 Å, including 70 frames and with an exposure rate of 1.35 e − per Å 2 per frame. About 440,000 particles were picked, and after 2D classification around 190,000 particles from good class averages were carried forward for further processing. The final measured resolution of the reconstruction was 2.7 Å (Extended Data Fig. 4b).
All data processing was carried out using cisTEM (v.2.0.0) 65 , and followed the workflow of motion correction, CTF parameter estimation, particle picking, 2D classification, ab initio 3D map generation, 3D refinement, 3D classification, per-particle CTF refinement and B-factor sharpening. The highest resolution of 3D refinement used was 4 Å for both reconstructions, and final resolutions were estimated using the cisTEM PartFSC and a threshold of 0.143.
To validate the combined dodecamer structure, we also processed both datasets as full D6 symmetric dodecamers (Extended Data Fig. 4c,d). This was accomplished by extracting the picked hexamers into a large box size and performing 2D classification with automatic centring. Clear dodecamer class averages were then selected and re-extracted from the original images, with picking coordinates that were adjusted by the translation required to match the centred class average. After this centring, duplicate picks were removed to obtain the final dodecamer particle stacks. These stacks were processed as described above, with the highest resolution of 3D refinement used as 4.25 Å.
In an attempt to find deviations from D6 symmetry, we also calculated reconstructions for both structures assuming C1 symmetry, starting from the ab initio 3D step. The resulting refined C1 structures did not exhibit detectable departures from D6 symmetry (Extended Data Fig. 4e). We therefore present symmetrized volumes as our final result.

Preparation of unphosphorylated KaiC RS
Purified KaiC RS (about 20 μM) from −80 °C was dialysed in 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 0.1 mM ADP overnight at 4 °C to remove glycerol and to replace ATP with ADP. The dialysed KaiC RS was then heated at 30 °C for 4 h to obtain fully unphosphorylated KaiC RS bound with ADP, and the sample was then passed through 0.22 μm Spin-X centrifuge tube filters (Corning). The sample was concentrated to a higher concentration (less than 100 μM) at 4 °C. The protein concentration was measured using a BCA assay.

Kinetics of KaiC RS autodephosphorylation in the presence and absence of KaiB RS .
Purified KaiC RS (around 20 μM) was dialysed in reaction buffer containing 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 0.1 mM ADP overnight at 4 °C to remove glycerol and to generate KaiC RS bound with ADP. After dialysis at 4 °C, KaiC RS exists in two states: 50% unphosphorylated and 50% single phosphorylated at Ser413 (pSer413), which were confirmed by tandem mass spectrometry (data not shown). The autodephosphorylation reaction was started by adding KaiC RS or KaiC RS in the presence of KaiB RS (3.5 μM) into reaction buffer pre-equilibrated at 30 °C.
Oscillation of KaiBC RS . Dialysed KaiC RS (3.5 μM) was preincubated at 35 °C for 30 min in 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 0.1 mM ADP in the presence or absence of KaiB RS (3.5 μM). The reactions were started by adding 4 mM ATP and reaction samples were collected at specific time points for 10% SDS-PAGE and HPLC analysis to identify phosphorylation state of KaiC RS and amount of nucleotide at each time point, respectively.

Controlling ATP-to-ADP ratio to mimic daytime and night time.
KaiC RS was dialysed in reaction buffer containing 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 1 mM ATP overnight at 4 °C. To start the reaction as shown in Fig. 3c, KaiC RS (3.5 μM) in the absence or presence of KaiB RS (3.5 μM) was mixed with additional ATP (final 4 mM to mimic daytime), and the reaction samples (500 μl) were added into a D-Tube Dialyzer (midi 3.5 kDa cut-off, EMD Millipore) that was exchanged against 4 mM ATP buffer (400 ml). After the 12-h time point, the reaction samples were transferred into preincubated 25% ATP/ADP buffer (400 ml) that mimics the night time. After the 24-h time point, the same samples were changed into preincubated 4 mM ATP to mimic the daytime again.
To start the experiment as shown in Extended Data The reaction samples (300 μl) were added into a D-Tube Dialyzer (midi 3.5 kDa cut-off, EMD Millipore) that was exchanged against 25% ATP/ ADP buffer (300 ml).
During the reaction, the samples were gently shaken in a 30 °C incubator, and reaction samples were collected at specific time points for 10% SDS-PAGE and HPLC analysis to identify the phosphorylation state of KaiC RS and the amount of nucleotide at each time point, respectively.
The rationale for the ATP-to-ADP ratio at daytime and night time comes from two earlier literature reports. The change in ATP-to-ADP ratio at daytime and night time were directly measured in vivo in the strain R. sphaeroides 27 , in which ATP is 2.0-2.4 mM during day and drops to 0.5-0.6 during night, and it is well known that the total nucleotide concentration stays constant. We chose the total nucleotide concentration of 4 mM in our in vitro work to be identical to the described in vitro experiments performed for the canonical KaiC SE . Because of photosynthesis in daylight, virtually all nucleotide is ATP 33 . We note that a slightly higher amount of ATP will not affect our results, as the affinity of KaiC RS for ATP is higher than for ADP.

Separation of unphosphorylated, single and double phosphorylated KaiC RS by SDS-PAGE
Unphosphorylated, single phosphorylated and double phosphorylated KaiC RS were separated by 10% SDS-PAGE with 37.5:1 acrylamide:bis-acrylamide (Bio-Rad), 18 cm × 16 cm × 1 mm Tris-HCl gel with 1× Tris-glycine SDS running buffer (Invitrogen). The samples were heated at 95 °C for 3 min, and 400 ng of material was loaded onto the Tris-HCl gel. The gel was run with a constant current of 35 mA, 150 W, and the voltage was greater than 700 V for 5.5 h in a cold room, with a water bath set to 12 °C using a Hoefer SE600 electrophoresis unit.
Unphosphorylated and phosphorylated KaiC RS -Δcoil were separated by Zn 2+ Phos-tag SDS-PAGE with 10% acrylamide gel containing 50 μM Phos-tag acrylamide (Wako). The gel was run with a constant current of 30 mA for 5 h 30 min in a cold-room, with 1 μg per well protein samples pre-heated at 95 °C for 3 min.
The gels were stained overnight at room temperature with Instant-Blue protein gel stain (Expedeon) with gentle shaking and destained with distilled water until bands were clearly visible. The gels were imaged on a ChemiDoc Imager (Bio-Rad), and Image Lab software (Bio-Rad) was used for analysis.

Statistics and reproducibility for gel electrophoresis
Data shown in main text figures and Extended Data figures are representative SDS-PAGE gels for at least three independent biological replicates (n = 3), except for experiments presented in Fig. 3a,c, which were performed in duplicate. r.p.m. (for KaiC RS wild-type and mutants and KaiC SE ), with continuous scans from 5.8 to 7.3 cm at 0.005 cm intervals at 20 °C on a Beckman Optima XL-A (Beckman-Coulter) equipped with absorption optics and a four-hole An60Ti rotor. Measurements were set up at 280 nm (for KaiB RS ) and 295 nm (for KaiC RS and KaiC SE ) to avoid interference from ATP. The software package SEDFIT (v.14.1) was used for data evaluation 66 . KaiC RS and KaiC RS -Δcoil (100 μM) were prepared in 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 1 mM ATP. KaiC SE (100 μM) was prepared in 20 mM MOPS (pH 8.0), 150 mM NaCl, 2 mM TCEP, 5 mM MgCl 2 , and 1 mM ATP. KaiB RS (500 μM) was prepared in 20 mM MOPS (pH 6.5), 50 mM NaCl and 2 mM TCEP.

ATPase activity
Purified KaiC RS (both wild-type and mutant forms (around 20 μM)) and KaiB RS (about 90 μM) were dialysed in 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 1 mM ATP (reaction buffer) overnight at 4 °C. The samples were passed through 0.22 μm Spin-X centrifuge tube filters, and concentrations were measured using a BCA assay before setting up the reactions. Typical KaiC RS or KaiBC RS reactions contained 3.5 μM KaiC RS (wild type and mutants) and 3.5 μM KaiB RS in reaction buffer with a final concentration of 4 mM ATP. The samples were incubated at the indicated temperatures and were sampled by hand at specific time points. Next 10 μl of sample was quenched with 10 μl of 10% trichloroacetic acid (Millipore Sigma), and the mixture was passed through a 0.22 μm Spin-X centrifuge tube filter to remove the precipitated protein. The flow through sample was then re-adjusted to pH 6.2 for nucleotide separation by adding 10 μl of 0.75 M HEPES, pH 8.0. The final samples were kept at −20 °C until HPLC analysis.
Three microlitres of each sample were injected with a high-precision autosampler (injection error of <0.1 μl, resulting in a maximum systemic error of about 6%) to a reverse-phase HPLC instrument with an ACE 5 μm particle size, C18-AR and 100 Å pore size column (Advanced Chromatography Technologies). The instrument was pre-equilibrated with 100 mM potassium phosphate pH 6.2 with a flow rate of 0.4 ml min -1 . Using pure nucleotide samples, the retention times of ATP, ADP and AMP were determined to be 2.6, 3.1 and 4.4 min, respectively. The concentration of each nucleotide was calculated from the relative ratio of the peak areas and the total nucleotide concentration. To determine ATPase activity rates, the observed rate constants were determined from at least five data points for each temperature using initial rate analysis and least-squares linear regression (Extended Data Figs. 6c,d and 8b-d). The mean values and uncertainties (s.d.) shown in Fig. 3d, Extended Data Figs. 6 and 8 were derived from three replicate experiments. KaleidaGraph (v.4.5.3; Synergy) was used for data analysis and plotting.

Nucleotide exchange
KaiC RS (wild type or mutants) and KaiB RS were dialysed into 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 50 μM ATP overnight at 4 °C. The samples were passed through 0.22 μm Spin-X centrifuge tube filters, and the protein concentration was measured using a BCA assay. The reaction contained 3.5 μM of KaiC RS -S413E and/ or 35 μM of KaiB RS , and samples were incubated at 20, 25, 30 and 35 °C for 16-24 h in the presence of an ATP-recycling system. The reactions were started by adding 250 μM of mant-ATP ( Jena Bioscience). The spectrum was measured using the fluorescence energy transfer from tryptophan residues in KaiC RS to mant-ATP by exciting the sample at 290 nm (2.5 nm bandwidth) and collecting the emission intensity from 320 nm to 550 nm (5 nm bandwidth) in increments of 2 nm. To measure the nucleotide exchange rate, the maximum change in fluorescence intensity at 440 nm (ΔF 440 nm ) was followed for a total time of 1,800 s in 15 s increments with anti-photobleaching mode on FluoroMax-4 spectrofluorometer (Horiba Scientific) equipped with a water bath to control the temperature. There are two tryptophan residues within 5 Å from the nucleotide-binding site in the KaiCII RS domain and no tryptophan residue close to the nucleotide-binding site in the KaiCI RS domain, so the nucleotide exchange observed in the experiments are for the KaiCII RS domain. To ensure that the exchange rate observed in the experiments are from nucleotide exchange in the KaiCII RS domain, KaiCI RS (which only contains the CI domain) was tested; no change in fluorescence was observed following the addition of mant-ATP (Extended Data Fig. 8h).
The experiments for KaiC SE alone and with KaiC SE mixed in and for KaiA SE were performed in a similar way, except that KaiC SE and KaiA SE were dialysed in 20 mM MOPS (pH 8.0), 150 mM NaCl, 2mM TCEP, 10 mM MgCl 2 and 50 μM ATP overnight at 4 °C. KaiA SE was incubated with KaiC SE for 1 h at 30 °C before adding 250 μM mant-ATP.
For the nucleotide preference experiment, KaiC RS -S413E/S414E and KaiC RS -S413A/S414A were dialysed in 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 20 μM ADP overnight at 4 °C. KaiC RS -S413E/S414E or KaiC RS -S413A/S414A (3.5 μM) was first mixed with mant-ATPγS or mant-ADP (150 μM), and the kinetic trace at 440 nm was recorded at 30 °C. After the fluorescence trace at 440 nm reached a plateau, which indicates that the nucleotide analogue was fully bound to the protein, a 27-fold excess of ATP (4 mM) was added to displace the bound nucleotide analogue, and the decay of fluorescence intensity was recorded at 440 nm at 30 °C. The experiments were run in triplicate, and results were averaged and fitted to a single exponential decay.
Analysis was performed by fitting individual traces to an exponential equation using KinTek Explorer software 67,68] , and error bars denote the standard errors as obtained from triplicate experiments. KaleidaGraph (v.4.5.3; Synergy) was used for data plotting.
The samples were spotted onto a TLC plate (PEI-cellulose F plates, Merck) and quickly dried with a blow-dryer for 30 s. The TLC plates were run first with distilled water as a mobile phase. After TLC plates were completely dried, 0.75 M KH 2 PO 4 was used as the mobile phase to separate 32 P-labelled KaiC RS , [γ-32 P]ATP and inorganic phosphate ( 32 P), as previously shown 29 . The phosphor-screens were scanned on an Amersham Typhoon (GE Healthcare) at a resolution of 100 μm. ImageQuant TL 7.0 software was used for analysis.

Fluorescence anisotropy competition
Fluorescence anisotropy competition experiments were carried out using a FluoroMax-4 spectrofluorometer (Horiba Scientific) at 30 °C. Excitation and emission wavelengths for KaiB RS labelled with 6-iodoacetamidofluorescein (6-IAF, Thermo Fisher Scientific) at Cys29 were set at 492 nm (5 nm bandwidth) and 520 nm (5 nm bandwidth), respectively, with fixed G factor (G factor of KaiB RS-6IAF alone) to eliminate instrumental bias. The average anisotropy and standard error were calculated from ten replicate measurements.
KaiB RS -6IAF was prepared by mixing degassed KaiB RS (100 μM) with 20-fold excess of 6-IAF (stock 10 mM in 50% DMSO) in 20 mM Tris-base (pH 7.0), 50 mM NaCl and 1 mM TCEP (degassed). The reaction was incubated at room temperature for 4 h and dialysed against 20 mM Tris-base (pH 7.0), 50 mM NaCl and 1 mM TCEP in a 3.5 kDa dialysis cassette overnight at 4 °C to remove unreacted 6-IAF and small amounts of DMSO. The crosslinked sample was passed through a 0.22 μm Spin-X centrifuge tube filter and loaded onto Superdex-75 10/300 GL pre-equilibrated with 20 mM MOPS (pH 7.0), 50 mM NaCl and 1 mM TCEP with a 0.2 ml min -1 flow rate to remove leftover unreacted 6-IAF. The sample was aliquoted and flash-frozen in liquid nitrogen and stored at −80 °C until use. All the crosslinked reactions were performed in the dark.
For the fluorescence anisotropy competitive binding experiment, KaiB RS -6IAF (0.2-0.4 μM) was first incubated with wild-type or mutant KaiC RS (1 μM, 60% increase in anisotropy in comparison to KaiB RS -6IAF alone) in 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP and 10 mM MgCl 2 in the presence of 4 mM ADP or 4 mM ATP with an ATP-recycling system (2 U ml -1 pyruvate kinase and 10 mM phosphoenolpyruvate), then unlabelled KaiB RS (0-50 μM) was added to the samples. The samples were incubated at 30 °C for 4 h or 12 h before measurement.
The decrease in fluorescence anisotropy (FA) versus concentration of unlabelled KaiB RS was fitted to equation (1) using the Levenberg-Marquardt nonlinear fitting algorithm included in KaleidaGraph (Synergy Software) to obtain the half-maximum inhibitory concentration (IC 50 ) value. The K d value can then be calculated from the IC 50 value using equation (2) as previously described 69 .

Pull-down assays
Pull-down assays probe the interaction between KaiC RS (wild type and mutants) with KaiB RS (His 6 -MBP-TEV-KaiB RS ). The His 6 -MBP-TEV-KaiB RS was expressed and purified as described above but without the TEV protease cleavage step. Wild-type or mutant KaiC RS (3.5 μM) was mixed with KaiB RS -tag (3.5 μM) in 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP and 10 mM MgCl 2 in the presence of 4 mM ADP or 4 mM ATP with an ATP-recycling system in a final volume of 400 μl. The samples were incubated at 25 °C for 4 h or 24 h before loading onto a 500 μl spin column with 200 μl (prepared from 400 μl of 50% slurry) Talon beads (Takara) pre-equilibrated with sample buffer. The samples were incubated with the Talon beads for 30 min with gentle shaking, after which the flow through was collected by gravity into 1 ml Eppendorf tubes. The beads were washed three times with 400 μl sample buffer by gravity, then the samples were eluted with 200 μl of 0.5 M imidazole buffer by centrifugation at 1,000g for 1 min. The protein mixture, flow through, wash and eluted samples were run on a Bis-Tris 4-12% gradient SDS-PAGE gel with a molecular weight marker. The gels were stained with Coomassie blue and were imaged on a ChemiDoc Imager (Bio-Rad). Image Lab Software (Bio-Rad) was used for analysis.
The following control experiments were performed: (1) fusion KaiB RS protein in the absence of KaiC RS ; and (2) KaiC RS in the absence of fusion KaiB RS . All the fusion KaiB RS proteins came out only in the elution buffer in the first control experiment, which indicated that fusion KaiB RS binds to Talon beads and the amount of KaiB RS used did not overload the column. All KaiC RS protein came out in the flow through in the second control experiment, which indicated there is no specific binding between KaiC RS and the Talon beads.

Thermofluor assay
KaiC RS and SYPRO Orange (Thermo Fisher Scientific) were used at final concentration of 3 μM and 10×, respectively. The experiments were carried out in 20 mM MOPS (pH 6.5), 50 mM NaCl, 2 mM TCEP, 10 mM MgCl 2 and 4 mM ADP or ATP. The samples were prepared to a final volume of 20 μl in a MicroAmp Fast Optical 96-well reaction plate (Applied Biosystems Life Technologies), and the plate was sealed with Axygen UltraClear sealing film (Corning). The assay plate was run in a StepOne Real-Time PCR instrument (Applied Biosystems Life Technologies) with melt curve set up. The temperature was continuously increased from 25 °C to 95 °C by 0.3 °C every 15 s. The data were fit with nonlinear fitting in KaleidaGraph (Synergy Software) to a Boltzmann sigmoidal curve (equation (3)).
( ) where Y is the fluorescence intensity at temperature T, T is the temperature in degrees Celsius, Bottom is the baseline fluorescence at low temperature, Top is the maximum fluorescence at the top of the truncated data, c is the slope or steepness of the curve, and T m is the melting temperature of the protein.

Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

Data availability
Structure factors and refined models obtained using X-ray crystallography have been deposited into PDB under accession codes 8DBA (wild-type KaiC RS ) and 8DB3 (KaiC RS -∆coil