Decoding and reprogramming fungal iterative nonribosomal peptide synthetases

Nonribosomal peptide synthetases (NRPSs) assemble a large group of structurally and functionally diverse natural products. While the iterative catalytic mechanism of bacterial NRPSs is known, it remains unclear how fungal NRPSs create products of desired length. Here we show that fungal iterative NRPSs adopt an alternate incorporation strategy. Beauvericin and bassianolide synthetases have the same C1-A1-T1-C2-A2-MT-T2a-T2b-C3 domain organization. During catalysis, C3 and C2 take turns to incorporate the two biosynthetic precursors into the growing depsipeptide chain that swings between T1 and T2a/T2b with C3 cyclizing the chain when it reaches the full length. We reconstruct the total biosynthesis of beauvericin in vitro by reacting C2 and C3 with two SNAC-linked precursors and present a domain swapping approach to reprogramming these enzymes for peptides with altered lengths. These findings highlight the difference between bacterial and fungal NRPS mechanisms and provide a framework for the enzymatic synthesis of non-natural nonribosomal peptides.

Beauveria bassiana is a filamentous fungus known to produce 1-5, and the enzymes responsible for the synthesis of these compounds have been reported 9,10 . The beauvericin and bassianolide synthetases (BbBEAS and BbBSLS) share significant sequence homology (66% identity and 79% similarity) and the same domain organization (Fig. 1b). In spite of the high sequence similarity, BbBEAS catalyses recursive head-to-tail condensation of three dipeptidol monomers, while BbBSLS condenses four monomers. Thus, these enzymes constitute a promising model to understand the product elongation and length control mechanism by fungal iterative NRPSs. The gene sequences of several other fungal NRPSs with the domain organization of C 1 -A 1 -T 1 -C 2 -A 2 -MT-T 2a -T 2b -C 3 (Fig. 1b) have also been reported 11 . The common architecture of these NRPSs suggests that they share a general assembly rule.
Previous studies on bacterial iterative NRPSs, such as those involved in the biosynthesis of tyrocidine and gramicidin S, revealed that these enzymes use an oligomerization approach for chain elongation and length control through the C-terminal thioesterase (TE) domain. They oligomerize a monomer intermediate formed by upstream condensation domains and catalyse the subsequent head-to-tail cyclization for product release 12,13 . However, TE or a homologous domain is absent in fungal iterative NRPSs such as BbBEAS and BbBSLS. Based on the conserved signature regions, it was generally proposed that A 1 of BbBEAS and BbBSLS activates D-Hiv, while A 2 recognizes L-Phe and L-Leu, respectively. The activated D-Hiv is transferred to T 1 , and MT methylates the A 2 -activated amino acid 4 . However, the roles of several key domains in these fungal NRPSs remain unknown, including the twin T 2 domains and three C domains. More importantly, the product assembly process by fungal NRPSs is poorly understood.
In this work, we report that BbBEAS and BbBSLS adopt an alternate incorporation strategy to assemble the products. The two precursors, D-Hiv and N-Me-L-Phe/N-Me-L-Leu, are alternately incorporated into the extending depsipeptide chain by C 2 and C 3 . The C 3 domain controls the product length and cyclizes the full-length depsipeptide chain to form the final products. Products with altered chain lengths are obtained by swapping the C 3 domain, providing a domain swapping approach to reprogramming these enzymes for new molecules.

Results
Purification and reconstitution of BbBEAS and BbBSLS. We have recently expressed BbBEAS and BbBSLS and achieved highyield production of 1-5 (33.8 mg l À 1 for 1-4 and 21.7 mg l À 1 for 5) in Saccharomyces cerevisiae BJ5464-NpgA 14 . To decode the functions of the catalytic domains in BbBEAS (352 kDa) and BbBSLS (348 kDa), we first expressed and purified these giant enzymes from S. cerevisiae BJ5464-NpgA. As shown in Supplementary Fig. 1, both enzymes were expressed in the yeast and obtained in pure form (0.8 mg l À 1 for both BbBEAS and BbBSLS). Reaction of C-His 6 -tagged BbBEAS with adenosine triphosphate (ATP), S-adenosylmethionine (SAM), L-Phe and D-Hiv yielded 1 (trace i, Fig. 1c), which was confirmed by electrospray ionisation mass spectrometry (ESI-MS) ( Supplementary Fig. 2), high-resolution electrospray ionisation mass spectrometry (HR-ESI-MS) ( Supplementary Fig. 3) and a comparison with the authentic sample prepared and fully characterized in our previous work (trace ii, Fig. 1c) 14 . Similarly, BbBSLS was found to synthesize 5 (traces iii and iv, Fig. 1c, Supplementary Fig. 2 and Supplementary Fig. 4) from L-Leu and D-Hiv 14 . Formation of 1 and 5 allowed direct functional characterization of BbBEAS and BbBSLS. These results indicated that both BbBEAS and BbBSLS were functionally expressed in S. cerevisiae and their catalytic activity can be reconstituted in vitro, providing a great platform to further study the catalytic domains in these modular NRPSs.
Roles of the twin T 2 domains and the biosynthetic model. Two possible biosynthetic models were proposed for BbBEAS and other similar NRPSs: linear (alternate incorporation of the precursors) and parallel (oligomerization of a monomer synthesized from the precursors) (Fig. 2a) 4 . In the linear model, T 1 and T 2a /T 2b are alternately used for tethering the growing depsipeptide chain for addition of the D-hydroxycarboxylic acid and N-Me-L-amino acid units. T 2a and T 2b have the same function and only one of them is required. In contrast, in the parallel model, one of the twin T 2 domains is proposed to hold the synthesized dipeptidol monomer after it is synthesized at the other T 2 domain 4 . Additional monomers are added to the T 2b -or T 2a -linked monomer through oligomerization to form the dimer and subsequently the trimer (1) or tetramer (5). In this parallel model, both twin T 2 domains are required. Bacterial iterative NRPSs adopt a product assembly process that is more like the parallel model in Fig. 2a, except that the growing product chain is linked to the TE instead of a T domain. To understand what model is used by fungal iterative NRPSs, it is necessary to reveal the roles of the twin T 2 domains in BbBEAS and BbBSLS.
Sequence analysis revealed that the twin T 2 domains in both BbBEAS and BbBSLS contain the conserved motif (I/L)GG(D/H)SL, in which the key serine (Ser or S) residue serves as the phosphopantetheine attachment site ( Supplementary  Fig. 5). We first examined how inactivation of T 2a and/or T 2b affects the biosynthesis. Mutation of S2591 in T 2a to alanine (A) did not abolish the production of beauvericins (trace i, Fig. 2b), but the titre (0.7 ± 0.1 mg l À 1 ) calculated from three replicates was significantly lower than that (33.8±1.4 mg l À 1 ) by wild-type BbBEAS. In contrast, the T 2b mutant BbBEAS-S2688A produced beauvericins (trace ii, Fig. 2b) with a titre of 23.0±1.0 mg l À 1 . When both key Ser residues were mutated, no products were synthesized by BbBEAS-S2591A/S2688A (trace iii, Fig. 2b).
We next tested how removal of the twin T 2 domains from BbBEAS affects beauvericin biosynthesis using a dissection and co-expression approach. BbBEAS was dissected at different positions and the fragments were functionally expressed in S. cerevisiae BJ5464-NpgA (traces i-iv, Fig. 2c). Using this system, we removed T 2a from BbBEAS by co-expressing C 1 -A 1 -T 1 -C 2 -A 2 -MT and T 2b -C 3 in the yeast. Liquid chromatography-mass spectrometry (LC-MS) analysis revealed that beauvericins were produced at 5.0 ± 1.2 mg l À 1 (trace v, Fig. 2c) in the absence of T 2a . This was validated by the construction of an intact enzyme BbBEAS-DT 2a , which produced beauvericins at 0.5 ± 0.1 mg l À 1 (trace vi, Fig. 2c), confirming that the dissection and co-expression approach is effective and reliable. To remove T 2b , C 1 -A 1 -T 1 -C 2 -A 2 -MT-T 2a and standalone C 3 were co-expressed in the yeast, yielding 1-4 at 13.0 ± 3.9 mg l À 1 (trace vii, Fig. 2c). When both T 2 domains were removed, no products were detected (trace viii, Fig. 2c). These results were consistent with those from Ser mutations, which confirmed that only one of the twin T 2 domains is required for beauvericin biosynthesis.
Similarly, we also dissected BbBSLS before and after T 2a , and confirmed that the fragments can be co-expressed in the yeast to reconstitute bassianolide biosynthesis (traces i and ii, Fig. 2d). Removal of T 2a (trace iii, Fig. 2d) or T 2b (trace iv, Fig. 2d) did not abolish the production of 5, although the titre by the former was much lower (2.9 mg l À 1 versus 10.6 mg l À 1 ). This further confirmed that T 2a plays a major role in the biosynthetic process as inactivation or removal of this domain significantly lowered the efficiency of the product assembly line. By contrast, T 2b is less important in the biosynthetic process and may serve as an auxiliary T domain to contribute to the overall efficiency. Because the presence of both twin T 2 domains is not necessary for the biosynthesis, the possibility of oligomerization (parallel model) in chain elongation can be ruled out. Thus, it is concluded that 1-5 are assembled through an alternate incorporation approach (linear model, Fig. 2a) by the fungal NRPSs.
The condensation activity of the C 1 and C 2 domains. Another mystery of BbBEAS and BbBSLS is the unknown roles of the three C domains in the biosynthetic process. We analysed the C domains in four reported fungal iterative NRPSs. As shown in Fig. 3a, the C 2 domains of these fungal NRPSs have the conserved HHxxxDG motif 15 . It was generally believed that the second histidine (H) in this motif serves as a general base for the condensation in most NRPSs, while aspartic acid (D) plays an important role in the structure of C domains 16,17 . The first H residue in this motif is not highly conserved, as some C domains such as the C 3 domains shown in Fig. 3a have an S at this position. The exact function of the G residue in this motif is not clear. Compared to C 2 and C 3 , the C 1 domains of these fungal NRPSs are more divergent and C 1(BbBEAS) does not have the essential H residue. As the C-terminal condensation domain, C 3 is likely involved in the final cyclization and concomitant release of the peptide chain from the end of the NRPS assembly lines. The remaining two condensation domains, C 1 and C 2 , are possibly responsible for forming the ester and amide bonds in the product assembly line, respectively. We first tested the condensation activity of C 2 . C 2(BbBEAS) was overexpressed and purified from E. coli BL21(DE3) ( Supplementary Fig. 6), and reacted with D-Hiv-SNAC (S1) (SNAC: N-acetylcysteamine) 18 and N-Me-L-Phe-SNAC (S2). As shown in Fig. 3b, D-Hiv-N-Me-L-Phe-SNAC (S3) was synthesized by C 2(BbBEAS) , and then spontaneously cyclized to form cyclo-D-Hiv-N-Me-L-Phe (10, Fig. 3b). In contrast, this domain could not form an ester bond as the reaction of S1 and (D-Hiv-N-Me-L-Phe) 2 -SNAC (S4) with C 2(BbBEAS) did not yield any products ( Supplementary  Fig. 7). Consequently, the role of C 2 was determined to be forming the amide bond in the assembly process of NRPs.
We next attempted to understand whether C 1 forms the ester bond. C 1(BbBEAS) was overexpressed and purified from E. coli BL21(DE3) (Supplementary Fig. 6). Incubation of C 1(BbBEAS) with S1 þ S2 or S1 þ S4 did not yield any products (Fig. 3c,d). Because  Beauvericin C (4)  Fig. 3e) at 24.2 ± 1.0 mg l À 1 , indicating that the mutation did not affect the biosynthetic process. Similarly, mutation of H170 and D174 in the conserved motif of C 1 of BbBSLS did not interfere with bassianolide biosynthesis (traces ii and iii, Fig. 3e), indicating that mutation of these functionally or structurally important residues does not influence the biosynthesis of 5. These results clearly indicate that C 1 has no condensation activity. To further probe the role of C 1 in beauvericin biosynthesis, we constructed a truncated version of BbBEAS by removing C 1 . No beauvericins were produced by BbBEAS-DC 1 . Addition of standalone C 1(BbBEAS) into the yeast did not recover beauvericin biosynthesis. SDS-PAGE analysis revealed that BbBEAS-DC 1 (308 kDa) was not expressed and the attempt to purify His 6 -tagged BbBEAS-DC 1 using Ni-NTA chromatography from the yeast host failed. Similarly, BbBSLS-DC 1 could not be expressed in the yeast either. Thus, removal of C 1 resulted in unsuccessful expression of the truncated enzymes, suggesting that the presence of C 1 is critical for the expression of BbBEAS and BbBSLS. Parallel model Amide bond Ester bond )   8  10  12  14  16  18   6  8  10  12  14  16  18  15 17.5 20 The condensation activity of the C 3 domain. To understand how the ester bond is formed, we next investigated the condensation activity of C 3 . We first removed this domain to yield a truncated variant of BbBEAS. Expression of BbBEAS-DC 3 yielded no products (trace i, Fig. 4a). In trans addition of standalone C 3(BbBEAS) into S. cerevisiae BJ5464-NpgA reconstituted the synthesis of beauvericins (26.5 ± 1.3 mg l À 1 , trace ii, Fig. 4a). This suggests that C 3 plays an essential role in beauvericin biosynthesis. We next examined the effect of mutation of the conserved H on beauvericin biosynthesis. BbBEAS-H2901A failed to produce beauvericins (traces iii, Fig. 4a), indicating that the condensation activity of C 3 is required for the biosynthetic process.
To gain more insight into the role of C 3 , C-His 6 -tagged BbBEAS-DC 3 Table 1) as well as a comparison with the chemically prepared standards (traces ii and iii, Fig. 4b). 10 can be hydrolysed in 0.1 N NaOH to yield 11. Production of 10 and 11 indicated that the biosynthetic process stopped after the formation of the monomer. The same products were observed from the reaction of purified C-His 6 -tagged BbBEAS-H2901A (trace iv, Fig. 4b), confirming that mutation of H2901 did cause the loss of the condensation ability of C 3 .
The same experiments were applied to BbBSLS. BbBSLS-DC 3 and BbBSLS-H2861A failed to synthesize 5 (traces i and iii, Fig. 4e). In trans addition of standalone C 3(BbBSLS) recovered bassianolide biosynthesis (traces ii and iv, Fig. 4e). In vitro reactions of ATP, SAM, D-Hiv and L-Leu with purified BbBSLS-DC 3 (trace i, Fig. 4f) or BbBSLS-H2861A (trace ii, Fig. 4f) did not yield 5, but the linear (12) and cyclic D-Hiv-N-Me-L-Leu (13) (traces i-iv, Fig. 4f), respectively. Addition of C 3(BbBSLS) into the reaction system reconstituted bassianolide biosynthesis (trace ii, Fig. 4c). These results further confirmed that C 3 plays an essential role in forming the ester bond during the biosynthesis of 1-5. Removal or inactivation of C 3 did not affect the functions of the upstream domains, but stopped the biosynthetic process at the monomer stage.
Identification and reprogramming of chain length control. With the understanding of the roles of the twin T 2 and three condensation domains, we next attempted to identify the product-length-controlling domain(s) by constructing a series of chimeric enzymes. Since module 1 of BbBEAS and BbBSLS are exchangeable without affecting the product profiles 19 , we tested the effects of swapping the C-terminal domains on the product formation. We first constructed an enzyme C 1 -    Fig. 9). The structure was established as a cyclic tetramer (Fig. 5b) based on the one-dimensional (Supplementary Table 1) and two-dimensional NMR data ( Supplementary Fig. 10). This was further confirmed by chemical hydrolysis of 15 in 0.1 N NaOH, which yielded the monomer 11 ( Supplementary Fig. 11). We then made C 1 - . Both enzymes produced 15 as the sole product (traces iii and iv, Fig. 5a). These results revealed that replacement of C 3(BbBEAS) with C 3(BbBSLS) is sufficient to reprogramme chain length control in BbBEAS. The same results were obtained for BbBSLS (traces i-iv, Supplementary Fig. 12) as the only product. Therefore, C 3 was unambiguously identified as the chain-length-controlling domain. C-terminal TE, R, Cy or C is often involved in the cyclization and concomitant release of the peptide chain from the end of the NRPS assembly lines 20 . Since no TE, Cy or R domains are present in BbBEAS and BbBSLS, we considered that C 1 and C 3 might be involved in the macrocyclization. To probe the cyclization activity and specificity of C 3 , three depsipeptidyl-SNACs that mimic the linear monomer, dimer and trimer intermediates tethered to T 2a or T 2b were reacted with C 3(BbBEAS) . S3 is unstable and can undergo quick spontaneous cyclization to yield 10 in the reaction buffer (traces i and ii, Fig. 5d). Addition of C 3(BbBEAS) into the system did not cause observable changes in the formation rate of 10 (trace iii, Fig. 5d). The dimer substrate S4 is stable in the buffer (trace iv, Fig. 5d), but was not cyclized by C 3(BbBEAS) to yield 16 (trace v, Fig. 5d). The trimer substrate (D-Hiv-N-Me-L-Phe) 3 -SNAC (S6) mimics the full-length intermediate. This substrate is stable in the reaction buffer (trace vi, Fig. 5d). Incubation of S6 with C 3(BbBEAS) yielded 1 (trace vii, Fig. 5d), while C 3(BbBEAS-H2901A) failed to cyclize it (trace viii, Fig. 5d). The same reactions were applied to C 1(BbBEAS) but no cyclization products 16 and 1 were detected. These in vitro reactions further confirmed that C 3 catalysed the macrocyclization in beauvericin biosynthesis. Mutation of the active site residue H in C 3(BbBEAS) to A abolished its macrocyclization activity, indicating that this domain uses the same active site for the condensation and macrocyclization, both leading to the formation of an ester bond (intermolecular or intramolecular) between the carboxyl of L-Phe and hydroxyl of D-Hiv. Moreover, C 3 only cyclizes the mature depsipeptide intermediate. This property is critical for chain length control, which also explains why 10 and 16 are not produced by the beauvericin-producing strain B. bassiana and the yeast strain that expresses BbBEAS.
In vitro total biosynthesis of 1 using the C 2 and C 3 domains.
Our results revealed that C 2 and C 3 work collaboratively to generate a linear full-length intermediate that is subsequently cyclized and released by C 3 . We next attempted to use these two domains for in vitro total biosynthesis of 1 from the beginning precursors. To this end, we reacted C 2(BbBEAS) and C 3(BbBEAS) with the two mimicking substrates S1 and S2, while the control contains the same components except the two domains were inactivated. The reactions were subjected to LC-MS analysis. As shown in Fig. 6a, there is a small product peak at 25.8 min that had a [M þ H] þ peak at m/z 642 ( Supplementary  Fig. 2). Extraction of the ion chromatogram at m/z 642 (i, Fig. 6a) from the negative control (left panel) and the reaction (right panel) revealed that this product was only formed in the reaction, which has the same molecular mass and retention time (Fig. 4d) as S4. The extracted ion chromatogram (EIC) at m/z 784 clearly showed the synthesis of 1 (ii, Fig. 6a). Similarly, EICs at m/z 262, 641 and 903 indicated the formation of 10 (iii), 14 (iv) and S6 (v) in the reaction mixture. We further enlarged the high-performance liquid chromatography (HPLC) traces of the negative control (i, Fig. 6b), the reaction (ii, Fig. 6b) and the standard of 1 (iii, Fig. 6b), which clearly revealed that 1 was synthesized from the two beginning precursors S1 and S2 by the two isolated domains. Furthermore, the peak of S6 was also observed, which showed the same retention time as the extracted ion peak shown in trace v of Fig. 6a. These results indicated the success of in vitro total biosynthesis of 1 by C 2 and C 3 and showed a series of biosynthetic intermediates or their hydrolysed products.

Discussion
Fungal NRPs represent an important group of bioactive natural products. BbBEAS and BbBSLS are two fungal iterative NRPSs that are involved in the biosynthesis of the anticancer NRPs 1-5. However, the assembly process of these cyclooligomer depsipeptides is unclear, largely due to the poorly understood domains including T 2a , T 2b , C 1 , C 2 and C 3 in these modular enzymes. We used a combination of enzyme dissection, domain swapping, site-directed mutagenesis and in vitro enzymatic reactions to study BbBEAS and BbBSLS. This work elucidates fungal NRPSs' chain elongation and length control strategy. Highly consistent results were obtained from both BbBEAS and BbBSLS, suggesting that this family of fungal iterative NRPSs follows a general biosynthetic mechanism, which is different from the approach used by bacterial iterative NRPSs. A typical NRPS module contains a C domain, an A domain and a T domain for chain elongation. Co-existence of two T domains in module 2 of fungal iterative NRPSs not only represents an interesting structural feature, but also raises questions about the roles of these T domains in fungal NRP biosynthesis. There are several examples of twin carrier proteins in a megasynthase. For example, it was previously reported that module 6 of the leinamycin polyketide synthase from Streptomyces atroolivaceus S-140 contains twin acyl carrier protein (ACP) domains that are separated by a MT domain. Either is sufficient for the biosynthesis, and ACP 6-2 is preferred 21 . In our work, we found that T 2a plays a major role in the formation of the NRPs. Two possible biosynthetic models have been previously proposed to explain the biosynthetic process of fungal NRPs based on how the depsipeptide chain is elongated and how the twin T 2 domains are involved in the assembly process. We specifically mutated the key Ser residue in these T domains that is required for the 4 0 -phosphopantetheinylation. Inactivation of either T 2 domain did not abolish the formation of the corresponding NRPs, but affected the yield to different extents. Similar results were observed when one of the T 2 domains was removed, providing solid evidence against the parallel model (Fig. 2a), which requires the functions of both T 2a and T 2b . Thus, it is hypothesized that the biosynthesis of 1-5 proceeds through the linear model (Fig. 2a). This was confirmed by the in vitro reactions of C 2(BbBEAS) and C 3(BbBEAS) , which demonstrated that C 2 forms the amide bond and C 3 catalyses the synthesis of the ester bond. Co-reactions of C 2(BbBEAS) and C 3(BbBEAS) with D-Hiv-SNAC and N-Me-L-Phe-SNAC reconstituted the in vitro biosynthesis of 1 with only two condensation domains. Furthermore, some of the intermediates or hydrolysis products were observed, including cyclo-D-Hiv-N-Me-L-Phe, (D-Hiv-N-Me-L-Phe) 2 -SNAC, (D-Hiv-N-Me-L-Phe) 2 -D-Hiv (hydrolysis product) and (D-Hiv-N-Me-L-Phe) 3 -SNAC, which provides direct evidence for the alternate incorporation approach described in the linear biosynthetic model (Fig. 2a). C 3 is a crucial domain that integrates three functions, including condensation, chain length control and macrocyclization. While it acts like normal condensation domains to form the ester bond in the depsipeptide chain, this domain is actively involved in chain elongation and catalyses the macrocyclization of the mature intermediate for product release. It is different from C T domains in fungal noniterative NRPSs that only perform cyclization 22 and Cy domains that form oxazoline or thiazoline rings using the D residues in the conserved motif DXXXXD 23,24 . Bacterial iterative NRPSs typically use a C-terminal TE domain to cyclize and release the final products. The enterobactin synthetase is such an enzyme whose TE plays a key role in the oligomerization 25 . The monomer intermediate is transferred from the T domain of EntF (C-A-T-TE) to the active site Ser residue of the TE, which allows the T domain to be used for the formation of the next monomer. The TE catalyses the oligomerization and holds the growing peptide chain until it reaches the full length for macrocyclization. A similar TE was observed in the tyrocidine 12 and gramicidin NRPSs 13 . It was also reported that cyclooligomerization can be catalysed through ATP-dependent condensation reactions by NRPS-independent siderophore synthetases, such as DesD 26 , PubC 27 and BibC 28 that participate in the biosynthesis of desferrioxamine, putrebactin and bisucaberin, respectively.
Here we show that fungal iterative NRPSs use a different strategy for chain elongation and product length control. Bacterial NRPSs use an oligomerization approach through their C-terminal TE for product chain elongation. The cyclooligomerization by bacterial iterative NRPSs involves acylation and deacylation of the active site serine residue of the C-terminal TE. The monomer intermediate is formed by upstream domains and transferred from a T domain to the Ser of TE. Additional units of the monomer are then added to the monomer-O-TE intermediate to elongate the peptide chain to the full length for product cyclization and release. Therefore, bacterial iterative NRPSs oligomerize a monomer unit that is synthesized from the precursors for chain elongation, and the growing oligomer intermediate is formed at and always tethered to the TE. In contrast, fungal iterative NRPSs use an alternate incorporation approach to extend the peptide chain. The growing depsipeptide chain in the biosynthesis of 1-5 swings between T 1 and the twin T 2 domains. The monomer is not used as a unit for chain elongation at all. C 3 needs to work with the other condensation domain (C 2 ) to alternately incorporate the two precursors (D-Hiv and N-Me-L-Phe or N-Me-L-Leu). Therefore, bacterial iterative NRPSs adopt a product assembly process that is more like the parallel model in Fig. 2a, while fungal iterative NRPSs use a linear biosynthetic route.
In the linear model (Fig. 2a), C 3(BbBEAS) forms an ester bond between T 1 -tethered D-Hiv and T 2a -or T 2b -tethered D-Hiv-N-Me-L-Phe and (D-Hiv-N-Me-L-Phe) 2 in beauvericin biosynthesis, while C 2 catalyses the formation of an amide bond between T 2a -or T 2b -tethered N-Me-L-Phe and T 1 -tethered D-Hiv, D-Hiv-N-Me-L-Phe-D-Hiv and (D-Hiv-N-Me-L-Phe) 2 -D-Hiv. C 3(BbBSLS) has the same function except that N-Me-L-Leu is used. Both C 2 and C 3 work collaboratively to elongate the depsipeptide chain. Once C 2 catalyses the last condensation step to yield the full-length depsipeptide chain, C 3 acts as a decision maker to determine and inform the biosynthetic machinery of whether further elongation is required. For instance, when a hexadepsipeptide intermediate is synthesized, C 3(BbBEAS) will shut down the elongation line and perform the macrocyclization. Instead, C 3(BbBSLS) will continue the elongation to get an octadepsipeptide intermediate and then conduct the macrocyclization and product release. When C 3(BbBEAS) was substituted for the C 3 in BbBSLS, it continued to condense D-Hiv and the hexadepsipeptide intermediate (D-Hiv-N-Me-L-Phe) 3 , and C 2(BbBEAS) will continue to form an additional amide bond to get an octadepsipeptide.

Cyclization of this intermediate yielded the new product 15.
Similarly, substitution of C 3(BbBSLS) with its counterpart in BbBEAS switched BbBSLS from an octadepsipeptide synthetase to a hexadepsipeptide synthetase and yielded 8. Thus, C 2 is flexible and can catalyse extra or fewer condensations according to the 'command' of C 3 . While C 3 is strict with the number of condensation, it is flexible enough to condense 'unnatural' precursors. Consequently, reprogramming of BbBEAS and BbBSLS can be conveniently and readily achieved by swapping the C 3 domain. Our work thus provides an unprecedented tool for engineering fungal iterative NRPSs to yield 'unnatural' cyclooligomer depsipeptides with varied chain lengths. This work also presents in vitro total biosynthesis of a fungal NRP using only two condensation domains.
The gene fragments C 1(bbBeas) , C 2(bbBeas) , C 3(bbBeas) , C 3(bbBsls) and MT (bbBeas) were amplified by PCR from the genomic DNA of B. bassiana ATCC 7,159 with Phusion High-Fidelity DNA Polymerase with specific primers (Supplementary Table 2). These gene fragments were ligated into the cloning vector pJET1.2 to yield five plasmids including pFC1, pFC62, pFC2, pFC9 and pZJ134. The gene fragment C 3(bbBeas-H2901A) was amplified from pDY145 and ligated into pJET1.2 to yield pFC44. These plasmids were confirmed by digestion checks and gene sequencing. The C 1(bbBeas) , C 3(bbBsls) and MT (bbBeas) inserts were excised from pFC1, pFC9 and pZJ134 with NdeI and BamHI and ligated into pET28a between the same sites to generate pFC3, pFC11 and pJCZ21, respectively. The C 2(bbBeas) insert was excised from pFC62 with NdeI and HindIII and ligated into pET28a between the same sites to generate pFC63. The C 3(bbBeas) and C 3(BbBEAS-H2901A) inserts were excised from pFC2 and pFC44 with NheI and BamHI and ligated into pET28a between the same sites to generate pFC4 and pFC46, respectively.
The plasmids constructed in this work are shown in Supplementary Table 3.
Analysis of the products of the engineered yeast strains. The NRPSs were expressed in S. cerevisiae BJ5464-NpgA. The correct transformants were selected by autotrophy of uracil and/or tryptophan. Yeast strains harbouring one plasmid were cultured in 50 ml of SC-Ura (or -Trp) dropout medium (6.7 mg l À 1 yeast nitrogen base; 20 mg l À 1 glucose; 0.77 mg l À 1 -Ura or 0.74 mg l À 1 -Trp dropout supplement) at 30°C with shaking at 250 rpm. For co-expression experiments, -Trp/-Ura dropout was used. After the OD 600 value reached 0.6, an equal volume of YP medium (10 mg l À 1 yeast extract; 20 mg l À 1 peptone) was added, and the cultures were maintained under the same conditions for an additional 3 days. The cultures were then extracted three times with 100 ml of ethyl acetate and subjected to analysis on an Agilent 1200 HPLC (at 210 nm) coupled with an Agilent 6130 single quadrupole mass spectrometer. The product titres were calculated from three independent experiments based on the standard curves of purified compounds.
Purification and structural characterization of 8 and 15. To isolate the two products from reprogrammed BbBEAS and BbBSLS, the corresponding cultures were scaled up to 2 l and grown at 30°C with shaking at 250 rpm for 72 h. The ethyl acetate extracts were dried under reduced pressure and subjected to MCI column chromatography, successively eluted with a gradient of methanol-water (0:100, 20:80, 50:50 and 100:0, v/v). The fractions containing the target compounds were further separated by HPLC, eluted with a gradient of acetonitrile-water (80-100% over 20 min) at a flow rate of 1 ml min À 1 , to yield 8 (10.1 mg) and 15 (2.5 mg). The purified compounds were identified based on the spectral data.
Chemical preparation of substrates and intermediate products.
Beauvericins (1-4) and bassianolide (5) were extracted with ethyl acetate from 5 l of fermentation broths of S. cerevisiae BJ5464-NpgA/pDY37 and S. cerevisiae BJ5464-NpgA/ pDY42, respectively. After evaporation of the solvent, the crude extracts were hydrolysed in 20 ml of acetonitrile-water (1:1) containing 0.1 N NaOH for 48 h at 40°C with stirring. The resultant hydrolytic products were extracted by ethyl acetate, loaded on a silica gel 60 open column, and eluted with a gradient of acetone-hexanes (50, 70 and 100%, v/v) and methanol. The monomer (11 or 12)containing fractions were purified by HPLC, washed with 40% acetonitrile-water at a flow rate of 1 ml min À 1 to yield 71.2 mg of 11 and 51.6 mg of 12.
A mixture of 1-ethyl-3-(3-dimethyllaminopropyl) carbodiimide hydrochloride (0.1 mmol) and hydroxybenzotriazole (0.1 mmol) was added into 15 ml of tetrahydrofuran containing 0.1 mmol 11 or 12. After stirring the resulting mixture for 1 h at 40°C, K 2 CO 3 (0.05 mmol) was added, and the reaction was stirred for overnight at 40°C. The reaction was then stopped and concentrated by rotary evaporation. The resultant cyclized products 10 and 13 were purified by HPLC. A gradient of acetonitrile-water (5-60% over 30 min) was programmed at a flow rate of 1 ml min À 1 and 17.6 mg of 10 and 12.2 mg of 13 were purified from the respective reactions.
To prepare D-Hiv-N-Me-L-Phe-SNAC (S3), 11 (0.1 mmol) and SNAC (0.12 mmol) were added to 1 ml of dimethylformamide in a 10-ml round flask and cooled down to 0°C. The solution was then treated with diphenylphosphorylazide (0.15 mmol) and triethylamine (0.2 mmol). The reaction mixture was stirred for 3 h before the reaction was stopped and concentrated by rotary evaporation. The resultant monomer-SNAC was purified by HPLC. A gradient of acetonitrile-water (5-90% over 30 min) was programmed at a flow rate of 1 ml min À 1 to yield 7.7 mg of S3. D-Hiv was purchased from Sigma-Aldrich (St Louis, USA), and (D-Hiv-N-Me-L-Phe) 2 and (D-Hiv-N-Me-L-Phe) 3 were purchased from the Chinese Peptide Company (Hangzhou, China), which were used to synthesize D-Hiv-SNAC (S1), (D-Hiv-N-Me-L-Phe) 2 -SNAC (S4) and (D-Hiv-N-Me-L-Phe) 3 -SNAC (S6) using the same method for S3.
To prepare N-Methyl-L-Phe-SNAC (S2), L-Phe-SNAC was synthesized first. t-Butyloxy carbonyl (Boc)-L-Phe (1 mmol), N,N-dicyclohexylcarbodiimide (1 mmol) and 1-hydroxybenzotriazole (1 mmol) were dissolved in 15 ml of trifluoroacetic acid (TFA), followed by adding N-acetylcysteamine (1 mmol). After stirring the resulting solution for 45 min at 25°C, K 2 CO 3 (0.5 mmol) was added and the reaction mixture was stirred for an additional 3 h at 25°C. After filtration, the solvent was removed in vacuo. The resulting residue was dissolved in ethyl acetate and washed once with an equal volume of 10% aqueous NaHCO 3 . The organic layer was dried by MgSO 4 , filtered and concentrated in vacuo. The crude product was subjected to silica gel column chromatography, eluted with 4% (v/v) MeOH-CHCl 3 , to afford Boc-L-Phe-SNACs. Boc group was removed by dissolving Boc-L-Phe-SNAC in 50% TFA/CH 2 Cl 2 and stirring at 25°C for 1 h. After removing solvent, the residue was taken up in a minimal volume of CH 2 Cl 2 and precipitated with ether. The resulting solid was washed twice with ether and dried to afford L-Phe-SNAC.
A typical methylation reaction of L-Phe-SNAC (100 ml) consisted of 6.4 mM MT (BbBEAS) , 0.8 mM L-Phe-SNAC and 2.4 mM SAM in 100 mM Tris-HCl buffer (pH 7.5). The reaction mixtures were incubated at 25°C for 30 min and then quenched with MeOH (50 ml). The mixtures were briefly vortexed and centrifuged at 15,000 rpm for 5 min to remove the precipitated protein before the samples were injected into LC-MS for analysis. The supernatants were analysed by HPLC under 235 nm, eluted with an increasing gradient of acetonitrile (10-15%) in H 2 O containing 0.1% TFA with a flow rate of 1 ml min À 1 . Purification of S2 was carried out using the same HPLC method.
In vitro enzymatic studies. For a typical in vitro NRPS activity assay, a 400 ml reaction contained 50 mM Tris-HCl buffer (pH 8.0), 2 mM NRPS (or dissected fragments), 5 mM ATP, 25 mM MgCl 2 , 7.5 mM L-Leu or L-Phe, 2.25 mM D-Hiv and 3 mM SAM. After 3 h incubation at 25°C, the reactions were quenched with methanol for LC-MS analysis.
To test the condensation activity of C 2 , S1 (0.3 mM) and S2 (0.3 mM) or S4 (84 mM) were incubated with 30 mM C 2 domain in 1 ml of 50 mM Tris-HCl buffer (pH 7.8) at 25°C for 12 h.
To test the condensation activity of C 1 , S1 (0.3 mM) and S2 (0.3 mM) or S4 (84 mM) were incubated with 30 mM C 1 domain in 1 ml of 50 mM Tris-HCl buffer (pH 7.8) at 25°C for 12 h.
To test the macrocyclization activity of C 1 and C 3 , the SNAC substrates S3, S4 or S6 (75 mM) were, respectively, incubated with 30 mM C 1 or C 3 domain or their mutants in 100 ml of 50 mM Tris-HCl buffer (pH 7.8) at 25°C for 4 h.
Data availability. The authors declare that the data supporting the findings of this study are available within the article and its Supplementary Information Files. The GenBank accession numbers of BbBEAS and BbBSLS are ACI30655 and ACR78148, respectively. All other data supporting the findings of this study are available from the corresponding author on reasonable request.