The UbiX flavin prenyltransferase reaction mechanism resembles class I terpene cyclase chemistry

The UbiX-UbiD enzymes are widespread in microbes, acting in concert to decarboxylate alpha-beta unsaturated carboxylic acids using a highly modified flavin cofactor, prenylated FMN (prFMN). UbiX serves as the flavin prenyltransferase, extending the isoalloxazine ring system with a fourth non-aromatic ring, derived from sequential linkage between a dimethylallyl moiety and the FMN N5 and C6. Using structure determination and solution studies of both dimethylallyl monophosphate (DMAP) and dimethyallyl pyrophosphate (DMAPP) dependent UbiX enzymes, we reveal the first step, N5-C1’ bond formation, is contingent on the presence of a dimethylallyl substrate moiety. Hence, an SN1 mechanism similar to other prenyltransferases is proposed. Selected variants of the (pyro)phosphate binding site are unable to catalyse subsequent Friedel-Crafts alkylation of the flavin C6, but can be rescued by addition of (pyro)phosphate. Thus, retention of the (pyro)phosphate leaving group is required for C6-C3’ bond formation, resembling pyrophosphate initiated class I terpene cyclase reaction chemistry.

T he UbiD-UbiX decarboxylase system is primarily known for its role in the production of quinone cofactors 1 . It is most commonly associated with the ubiquinone biosynthetic pathway (from which it receives its name), catalysing the decarboxylation of 3-octaprenyl-4-hydroxybenzoic acid 2 ; however, homologues have been shown to act in other quinone biosynthesis, including plastoquinone 3 . Recently, the individual roles of UbiD and UbiX have been discovered 4,5 . Originally thought to be redundant but distinct decarboxylases, it has been shown that UbiD is in fact the only decarboxylase, whereas UbiX produces a cofactor strictly required for UbiD activity. However, UbiD-UbiX homologues are also involved in the decarboxylation of a wide variety of enoic and aromatic acid substrates 6 . Furthermore, there are examples of UbiD-UbiX involvement in the production of secondary metabolites 7,8 , as exemplified by the TtnD-TtnC system involved in the production of tautomycetin, which is an antifungal and anticancer compound 9 .
The decarboxylation catalysed by UbiD presents a reaction of biotechnological interest, but the reverse reaction (carboxylation) can also be catalysed by UbiD enzymes under high CO 2 concentrations, allowing for the production of synthetically useful acid compounds. Indeed, it has recently been demonstrated that furan dicarboxylic acid (FDCA), a potential green replacement for PET plastics, can be produced by the UbiD-driven carboxylation of furoic acid 10 . Furoic acid is an abundant waste chemical from pre-treatment of lignocellulosic material in the production of biofuels 11,12 , and therefore represents an ideal feedstock for the production of bioplastics. In fact, it is proposed that UbiD-UbiX mediated carboxylation allows specialised microbes to degrade benzene 13 , phenol 14 or polyaromatic compounds under anaerobic conditions 15 . Hence, the natural variety of substrates which can be (de)carboxylated by the ubiquitous UbiD decarboxylase family renders the system an ideal target for future applications. Given the key role UbiX plays, a full understanding of its mechanism is required to provide a blueprint for future application and engineering of this system.
The discovery that UbiD enzymes depend on the unusual cofactor prenylated FMN (prFMN) for activity, paved the way for determining the role of UbiX 16,17 . It was shown that the latter catalyses a flavin prenyltransferase reaction, using reduced FMNH 2 and dimethylallyl monophosphate (DMAP) as substrates to form prFMNH 2 (i.e., reduced prFMN) 5 . The prFMNH 2 product frequently remains bound to UbiX in vitro. In the presence of oxygen, UbiX-bound prFMNH 2 readily oxidises to form a stable and purple coloured prFMN . semiquinone radical species. It is proposed that in vivo prFMNH 2 is transferred to the UbiD partner, which in turn catalyses the oxidative maturation to the active prFMN iminium form (see refs. 4,18 ; Fig. 1). The iminium form of prFMN has azomethine ylide character 19 , believed to support an unusual 1,3-dipolar cycloaddition reaction with the alpha-beta unsaturated carboxylic acid substrate 20,21 , which ultimately leads to decarboxylation 4,6,9 . Recent studies revealed some UbiX homologues prefer the canonical dimethylallylpyrophosphate isoprenoid precursor (DMAPP) 22 , as opposed to the unusual DMAP preference reported for the Pseudomonas aeruginosa UbiX (PaUbiX 5 ) and other UbiX enzymes 23 . Crystal structures of PaUbiX in complex with substrates reveal a highly conserved phosphate-binding motif that places the substrate within a hydrophobic pocket consisting of the flavin isoalloxazine ring and various aromatic residues. Kinetic crystallography revealed that PaUbiX first catalyses the N5-C1′ bond formation, leading to an N5-prenyl-FMN species, followed by the Friedel-Crafts alkylation of the flavin C6 ( 5 ; Fig. 1). The phosphate-leaving group is proposed to assist with the latter process.
It is unclear what governs the respective DMAP/DMAPP specificity of individual UbiX enzymes, and whether this is coupled to any divergence in the UbiX mechanism in view of the key role suggested for the (pyro)phosphate-leaving group in the C6-C3′ bond formation.
In order to understand the DMAP versus DMAPP preference and any mechanistic consequences, we here determine the crystal structure of the DMAPP-specific Aspergillus niger UbiX (AnUbiX; also called PadA1). This shows that the intricate UbiX:alphaphosphate interaction network is conserved with the DMAPspecific PaUbiX, while additional space is available to accommodate the additional DMAPP beta-phosphate group. Using several UbiX homologues as well as selected PaUbiX variants, in combination with DMAP(P) and DMAP-like substrates, we reveal the first step, N5-C1′ bond formation (i.e., the prenyltransferase step), likely occurs through an S N 1 mechanism. This leads to the strict requirement for a substrate dimethylallyl moiety to initiate the overall reaction. We also reveal that the N5 alkylation process occurs when using DMAP in the DMAPPspecific AnUbiX, and is thus independent of the presence of the DMAPP beta-phosphate. However, in this case we show the ensuing Friedel-Crafts alkylation of the flavin C6 only occurs when using DMAPP. Selected PaUbiX variants of the phosphatebinding site are also unable to catalyse C6-C3′ bond formation, but can be rescued by addition of phosphate. This confirms UbiX catalyses the C6-C3′ bond formation through (pyro)phosphate acid-base catalysis, similar to what has been proposed for class I terpene cyclases 24,25 . UbiX and UbiD act in concert to produce prFMN iminium . Proposed mechanism for flavin prenyltransferase activity by UbiX, followed by transfer of prFMNH 2 to UbiD and subsequent oxidative maturation to the active prFMN iminium cofactor ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-019-10220-1

Results
Structural basis for UbiX DMAP/DMAPP specificity. Following the discovery that the Saccharomyces cerevisiae UbiX (also called Pad1) is capable of flavin prenyltransferase activity with DMAPP 22 , we confirmed that the highly similar (61% identity, 78% similarity-excluding the mitochondrial targeting region) Aspergillus niger UbiX (AnUbiX) also requires DMAPP as opposed to DMAP in order to produce prFMNH 2 (Fig. 2a). We determined the crystal structure of AnUbiX to determine the structural basis of DMAPP versus DMAP specificity. Although AnUbiX was crystallised without any exogenous addition of DMAPP, the crystal structure reveals electron density directly located above the oxidised FMN that corresponds to a bound DMAPP (Fig. 2b) 26 .
Although not present in the deposited model, electron density corresponding to a bound phosphate or sulphate ion occupying the conserved alpha-phosphate-binding site appears present. A structural overlay of O157UbiX with the PaUbiX and AnUbiX crystal structures shows that the equivalent residue to PaUbiX F181 is O157UbiX H164. The latter is likely to form a hydrogen bond with the beta-phosphate similar to AnUbiX Q203 (Fig. 2c), and thus explains why O157UbiX is capable of performing catalysis with DMAPP. In view of the highly similar DMAPP/DMAP binding, it is unclear why AnUbiX (and by extension EcUbiX) is unable to catalyse DMAP-dependent prFMN formation. This suggests a very specific role for the pyrophosphate-leaving group in catalysis. On the other hand, the observation O157UbiX can catalyse the prenyltransferase step with both DMAP and DMAPP, suggesting that the beta-phosphate does not play an essential role.
The prenyltransferase step occurs via an S N 1 mechanism. EcUbiX and AnUbiX do not generate a prFMN• purple radical species when undergoing consecutive reduction and oxidation processes in presence of DMAP. However, at the end of the redox cycle, the UV-Vis spectrum of the mixture is perturbed compared with that of the starting state prior to the reaction, and does not resemble that of oxidised FMN (Fig. 2a, d). The formation of a distinct spectral species following the redox cycle suggests a reaction between DMAP and FMNH 2 has occurred in both EcUbiX and AnUbiX, but that the resulting adduct did not proceed to form prFMNH 2 (given no purple prFMN• Semiquinone formation was observed following oxidation; Fig. 2a, d). We propose this adduct corresponds to the N5-prenylated FMN species. To further investigate the N5-prenylation step, we determined the reactivity of PaUbiX with a series of monophosphorylated compounds resembling DMAP.
Perturbation of the oxidised PaUbiX-bound FMN spectrum indicates a wide range of DMAP-like compounds bind in the PaUbiX active site ( Fig. 3a; Supplementary Fig 3). However, redox cycling of PaUbiX in the presence of these ligands did not alter the flavin spectrum, indicating no FMN modification has occurred. Interestingly, even the DMAP isomer, isopentenyl monophosphate (IMP), is unable to initiate any flavin alkylation reaction. We determined the PaUbiX:FMNH 2 :IMP ternary complex crystal structure, resembling the catalytically active PaUbiX:FMNH 2 :DMAP complex (Fig. 3b). This reveals IMP is indeed bound in a nearly identical manner to DMAP, located directly above the FMNH 2 isoalloxazine plane. A comparison with the previously determined PaUbiX:FMN:DMAP complex structure (4ZAF) reveals flavin reduction is accompanied by a distortion of the isoalloxazine plane (from 173.2°to 161.5°across N5), while shortening the N5-C1 IMP distance to 3.17 Å (as compared with the 3.33 Å N5-C1 DMAP distance). FMN reduction is also accompanied by a minor decrease in the distance between FMN N1 and a water molecule. Crucially, no formation of an N5-C1′ bond can be observed, a process that occurs rapidly upon reduction of PaUbiX:FMN:DMAP crystals 5 . Thus, a dimethylallyl moiety is essential for reactivity, as neither saturated DMAP-like compounds nor the isomer IMP lead to N5 alkylation or prFMN formation.
To further validate this hypothesis, we used geranyl monophosphate (GMP) as an alternative substrate ( Supplementary Fig. 3). This compound contains the required dimethylallyl moiety, but is twice the size of the DMAP substrate. PaUbiX appears to be able to form a geranyl N5-C1′ linkage, by virtue of the change in the UV-Vis spectrum upon redox cycling in the presence of GMP (Fig. 3c). However, GMP binding could not be detected in PaUbiX crystals, which we suggest is due to the presence of W200 that likely blocks GMP access to the active site in crystallo. Indeed, crystals of a PaUbiX W200H variant were soaked with GMP and subjected to reducing conditions to initiate the reaction. The corresponding electron density obtained from reduced PaUbiX W200H:GMP crystals confirms formation of an N5-C1′ bond with the geranyl group (Fig. 3d).
Phosphate-binding pocket mutations perturb C6-alkylation. In an attempt to further probe the DMAP/DMAPP specificity, and explore the putative role of the (pyro)phosphate in Friedel-Crafts C6-alkylation, we constructed F181Q (to mimic AnUbiX) and F181H (to mimic O157UbiX) PaUbiX variants. In each variant, the DMAP specificity was retained, and crystal structures of the corresponding complexes with oxidised FMN and DMAP revealed little difference with the WT PaUbiX structure besides the mutations itself (Fig. 4a, c). This clearly demonstrates the nature of the residue at position 181 is not the sole determinant of DMAP/DMAPP specificity. Upon reduction of the PaUbiX variant crystals, it was apparent that F181H was able to catalyse prFMN formation (Fig. 4b). In contrast, the F181Q mutant does not proceed beyond the N5-prenylated intermediate (Fig. 4d). We have previously identified a similar intermediate species in both PaUbiX Y169F and E49Q crystal structures (4ZAY, 4ZAZ 5 ).
The in crystallo behaviour of both variants is mirrored in solution: F181H is able to form the purple species indicative of the prFMN . semiquinone, while redox cycling of F181Q with DMAP leads to a spectral species with features reminiscent of the DMAP reactions with the DMAPP-specific AnUbiX/EcUbiX (Fig. 4e, f). Using similar conditions, we here show that the UV-Vis spectrum of redox cycled PaUbiX Y169F and E49Q in presence of DMAP is also similar (Fig. 4g). Following reoxidation of PaUbiX F181Q under single turnover conditions, the corresponding EPR spectrum is a single isotropic line with a peak to trough width of 18.3 G at g = 2.0033 (Fig. 4h). This signal lacks the partially resolved hyperfine structure observed previously for prFMN . and is consistent with an FMN neutral (blue) semiquinone species. Given that the orientation of the C1′protons relative to the flavin N5 in the N5-prenylated intermediate is very different to that observed for prFMN, the contribution of the C1′-protons to the EPR spectrum would be expected to be minimal and thus we cannot exclude the possibility that this corresponds to a N5-prenylated intermediate semiquinone species.
It is proposed that the conserved E49 assists Friedel-Crafts alkylation by proton abstraction from the isoalloxazine C6 5 . The PaUbiX E49Q crystal structure reveals an N5-alkylated adduct that appears to have undergone a C2′-C3′ isomerization, which is not observed in the Y169F or F181Q variants ( Supplementary  Fig. 10). The only group that is a likely candidate for catalysing acid/base-mediated isomerization of the N5-bound dimethylallyl moiety is the phosphate group, and this process appears compromised in PaUbiX Y169F/F181Q variants. A perturbation of the phosphate pK a and/or its position relative to the dimethylallyl moiety could prevent formation of the allylic carbocation following C2′-C3′ isomerisation. In a similar way, reaction of the strict DMAPP-specific UbiX enzymes with DMAP might lead to incorrectly positioned phosphate, arresting the reaction at the N5-prenyl stage. Alternatively, the relatively slow C6-alkylation step is hindered by the loss of the weakly bound phosphate in these enzymes prior to the C2′ protonation step. The crystal structures of both Y169F and F181Q retain the phosphate-leaving group in the redox cycled state, despite being unable to form the C3′-C6 bond. However, at the resolution obtained, we are unable to unequivocally state whether the position of the phosphate group is perturbed relative to the C2′ of the DMAP adduct, and it may be the case that the rigidity of the active site in the crystal prevents the total loss of the phosphate group.
(Pyro)phosphate addition salvages the C6-C3′ bond formation. To explore whether the loss of phosphate is indeed responsible for the lack of DMAP-dependent prFMN formation in DMAPP-specific enzymes, we attempted to salvage prFMN formation from the stalled N5-prenyl adduct by the addition of 5 mM (pyro)phosphate to the reaction. We show that in the case of EcUbiX, the addition of either phosphate or pyrophosphate is sufficient to allow DMAP-dependent production of prFMN under single turnover conditions, as demonstrated by formation of the prFMN• radical upon oxidation. Crucially, addition of sulphate did not salvage prFMN formation (Fig. 5a). Furthermore, we tested whether premature phosphate loss could likewise explain the PaUbiX Y169F/F181Q properties. Indeed, addition of 5 mM phosphate to the stalled N5-prenylated Y169F/F181Q species prior to oxidation leads to formation of the purple prFMN. This is further confirmed by the change in the EPR spectrum of the oxidised N5-adduct F181Q species when phosphate is added. Upon addition of 5 mM phosphate, the EPR spectrum returns to a characteristic prFMN•, confirming the Friedel-Crafts C6-alkylation step can occur for the semiquinone species and is phosphate dependent (Fig. 4h). In contrast, product formation in the E49Q variant is not salvaged by the addition of phosphate, indicative of the distinct effect this mutation has on catalysis (Fig. 5b).
Hence, it appears that (pyro)phosphate affinity is key to ensuring that the (pyro)phosphate leaving group from the prenyltransferase S N 1 reaction is retained, in order for it to catalyse the slow C6-alkylation step by protonation of the dimethylallyl C2′. Supplementing the reaction with phosphate enables both DMAPP-specific enzymes as well as PaUbiX variant enzymes to proceed past the otherwise stalled N5-prenylated species.

Discussion
The UbiX enzyme catalyses both the N5-C1′ and C6-C3′ bond formation to generate the fourth ring of the prFMN product (Fig. 6). The reduction of the flavin substrate is strictly required to initiate the N5-C1′ bond formation step, and either is required for an S N 2 type attack on the DMAP(P) substrate or, in the case of an S N 1 mechanism, to assist formation of the DMA carbocation through pi-pi stacking. An S N 2 mechanism can also, in principle, occur with other alkylated phosphates. The lack of activity with all but DMAP(P) substrate (or GMP) confirms the first step is an S N 1-type prenyltransferase reaction dependent on formation of a dimethylallyl-derived resonance-stabilised carbocation. This is similar to that proposed for other evolutionary unrelated prenyltransferases 27,28 . In the DMAP-specific PaUbiX, the conserved E140 is proposed to assist with formation of the phosphate-leaving group through protonation. The crystal structure of the DMAPP-specific AnUbiX reveals a similar interaction between E162 and the DMAPP alpha-phosphate is established, as part of a highly conserved network of polar interaction. In fact, we show DMAPP-specific UbiX enzymes such as AnUbiX and EcUbiX appear to catalyse the prenyltransferase step with DMAP, but in this case do not proceed to the cyclisation step. This suggests the pyrophosphate-leaving   Fig. 4 Phosphate retention is key to C6-C3' bond formation in PaUbiX. a The crystal structure of the F181H PaUbiX variant in complex with DMAP and FMN. b The crystal structure of F181H PaUbiX variant crystals following reduction and subsequent reoxidation revealing formation of prFMN. c The crystal structure of the F181Q PaUbiX variant in complex with DMAP and FMN. d The crystal structure of F181Q PaUbiX variant crystals following reduction and subsequent reoxidation revealing the reaction does not proceed beyond N5-prenylation in this variant. Omit polder maps corresponding to bound DMAP or FMN adducts are contoured at 3 sigma. e UV-Vis spectra of FMNH 2 :F181H PaUbiX incubated with respectively buffer or DMAP following oxidation. f UV-Vis spectra of FMNH 2 :F181Q PaUbiX incubated with buffer or DMAP, respectively, following oxidation. The lack of any features at 550 nm is indicative of the formation of a stalled N5-C15-C1 at 3. g UV-Vis spectra of FMNH 2 :Y169F and E49Q PaUbiX variants incubated with buffer or DMAP, respectively, following oxidation. h EPR spectra of FMNH 2 :F181Q PaUbiX following incubation with DMAP and subsequent oxidation, and following addition of phosphate after oxidation. In the absence of phosphate supplementation, the spectrum is consistent with a blue FMN semiquinone species. Following addition of phosphate to the oxidised protein, the corresponding spectrum shows partial hyperfine structure consistent with formation of prFMN semiquinone. Inset: UV-Vis of the EPR samples. Stereo images of a-d are available in Supplementary Figs. 6-9 group does not play a key role in the N5-prenylation, but the retention of the leaving group is crucial in the C6-C3′ bondformation process in these enzymes. However, the O157UbiX enzyme is able to use both DMAP and DMAPP (albeit with different efficiency) to form the prFMNH 2 product, suggesting the pyrophosphate beta-phosphate group does not play a key role in formation of either of the flavin-dimethylallyl linkages.
Despite the relatively modest changes that occur between DMAPP-specific AnUbiX and DMAP-specific PaUbiX attempts to bestow DMAPP activity on the latter by mutation of F181 were unsuccessful. Instead, the F181Q mutation in particular affected the ability of PaUbiX to complete the catalytic cycle and resulted in formation of stalled N5-prenylated species. A similar behaviour was previously observed with PaUbiX Y169F and E49Q variants, and mimics the DMAP reaction of AnUbiX/ EcUbiX. This suggests the phosphate environment is key to catalysis of the C6-C3′ linkage formation, proposed to occur via tertiary carbocation formation through phosphate-mediated protonation. It is possible the pK a and/or orientation of the bound phosphate are sufficiently perturbed in the PaUbiX variants to hinder this step. Alternatively, affinity for the phosphate might be reduced to a level where the phosphate prematurely leaves the active site prior to cyclisation. The fact that addition of phosphate (but not sulphate) to the reaction buffer salvages prFMNH 2 formation for both Y169F and F181Q PaUbiX variants, strongly suggest that retention of the phosphate is predominantly affected and confirms phosphate plays a key role in the cyclisation process. Furthermore, the addition of phosphate is also able to salvage  Fig. 6 A detailed mechanism for UbiX. The prFMNH 2 formation in UbiX occurs through sequential formation of two FMN-dimethylallyl linkages, the N5-C1′ and C6-C3′ bonds. The N5-prenylation resembles other unrelated prenyltransferases, requiring the dimethylallyl moiety to allow formation of a resonance stabilised carbocation via an S N 1 mechanism using either DMAP or DMAPP as substrate. Flavin reduction is key to initiation of the N5-C1′ bond-formation step. Following the prenyltranserase step, the Friedel-Crafts alkylation of the flavin C6 is initiated by proton transfer via the bound (pyro)phosphate, requiring the presence of the conserved E49 to allow formation of the prFMNH 2 product by proton abstraction from C6 prFMNH 2 formation for the reaction of the EcUbiX with DMAP, confirming the pyrophosphate group is not required in a strict sense for catalysis. Hence, our data confirm direct involvement of the phosphate/pyrophosphate alpha-phosphate group in the cyclisation step, something that has also been proposed in class I terpenoid synthases. Indeed, multistep general acid-base catalysis by the inorganic pyrophosphate coproduct has been suggested to be prevalent in terpenoid cyclases 24,25,[28][29][30] . In the case of UbiX, the high affinity for the N5-prenylated intermediate has allowed us to directly demonstrate involvement of inorganic (pyro) phosphate coproduct in the cyclisation step in selected variants. Our data demonstrate mutation can result in premature loss of the essential inorganic (pyro)phosphate, but that this can be remedied through an increase in inorganic (pyro)phosphate concentration. Similar issues are likely to affect efforts at reprogramming terpenoid synthases to generate novel products, although addition of (pyro)phosphate may not always be sufficient for restoration of catalysis 31 .

Methods
Cloning and mutagenesis. The gene encoding AnUbiX (XP_001390532) was codon optimised and synthesised (GenScript). The gene was amplified by PCR with the primers AnUbiX-F and AnUbiX-R using Phusion polymerase (NEB). The PCR product was cloned using In-Fusion (Clontech) into pET21b (Merck) that had been linearised with NdeI/XhoI (NEB). O157:H7 E. coli ubiX (WP_000767724) was synthesised (GenScript) with an N terminal 6x His tag. The gene was amplified by PCR using the primers O157UbiX-F and O157UbiX-R, and the product was cloned into pET21b using In-Fusion (Clontech) that had been linearised using NdeI and XhoI.
E. coli K12 ubiX was cloned from genomic material. The gene was amplified by PCR using EcUbiX-F and EcUbiX-R primers and cloned into pNic28-Bsa4 32 cut with BsaI using In-Fusion (Clontech).
PaUbiX was previously synthesised (GenScript), codon optimised for E. coli. The gene was amplified with Phusion polymerase using the primers PaUbiX-F and PaUbiX-R, and cloned into pNic28-Bsa4, cut with NcoI and HindIII, using In-Fusion. Previously described PaUbiX variants were used in this study, generated using QuikChange kit (Agilent), along with PaUbiX-W200H. QuikChange variants were generated using primers denoted PaUbiX-< variant > -QCF/R.
The sequence of all plasmids was confirmed using Eurofins Genomics sequencing service and BL21 (DE3) (NEB) were transformed.
Primers used in this study: Expression. BL21(DE3) cells were grown at 37°C in TB supplemented with 50 µg mL −1 antibiotics to an OD 600~0 .6. Gene expression was induced by the addition of 0.2 mM IPTG and the cultures grown overnight, typically for 18 h, at 18°C. Cells were harvested and stored at −20°C.
Purification. Cells expressing AnUbiX were thawed and resuspended in buffer A (200 mM NaCl, 50 mM Tris-HCl pH 7.5) supplemented with 1 mM FMN, RNase, DNase and complete EDTA-free Protease inhibitor cocktail (Sigma). Once homogenous cells were lysed on ice using a Bandolin sonicator, at 30% amplitude with 15 × 20 s bursts interspersed with 40 s intervals. The lysate was clarified by centrifugation at 125,000 g for 60 min (4°C). The supernatant was applied to a Ni-NTA agarose column (Qiagen). The column washed with three column volumes of buffer A supplemented with 10 mM imidazole followed by three column volumes of buffer supplemented with 40 mM imidazole. The protein was eluted with buffer A supplemented with 500 mM imidazole. Samples were subjected to SDS-PAGE analysis, and fractions found to contain the purified AnUbiX were pooled and concentrated using a 10 kD MWCO Vivaspin centrifugal device (Sartorius). PaUbiX cells were resuspended in 50 mM Tris-HCl, 500 mM NaCl, pH 8 (buffer A), supplemented with 1 mM FMN, RNase, DNase and complete EDTAfree protease inhibitor cocktail (Sigma). Once homogenised cells were lysed using Constant Systems Cell Disruptor at 20 kPsi. The lysate was clarified by centrifugation at 125,000 g for 60 min (4°C) prior to loading on a gravity flow Ni-NTA agarose column (Qiagen). The column was washed and the protein eluted in the same manner as described for AnUbiX. The eluted protein was desalted using 10-DG column (Biorad) into 20 mM Tris-HCl, 200 mM NaCl, pH 8 for storage and further experiments. EcUbiX was purified as per the protocol used for PaUbiX, with the addition of 10% glycerol to the purification buffers.
Chemical syntheses. Geraniol, 3-methylbutanol and pentanol (1 mmol) were separately subjected to phosphorylation with ditriethylammonium phosphate salt (2.4 mmol) and trichloroacetonitrile (6 mmol) in acetonitrile (20 mL) 33 . This predominantly gives monophosphorylation to the corresponding derivatives 62-75% yield, with ∼15% of the pyrophosphorylated derivatives also observed. The monophosphorylated derivatives were isolated by column chromatography (silica gel, n-propyl alcohol/concentrated ammonia, 6/3, v/v). The isolated products were lyophilised to a white powder. 1 H, and 31 P NMR were found to be in accordance with the literature.
Wild-type PaUbiX crystals were grown in SG1 screen (Molecular Dimensions) condition F4 (1 M sodium citrate tribasic dihydrate, 0.1 M sodium cacodylate, pH 6.5). The crystals were subjected to soaking with FMN and IMP and were reduced with sodium dithionite, and were cryoprotected in mineral oil before flash cooling in liquid nitrogen.
F181Q crystals grew in multiple conditions. Crystals from D7 LMB screen (Molecular Dimensions) (15% w/v PEG 3350, 0.1 M MES pH 6.2) were soaked with FMN and DMAP, and redox cycled with sodium dithionite prior to cryoprotection in 20% PEG 200 in mother liquor and flash cooling.
F181H crystals grew in multiple conditions. Crystals from F2 LMB screen (Molecular Dimensions) (16% w/v PEG 4000, 20% v/v glycerol, 0.1 M sodium citrate pH 5.8, 0.1 M ammonium sulphate) were soaked with FMN and DMAP and redox cycled with sodium dithionite prior flash cooling in liquid nitrogen.
W200H crystals were produced in various conditions of the PGA screen (Molecular Dimensions). Crystals in condition C3 (0.1 M ammonium sulphate, 0.3 M sodium formate, 0.1 M sodium acetate, pH 5.0, 3% (w/v) gamma-polyglutamic acid (Na + form, LM), 20% MPD) were soaked with geranyl monophosphate and subjected to reduction with sodium dithionite prior to flash cooling in liquid nitrogen.
AnUbiX crystal data were collected at Diamond Light Source on proposal MX-8997 on beamline i03, W200H PaUbiX crystal data were collected on proposal MX-12788 on beamline i03. Other data for PaUbiX crystals were collected at Diamond Light Source on proposal MX-17773 on beamline i04, with the exception of F181H-DMAP (oxidised) which was collected on i24.
Single turnover assays. Single turnover assays were performed with protein which was fully occupied by FMN; to ensure full occupancy, after purification proteins were incubated with 1 mM FMN and were desalted into 20 mM Tris-HCl, 200 mM NaCl, pH 8 using a 10-DG desalting column (Biorad). Assays were performed in a Belle Technology glovebox in an anoxic nitrogen environment. Protein concentrations were adjusted to~200 µM, and were reduced by the titration of minimal volumes of sodium dithionite. Reduction was followed by the decrease in absorbance at 446 nm. Reactions were performed with 2 mM DMAP(P) and where added 5 mM Na(P)Pi or Na 2 SO 4 , pH 8 was used.
Binding assays. The binding of alkyl-phosphate compounds was measured using 50 µM PaUbiX, with the addition of 500 µM compound. The spectra were measured before and after the addition of compounds, and difference spectra were calculated by the subtraction of the unbound spectrum from the bound spectrum.
EPR spectroscopy. EPR spectra were obtained using a Bruker E500/580 EPR spectrometer. Continuous wave X-band (~9.4 GHz) EPR spectra employed a Bruker "Super High Q" cavity (ER 4122SHQE) coupled to an Oxford Instruments ESR900 helium flow cryostat for temperature control. Spectra were acquired at 20 K using 10-microwatt microwave power, 100-kHz field modulation frequency, and 1 -G modulation amplitude. Samples were stored as 300 µL aliquots in 4 -mm quartz tubes (Wilmad) prior to recording spectra.
Reporting summary. Further information on research design is available in the Nature Research Reporting Summary linked to this article.

Data availability
Crystallography data have been deposited in the PDB, under the accession codes 6QLG, 6QLH, 6QLI, 6QLJ, 6QLK, 6QLL and 6QLV. A reporting summary for this Article is available as a Supplementary Information file. All other data supporting the findings of this study are available from the corresponding author on reasonable request. Received: 28 January 2019 Accepted: 23 April 2019