Bacterial retrons encode phage-defending tripartite toxin–antitoxin systems

Retrons are prokaryotic genetic retroelements encoding a reverse transcriptase that produces multi-copy single-stranded DNA1 (msDNA). Despite decades of research on the biosynthesis of msDNA2, the function and physiological roles of retrons have remained unknown. Here we show that Retron-Sen2 of Salmonella enterica serovar Typhimurium encodes an accessory toxin protein, STM14_4640, which we renamed as RcaT. RcaT is neutralized by the reverse transcriptase–msDNA antitoxin complex, and becomes active upon perturbation of msDNA biosynthesis. The reverse transcriptase is required for binding to RcaT, and the msDNA is required for the antitoxin activity. The highly prevalent RcaT-containing retron family constitutes a new type of tripartite DNA-containing toxin–antitoxin system. To understand the physiological roles of such toxin–antitoxin systems, we developed toxin activation–inhibition conjugation (TAC-TIC), a high-throughput reverse genetics approach that identifies the molecular triggers and blockers of toxin–antitoxin systems. By applying TAC-TIC to Retron-Sen2, we identified multiple trigger and blocker proteins of phage origin. We demonstrate that phage-related triggers directly modify the msDNA, thereby activating RcaT and inhibiting bacterial growth. By contrast, prophage proteins circumvent retrons by directly blocking RcaT. Consistently, retron toxin–antitoxin systems act as abortive infection anti-phage defence systems, in line with recent reports3,4. Thus, RcaT retrons are tripartite DNA-regulated toxin–antitoxin systems, which use the reverse transcriptase–msDNA complex both as an antitoxin and as a sensor of phage protein activities. Retron-Sen2 of Salmonella Typhimurium encodes a toxin and a reverse transcriptase, which, together with the Sen2 multi-copy single-stranded DNA synthesized by the reverse transcriptase make up a tripartite toxin–antitoxin system that functions in anti-phage defence.

Reverse transcriptases were discovered in the 1980s within genetic elements called retrons 5,6 . Retrons are phylogenetically widespread 7 and contain a reverse transcriptase and a non-coding RNA, msrmsd. The reverse transcriptase uses the msd portion of msrmsd to produce a satellite msDNA molecule 1 (Fig. 1a). As the msd DNA is produced by the reverse transcriptase, the msd RNA template is degraded by ribonuclease H 8 (RNAse H). The product is usually a branched DNA-RNA hybrid in which the msd DNA and msr RNA are joined covalently through a 2′−5′ phosphodiester bond 9 (Fig. 1a). In some cases, the msd DNA is further separated from the msr RNA 10,11 . For Retron-Sen2 (also known as retron-ST85), this separation is performed by the housekeeping exonuclease VII 12 (Exo VII), which is encoded by xseA and xseB (Fig. 1a). In addition to the reverse transcriptase and msrmsd, retrons contain diverse, poorly characterized accessory genes 7 , which are not involved in msDNA biosynthesis 2 . The ability of retrons to produce large quantities of single-stranded DNA in situ has been exploited for genome editing 2,13,14 , but their natural functions have remained unknown, largely owing to the absence of retron-mediated growth phenotypes. growth at room temperature (Extended Data Fig. 1a). To exclude confounding effects, we reconstructed deletions of all genes related to Retron-Sen2 biosynthesis (rnhA, xseA, xseB, rrtT and msrmsd) and the accessory gene STM14_4640 in a clean STm background. All of these mutants-with the exception of ΔSTM14_4640-impaired growth below 25 °C ( Fig. 1b and Extended Data Fig. 1b) and, as previously reported 17 , under anaerobic conditions (Extended Data Fig. 1c,d). Similarly, all the mutants were impaired in synthesis or maturation of msDNA-Sen2, except for ΔSTM14_4640 17 (Extended Data Fig. 1e). Thus, perturbing msDNA-Sen2 biosynthesis impairs STm growth at low temperatures and under anaerobic conditions. We isolated and sequenced spontaneous suppressors that restored the growth of ΔrrtT, ΔxseA and Δmsrmsd mutants at 15 °C. All but one of twenty-nine suppressor mutations mapped to STM14_4640, and included frameshifts (14), nonsense (4) or missense (10) mutations (Fig. 1c). Consistently, deleting STM14_4640 in ΔxseA, ΔxseB or ΔrnhA mutants restored growth at 15 °C and in anaerobic conditions ( Fig. 1d and Extended Data Fig. 1f,g). We reasoned that in the absence of msDNA, the STM14_4640 protein inhibits growth at low temperature and under anaerobic conditions, and therefore named the gene retron cold-anaerobic toxin (rcaT).
To gain insight into the function of RcaT, we used AlphaFold2 18 to predict its structure. This revealed two distinct domains-one similar to nucleotide N-glycosidases and one composed of a winged helixturn-helix (Fig. 1e and Supplementary Table 1). We confirmed that RcaT is a soluble protein (Extended Data Fig. 1h). Amino acid substitutions that suppressed toxicity at 15 °C were located in both protein domains (D160, G197 and D296; Fig. 1c,e) and did not affect RcaT levels (Extended Data Fig. 1i-l). E107 is predicted to be in the catalytic centre of the N-glycosidase domain 19 , and mutating it to glutamine abolished RcaT toxicity (Extended Data Fig. 1j,l). N-glycosidase domains hydrolyse nucleosides and nucleotides 19 , suggesting that RcaT affects DNA or RNA.
Regardless of the specific target, RcaT acts as a bona fide toxin, since ectopically expressing RcaT, but not the inactive RcaT(D296V), inhibited growth of Escherichia coli (Fig. 1f). Growth was restored when expressing the intact Retron-Sen2 (p-retron; msrsmsd-rcaT-rrtT) (Fig. 1f), or when expressing msrmsd and RT-Sen2 in trans (Extended Data Fig. 2a). Thus, Retron-Sen2 constitutes a toxin-antitoxin (TA) system, in which msrmsd and RT-Sen2 are sufficient to counteract RcaT both natively in STm and when ectopically expressed in cis or in trans in E. coli.

Retron-RT and msDNA form the antitoxin unit
To delineate which retron component is the antitoxin (the reverse transcriptase, msrmsd RNA, or the msDNA), we constructed retrons lacking single components (p-retron-ΔrrtT, p-retron-Δmsrmsd, msrmsd mutant (p-retron-msrmsd mut ) and p-retron-ΔrcaT). msrmsd mut carries a point mutation in msr (msr G9T ), which abrogates msDNA production without affecting msrmsd RNA expression 9 . Additionally, we used ΔrnhA and ΔxseA/ΔxseB E. coli mutants to stop msDNA maturation at different steps. Deleting any of the retron components (except for rcaT) or any msDNA maturation gene, led to the same toxicity as overexpressing rcaT alone (Extended Data Fig. 2b,c). Thus, the antitoxin activity against RcaT requires all retron components and/or their msDNA product.
To assess how the retron antitoxin counteracts RcaT, we added a 3×Flag tag to rcaT in wild-type STm and antitoxin deletion mutants. RcaT protein levels did not increase substantially in the antitoxin mutants at 37 °C or 20 °C (Extended Data Fig. 2d,e), excluding any expression control of toxicity. We then tested whether RcaT is counteracted by interacting with the reverse transcriptase. We added a 3×Flag tag to the reverse transcriptase and immunoprecipitated both the tagged reverse transcriptase and RcaT at 20 °C or 37 °C to identify their interaction partners by mass spectrometry-based quantitative proteomics. RT-Sen2 and RcaT-Sen2 reciprocally pulled down each other in all strains at 20 °C (Fig. 2a,b) and the RcaT-RT-Sen2 interaction occurred independently of msDNA or the temperature at which the toxin is active (Extended Data Fig. 3a,b and Supplementary Table 2). Both RcaT-Sen2-Flag and RT-Sen2-Flag retained their function as toxin and antitoxin, respectively (Extended Data Fig. 3c,d), but tagging RcaT-Sen2 reduced the protein levels of the downstream-encoded reverse transcriptase, when compared with the wild type (Extended Data Fig. 3e). This explains the lower levels of reverse transcriptase enrichment when immunoprecipitating RcaT-Sen2-Flag (Extended Data Fig. 3b). Thus, RcaT-Sen2 and RT-Sen2 interact with each other, independently of msDNA or temperature.
Although RcaT and RT-Sen2 interact in the absence of msDNA, mature msDNA production is essential for antitoxin activity. Some reverse transcriptases from other retrons remain bound to their mature msDNA products 20,21 . To test whether RT-Sen2 interacts with msDNA-Sen2, we purified RT-Sen2-His protein while co-expressing msrmsd-Sen2 in E. coli BL21 (Extended Data Fig. 4a,b). Total DNA isolated from the purified RT-Sen2-His protein sample contained mature and unprocessed msDNA-Sen2 (Extended Data Fig. 4c,d). Therefore, RT-Sen2

Retrons contain cognate RT-toxin pairs
RcaT-containing retrons have been identified recently as the most abundant retron family in bacteria, with a high prevalence in Proteobacteria 4,7 . We searched for RcaT-containing retrons in fully sequenced genomes of isolated bacteria and in high-quality metagenome-assembled genomes 22 (MAGs). We identified 5,938 RcaT proteins in 11 diverse bacterial phyla, which clustered into 778 unique sequences (Fig. 2c). Around 95% of RcaT-encoding retrons from isolates were in Proteobacteria, but more than 70% of retrons from MAGs were in Firmicutes and 4% were in Melainabacteria, indicating that RcaT retrons are more prevalent across bacterial species than previously appreciated. On the basis of the chromosomal rcaT-rrt distance, we identified two subfamilies with distinct architectures: Sen2-like retrons (distance < 15 bp), in which msrmsd is upstream of rcaT, and Eco1-like retrons (distance > 120 bp), in which msrmsd is sandwiched between rcaT and rrt ( Fig. 2c and Supplementary Table 3). This split happened once in evolution, probably in Alphaproteobacteria, and retrons of both subfamilies have since spread horizontally-for example, E. coli strains carry diverse retrons across the tree.
We selected four E. coli strains containing diverse retrons (Eco9, Eco10, Eco3 and Eco1; Fig. 2c) to study the functional divergence of RcaT retrons. When perturbing the msDNA synthesis by deleting rnhA in E. coli carrying RcaT-Eco10, cells became sensitive not only to cold and anaerobic conditions (similar to those expressing RcaT-Sen2), but also at acidic pH (Extended Data Fig. 5a,b). We were unable to delete rnhA in E. coli NILS-16 23 carrying Retron-Eco9, because RcaT-Eco9 inhibits growth even at 37 °C, as discussed below. Conversely, Retron-Eco3 and Retron-Eco1 without msDNA did not inhibit growth in any of the tested conditions (Extended Data Fig. 5). Thus, retron TAs inhibit growth in different environments upon perturbing msDNA biosynthesis.
Retron reverse transcriptases specifically reverse transcribe their msrmsd template 24 , and delineating this specificity is key for using retrons in genetic engineering 2 . We noted a strong coevolution signal between reverse transcriptases and RcaT (Fig. 2d), in line with previous anecdotal reports for all retron reverse transcriptases and accessory proteins 7 . This coevolution, together with rare events in which the N-glycosidase domain of RcaT is fused with the reverse transcriptase (for example, Uniprot-A0A1I7IQG7), implied that RcaT-reverse transcriptase pairs are cognate and their physical interaction (Fig. 2a,b) is driving the antitoxin specificity. To further determine the component specificity of retrons, we made chimeric retrons. Among the five retrons we studied, RcaT-Sen2 and RcaT-Eco9 inhibited growth when overexpressed exogenously (Extended Data Fig. 5c). Although the Retron-Eco9 components retain only partial identity to their Retron-Sen2 counterparts (Extended Data Fig. 6a), the msDNA-Eco9 (Extended Data Fig. 6b) has similar biosynthesis dependencies to the msDNA-Sen2 (Extended Data Fig. 6c,d). We therefore swapped Retron-Sen2 and Retron-Eco9 components to assess the specificity of the interactions.
First, we evaluated whether the two reverse transcriptases could produce non-cognate msDNA by isolating msDNA from E. coli co-expressing PBAD-RT and Ptac-msrmsd plasmids, carrying components from Retron-Sen2, Retron-Eco9 or control (empty vector). Both RT-Sen2 and RT-Eco9 produced non-cognate msDNA (Extended Data Fig. 6e), although RT-Eco9 was slightly less efficient in using the Sen2 template. To assess whether all retron components could be exchanged, we tested which RcaT-RT-msDNA swaps retained antitoxin activity.      We made PBAD plasmids with binary combinations of RcaT and reverse transcriptases from Retron-Sen2 and Retron-Eco9. As expected, all combinations inhibited E. coli growth when msDNA was absent (Fig. 2e). We then co-expressed the RcaT-RT pairs with Ptac plasmids expressing msrmsd from Sen2 or Eco9, or with no msrmsd. Whereas any msDNA could activate the antitoxin activity in cognate RT-RcaT pairs, this did not work in non-cognate RT-RcaT combinations ( Fig. 2e and Extended Data Fig. 6f). Thus reverse transcriptases produce non-cognate msDNA, and the chimeric RT-msDNA complex is an active antitoxin, but this antitoxin can only inhibit its cognate toxin. Therefore, the RT-RcaT interactions are cognate within retrons, in agreement with them coevolving and interacting. By contrast, the msDNA sequence is partially interchangeable, but the RT-msDNA interaction itself is absolutely required to form an active antitoxin. Thus, RcaT-containing retrons encode new tripartite TAs in which a DNA component is part of the antitoxin unit formed by RT-msDNA. The RcaT-RT interaction provides specificity to the antitoxin unit, and the RT-msDNA interaction enables the antitoxin activity.

Systematic discovery of TA roles
Although TAs are ubiquitous in bacterial chromosomes, their physiological roles remain unknown and are intensely debated 25 . In an attempt to identify the role of our tripartite TA, we developed two fitness-based reverse genetics screens. TAC-TIC (Fig. 3a) can be used to identify genes that trigger or block the toxin activity of the TA studied. To survey for molecular triggers and blockers of TAs, we conjugated genome-wide E. coli single-gene overexpression libraries into strains carrying appropriate retron TA-expressing plasmids-in this case Retron-Sen2. Wild-type E. coli BW25113 carrying either an arabinose-inducible p-retron (PBAD-msrmsd-rcaT-rrtT (TAC)) or p-toxin (PBAD-rcaT (TIC)) plasmid was mated with the IPTG-inducible MOB (mobile plasmid) 26 and TransBac 27 libraries (Ptac-gene-X), by high-throughput conjugation on plates. After selection, 18,434 double-plasmid-bearing strains (9,217 for each screen) were grown in co-inducing conditions for the retron or its toxin and the library plasmid (Methods). For the TAC screen, to find triggers of Retron-Sen2 toxicity, we screened for strains that stopped growing upon co-induction of the E. coli gene and the retron, but grew normally upon induction of either alone (Fig. 3a). We identified 13 and 10 triggers from the MOB (Fig. 3b) and the TransBac (Fig. 3c) libraries, respectively, upon high trigger expression (high IPTG concentration). Fewer and slightly different triggers were identified by induction at lower IPTG concentration (Extended Data Fig. 7a,b). Despite the high reproducibility of individual screens (Extended Data Fig. 7c,d), the overlap between hits from two libraries was low (Extended Data Fig. 7e), reflecting stringent cut-offs and quality control (false negatives), quality of libraries (missing genes, plasmid mutations or cloning errors) and different trigger levels (for example, there are 15-20 copies per cell of MOB plasmids 26 , whereas there is only one copy of TransBac plasmids per cell 27 ).
To validate putative triggers, we selected 15 of the strongest triggers (Methods), sequenced the plasmid inserts, and conjugated them again with E. coli expressing either an empty vector, p-retron, p-retron-ΔrcaT or p-rcaT. All 15 triggers were benign when co-expressed only with the antitoxin (p-retron-ΔrcaT), but inhibited growth when expressed with the full retron (Extended Data Fig. 7f). Triggers activated RcaT only in the presence of the full retron and in varying degrees, depending on IPTG concentration (Extended Data Fig. 7g). Several triggers, especially the strong ones, were prophage-encoded genes (recE, tfaP, ymfH, RT-Eco1 and B21_03469; fold enrichment 4.6-11.6, 0.009 < P < 0.025, depending on the library and induction level; Supplementary Tables 4 and 5). Other triggers were part of the core E. coli genome, but have homologues in phages (dam and rdgC). All identified triggers are listed in Supplementary Table 6.
For the TIC screen, we reasoned that strains that could grow upon p-rcaT induction carried library plasmids with blockers of the RcaT

Fig. 3 | Toxin activation-inhibition conjugation (TAC-TIC) is a genetic screen
for discovery of TA triggers and blockers. a, Two systematic, arrayed, mobilizable E. coli gene overexpression libraries (Ptac-gene 1-X; library-plasmids 26,27 ) are conjugated with recipient strains carrying PBAD-controlled plasmids expressing a TA (PBAD-TA; msrmsd-rcaT-rrtT) or just the toxin (PBAD-T; rcaT). Inducing PBAD-T, but not PBAD-TA, inhibits growth. Co-inducing library plasmids carrying TA triggers leads to TA-mediated growth inhibition (TAC), whereas co-inducing library-plasmids carrying TA blockers alleviates toxin-mediated growth inhibition (TIC). b,c, TAC screen using IPTG-inducible plasmids from the MOB 26 (b) and TransBac 27 (c) libraries. Arrayed libraries (384-density format) were conjugated with an E. coli recipient carrying an arabinose-inducible p-retron-Sen2 plasmid. Transconjugants carrying both plasmids were selected, colony integral opacities were measured 44 , and fitness z-scores of strains were calculated on plates containing arabinose + high (1 mM) IPTG, or on control plates containing only high IPTG (Methods). Z-score differences per strain were derived by subtracting z-scores in control plates from experiment plates (n = 2; see Supplementary Tables 4 and 5 for all scores  and Supplementary Table 6 for functions of hits). Scores are shown for high-IPTG induction (low-IPTG induction is shown in Extended Data Fig. 7a,b). Chromosomal position refers to E. coli MG1655. The hit cut-off (dashed line), prophage gene fold enrichment (FE) and p values are shown in grey above the plots, and prophage or phage-related trigger genes are bold or underlined, respectively. d,e, TIC screen using the same library plasmids as in b,c. Conjugation was performed as in b,c, but with an E. coli recipient carrying a p-rcaT plasmid. Axes and data analysis as in b,c, but z-score differences were derived by subtracting experiment plates from control plates. Scores are shown for low-IPTG induction (high-IPTG induction is shown in Extended Data Fig. 8a,b).
Article toxicity (Fig. 3a). We identified 9 and 5 blockers from the MOB (Fig. 3d) and TransBac (Fig. 3e) libraries, respectively. As for the previous TAC screen, the data were reproducible, but most blockers were specific to the library and induction conditions (Extended Data Fig. 8a-e). We selected 11 strong blockers (Methods), sequenced the plasmids, and re-introduced them into E. coli expressing p-empty, p-rcaT, p-retron or p-retron-ΔrcaT. All tested blockers alleviated RcaT toxicity to different degrees (Extended Data Fig. 8f,g). The blockers were also enriched in prophage genes (racC, ydaW, yfjH, yjhC and dicC; fold enrichment >5, P < 0.01 for the MOB library and aggregated results; Supplementary  Tables 4 and 5). All blockers are listed in Supplementary Table 6. In summary, we developed a systematic approach to identify TA triggers and blockers that we used to study the tripartite TA Retron-Sen2. The hits were enriched in proteins of phage origin, prompting us to further investigate their underlying links to the retron.

Dam triggers the retron by methylating msDNA
The primary DNA methylase in E. coli is Dam, which methylates adenines in 5′-GATC-3′ duplexes 28 . Dam was the sole retron TA trigger that activated RcaT toxicity even without IPTG induction (Extended Data Fig. 7g). Dam homologues are present in other bacteria including STm, as well as in phages such as P1. Plasmids expressing STm-or P1-derived Dam triggered Retron-Sen2 (Extended Data Fig. 9a), suggesting that the Dam activity itself triggers Retron-Sen2.
Perturbing msDNA biosynthesis in STm activates the endogenous RcaT, inhibiting growth at 25 °C or lower temperatures. Overexpressing dam in STm phenocopied this rcaT-dependent cold sensitivity (Fig. 4a). Similarly, overexpressing dam in E. coli NILS-16 triggered Retron-Eco9 and inhibited growth even at 37 °C (Extended Data Fig. 9b). These data mean that RcaT-Eco9 is a potent toxin at all temperatures, explaining our inability to delete rnhA in this strain. Thus, retrons are triggered when Dam levels increase, which could occur during infection with methyltransferase-containing phages. To assess whether phages produce sufficient Dam to trigger retrons, we compared Dam levels during infection with P1vir phage and upon ectopic expression. Dam levels during late stages of infection with P1vir phage were equivalent to inducing plasmid Dam expression with 60 μM IPTG (Extended Data Fig. 9c and Supplementary Table 7), which can partially trigger the chromosomal Retron-Eco9 in E. coli NILS-16 (Extended Data Fig. 9d). Thus, phages produce sufficient amounts of Dam to activate native retrons.
To validate the methylation of the msDNA by Dam, we used the specificity of the restriction enzyme DpnI 30 , which only cleaves Dam-methylated 5′-GATC-3′. We purified wild-type and mutated msD-NAs from strains carrying the respective plasmids, and digested them with DpnI. DpnI cut wild-type msDNA, but not the mutated form when Dam was overexpressed. Both msDNA forms were not cut by DpnI in strains without Dam ovexpression (Fig. 4c). Thus, msDNA is directly methylated by Dam, but endogenous Dam levels are insufficient to fully methylate msDNA, similar to other high-copy-number DNA elements 31 . We hypothesize that during phage infection, Dam reaches sufficient levels to methylate the msDNA hairpin and trigger the retron TA, presumably by disrupting the RcaT-RT-msDNA complex (Fig. 4d). Further experiments will be required to confirm this model.

racC-recE is a blocker and trigger pair
Exodeoxyribonuclease VIII, a Rac prophage gene encoded by recE, triggered Retron-Sen2 (Fig. 3b and Extended Data Fig. 7). RecE also triggered Retron-Eco9 (Extended Data Fig. 10a), suggesting that RecE interacts with a conserved retron component. RecE recognizes dsDNA, and degrades one strand in the 5′→3′ direction 32 . Since msDNA forms hairpins, we tested whether the msDNA itself is a RecE substrate. Indeed, we did not retrieve msDNA from a strain overexpressing recE, in contrast to control strains (Fig. 4e). Although overexpressing recE abolished mature msDNA production, a higher molecular weight msDNA band accumulated. This band is similar to immature msDNA (a RNA-DNA hybrid) isolated from ΔxseAB strains (Extended Data Fig. 1e), implying that RecE cannot degrade immature msDNA. Accordingly, overexpressing recE in a ΔxseA strain yielded similar msDNA levels to the control (Fig. 4e). This RecE protection only manifested in vivo, since both mature and immature msDNA were cleaved from recombinant RecE in vitro (Extended Data Fig. 10b). Since we added RNase when isolating msDNA, the RNA part of the immature msDNA is likely to shield the msDNA from RecE. Thus, RecE degrades mature msDNA and reduces the RT-msDNA antitoxin levels. recE is adjacent to racC, a small prophage gene of unknown function (Fig. 4f). RacC, a 91-amino-acid protein, was also the strongest retron TA blocker (Fig. 3d and Extended Data Fig. 8). RacC blocked RcaT even at basal expression levels (Extended Data Fig. 8g), and also blocked RcaT-Eco9 (Extended Data Fig. 10c). Notably, expressing racC in STm completely blocked the RcaT-mediated cold-sensitivity phenotype of all retron antitoxin deletion mutants (Extended Data Fig. 10d), confirming that RacC acts directly against RcaT activity.
In summary, racC-recE forms a linked blocker-trigger gene pair in the Rac prophage. RecE triggers the retron TA by degrading mature msDNA and activates RcaT (Fig. 4g), whereas RacC directly blocks RcaT toxicity.

Retron TAs defend against phages
Since phage-related genes triggered and blocked the retron TA, we reasoned that RcaT-containing retrons are activated upon phage infection to defend against phages via abortive infection, similar to other retrons 3,4 . To test this, we infected wild-type E. coli expressing Retron-Sen2, Retron-Eco9, Retron-Eco1 or an empty vector, with a phage panel at multiple multiplicities of infection (MOIs) (Extended Data Fig. 11). As Retron-Sen2 only inhibits STm growth at low temperature, we tested phage defence at 37 °C and 25 °C. Retron-Sen2 could defend against phage T5 more efficiently at the lower temperature, as cells expressing Retron-Sen2 could overcome T5-induced lysis at MOIs of 0.1 and 0.01 at 25 °C, but not at 37 °C (Fig. 5a,b). By contrast, Retron-Eco9 inhibited growth at 37 °C (Extended Data Fig. 9b) and could defend against many phages at both temperatures (Fig. 5a,c). Retron-Eco1 did not act as a TA in any of the tested conditions (Extended Data Fig. 5), but defended against phage T5 (Fig. 5a), in line with previous reports 3,4 . Overall, RcaT-containing retrons can defend against diverse phages, most efficiently in conditions in which RcaT toxicity is high (Fig. 5d).

Discussion
High-throughput reverse genetics has markedly improved our ability to map gene function in bacteria [33][34][35] . Here we used the cold sensitivity of STm retron mutants to uncover a family of retrons that encode a tripartite TA. All previously known TA types were bipartite and were differentiated on the basis of how the protein or RNA antitoxin neutralizes the toxin 36 . Retron TAs form tripartite TAs in which a small DNA (msDNA) is an active component of the antitoxin complex, formed together with the reverse transcriptase. This antitoxin complex neutralizes the accessory retron protein RcaT, which has conditional toxicity. The reverse transcriptase defines the antitoxin specificity, as it binds RcaT independently of the msDNA. However, the reverse transcriptase alone does not affect RcaT toxicity, and the mature msDNA is needed for the antitoxin activity, although the exact mechanism remains undefined. Of note, we show here that the diversity in sequence, structure and maturation of msDNA 2 enables retrons to sense different phage functionalities (for example, Dam recognizes a dsDNA motif in msDNA, whereas RecE degrades only mature msDNA). We postulate that such mechanisms activate RcaT during phage infection and lead to abortive infection. Consistently, retron TAs (Retron-Sen2 and Retron-Eco9) defend against diverse phages, as has been reported for other retrons 3,4 .
The cellular target of the prevalent RcaT toxins is currently unknown. The nucleotide N-glycosidase-like domain of RcaT-Sen2 is essential for toxicity, and mutating the same domain of RcaT-Eco3 abolishes phage defence 4 . The presence of this domain suggests that RcaT may target nucleic acids or nucleotides. Notably, some RcaTs inhibit growth under specific conditions for unknown reasons. This conditional activity matches their phage defence abilities. Retron-Sen2 preferentially defends against phage T5 in lower temperatures, similar to RcaT-Sen2 activity, explaining why it was missed by other studies 4 . By contrast, RcaT-Eco9 is an active toxin and defends against phages at all temperatures. Conversely, RcaT-Eco1 and RcaT-Eco3 do not inhibit bacterial growth per se, but are essential for  Ffm  T7  T5  T3  T4  P1vir  P1 Br60 T2

Retron-Sen2
Retron-Eco9 Retron-Eco1  phages. E. coli BW25113 carrying Retron-Sen2, Retron-Eco9 or Retron-Eco1 under their own promoter, or an empty plasmid, were grown at indicated temperatures until OD 595 = 0.05, infected with phages at different MOIs, and growth was monitored over time; retron-mediated antiphage defense indicated when retrons allowed host cells to resist phage lysis (compared to the empty vector control). Primary data are shown in Extended Data Fig. 11 (n = 2 biological  replicates). b,c, Retron-Sen2 protects against phage T5 at lower temperatures (b), whereas Retron-Eco9 protects against a broad phage range, independent of the temperature (c). The experiment is as described in a (lines depict the average of n = 2 biological). d, A bacterial-phage arms race. Phages encode proteins (green and blue circles) to counteract bacterial restriction-modification systems (early phage defences). These anti-restriction-modification proteins (such as Dam and RecE) can trigger the retron TA by directly disrupting the msDNA part of the antitoxin. This frees RcaT, which inhibits the growth of the infected cell and thereby stops phage propagation (abortive infection). Thus, phage blockers of early bacterial defences can trigger secondary abortive infection defence systems. In response, phages have evolved blockers (blue) to inhibit the toxin of abortive infection systems (such as RacC).
Article phage defence via abortive infection 3,4 . Whether these RcaTs become active toxins only during phage infection or whether they directly target the phage remains to be elucidated. More broadly, retron accessory proteins are very diverse 4,7 and some do not exhibit obvious toxicity, although they are essential for phage defence via abortive infection 3,4 . Here, we shed light on the mechanism of the most widespread retron family. We anticipate that the core concept of retron accessory proteins being directly regulated by RT-msDNA complexes will be conserved across retrons, as accessory proteins of all retron families co-evolve with their cognate reverse transcriptases 7 .
Although TAs are abundant in bacterial chromosomes (E. coli encodes 35 TAs 36 ), we have little insight into their roles 25,37 . Chromosomal TAs have long been thought to act as plasmid TAs, with labile antitoxins being preferentially degraded by stress-induced bacterial proteases [38][39][40] . In contrast to this indirect triggering, we identified direct triggers, demonstrating that phage proteins inactivate the RT-msDNA antitoxin by methylating (with Dam) or degrading (with RecE) the msDNA. This was enabled by TAC-TIC, a reverse genetics method to systematically identify molecular triggers and blockers of any TA with (exogenous) activity in E. coli. TAC-TIC uses overexpression libraries to query genes that are not expressed (such as racC-recE 41 ) or are kept under tight control in standard growth conditions. Applying TAC-TIC to other TAs will not only expand our understanding of TAs, but may offer paths to treat infection of bacteria by directly triggering endogenous TAs, or by empowering phage therapy.
The Sen2 and Eco9 retron triggers Dam and RecE are used by phages to defend against type II 42 or type III 43 restriction-modification systems. This raises the possibility that, during phage infection, these antirestriction-modification proteins could trigger retron TAs by directly inactivating the RT-msDNA antitoxins and unleashing RcaT-mediated abortive infection. Similarly, Retron-Eco6 is triggered by a phage protein that helps to circumvent another early phage defence system, RecBCD, through an unidentified mechanism 4 . Whether such activation events occur in the context of phage infection remains to be documented, but it suggests the potential of hierarchical crosstalk between abortive infection systems and early anti-phage defences (Fig. 5d). Phages also carry blockers (for example, RacC) to directly circumvent the retron toxins. The differential phage defence capacities of retrons 3,4 probably depend on their collective capacities to sense phage functions and to bypass phage blockers.

Online content
Any methods, additional references, Nature Research 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-022-05091-4.

Bacterial strains, plasmids, primers, and growth conditions
Genotypes of bacterial strains, plasmid description/construction strategy, and sequences of primers used in this study are listed in Supplementary Table 8. Bacteria were grown in LB Lennox (tryptone 10 g l −1 , yeast extract 5 g l −1 , sodium chloride 5 g l −1 ) or on LB agar (2%) plates. All plasmid-carrying bacterial strains were streaked out, grown and assayed with appropriate antibiotics to maintain the plasmids. Plasmids carrying PBAD inserts were induced with 0.2% l-arabinose. Plasmids carrying PBAD promoters were induced with 0.2% l-arabinose, while plasmids carrying Ptac promoters were induced with low (0.1 mM) or high (1 mM) concentrations of IPTG. Bacterial strains with chromosomally inserted antibiotic resistance cassettes were streaked out from stocks on antibiotic LB plates, but grown and assayed thereafter without antibiotics. Antibiotics used were kanamycin (30 μg ml −1 ), ampicillin (50 μg ml −1 ), tetracycline (10 μg ml −1 ), spectinomycin (100 μg ml −1 ), chloramphenicol (10 μg ml −1 ) and hygromycin (100 μg ml −1 ). For diaminopimelic acid (DAP) auxotrophs, DAP was provided at a final concentration of 0.3 mM. Cold-sensitive strains (STm Retron-Sen2 or Retron-Eco10 mutants) were freshly streaked out from glycerol stocks and kept at 37 °C before every experiment to avoid suppressor mutations.

Genetic techniques
STm chromosomal deletion strains were acquired from the STm single-gene deletion library 15 . STm strains ΔrnhA, ΔxseB, Δmsrmsd and ΔaraBAD were constructed by λ-red recombineering 45 , with primer-design for deletions as described before 45 . E. coli strains WT (BW25113), ΔxseA, ΔxseB and ΔrnhA were acquired from the Keio collection 46 . All single-gene deletion strains, newly constructed and from libraries, were re-transduced in wild-type STm or E. coli strains by P22 and P1 transduction, respectively. Resistance cassettes from single-gene deletions were flipped out using the yeast-flippase expressing-plasmid, pCP20 47 . To make double-gene deletion strains, antibiotic resistance cassette genetic deletions were transduced in deletion strains in which the first marker was already flipped out. Non-mobilizable plasmids were introduced in E. coli BW25113 46 and MFDpir 48 strains by TSS (transformation and storage solution) 49 and by electroporation in STm 50 . Mobilizable plasmids were introduced in bacterial strains by conjugation. To construct the p-retron mut plasmid (GATC→GTTC), the source plasmid (p-retron WT ) was mutagenized by PCR using a kit (NEB; Q5-Site-Directed Mutagenesis Kit, E0554S) and the manufacturer's instructions. Primers used were JB433 and JB434 (Supplementary Table 8).

Spot growth tests
Single bacterial colonies were inoculated in 2 ml LB and incubated overday aerobically at 37 °C in a roller drum (until OD 595 was ~5). Overday cultures were stepwise serially diluted 8 times (tenfold) in LB (100 μl culture + 900 μl LB). Using a 96-pinner (V&P Scientific, VP 404), ~10 μl of culture dilutions were spotted on LB plates containing appropriate antibiotics, arabinose, and/or low or high concentrations of IPTG, when applicable (arabinose or IPTG were only present in plates, not in liquid cultures). Spots in growth tests shown in Fig. 1b and Extended Data Fig. 1b,i were spotted manually (10 μl) with a pipette. LB plates were incubated overnight (12-16 h) aerobically at 37 °C, in a humid incubator. For cold-sensitivity growth tests, LB plates were incubated for 36, 48 or 72 h at 25 °C, 20 °C or 15 °C, respectively.

Growth curves
For measuring growth curves anaerobically, LB was pre-reduced for two days in anoxic conditions in an anaerobic chamber (2% H 2 , 12% CO 2 , 86% N 2 ; Coy Laboratory Products). Round-bottomed transparent 96-well plates containing 100 μl LB were inoculated with STm strains (grown aerobically overnight at 37 °C) at OD 595 of 0.01 and sealed with breathable membranes (Breathe-Easy). Plates were incubated at 37 °C in the anaerobic chamber (without shaking), and A 578 was measured periodically (EON Biotek microplate spectrophotometer). For measuring growth under aerobic conditions at 37 °C, plates were instead incubated with shaking (200 rpm), and A 578 was measured (Tecan Safire2 microplate spectrophotometer). msDNA isolation and running msDNA in TBE-acrylamide gels msDNA was isolated by alkaline lysis (reagents as previously described 51 ). msDNA was over-produced by overexpressing the RT and msrmsd region (msrmsd-rrtT), in order to be able to purify msDNA from small culture volumes (see Supplementary Table 8 for strain and plasmid combinations used for each msDNA isolation). Strains were inoculated at OD 595 of 0.01 in 20 ml LB, supplemented with appropriate antibiotics and 0.2% l-arabinose (to overexpress msDNA). Cultures were incubated for 5-6 h at 37 °C with rigorous shaking. After this, cells were put on ice and approximately 10 ml was centrifuged (4,000 rpm for 15 min at 4 °C) after correcting for OD 595 . Pellets were washed once with ice-cold PBS, re-suspended in alkaline solution I, transferred into 1.5-ml Eppendorf tubes, and alkaline solutions II and III were cycled as previously described 51 . After centrifugation (14,000 rpm for 20 min at 4 °C), supernatants were extracted twice with phenol:chloroform:isoamyl alcohol (50:48:2, pH 8), and nucleic acids were precipitated overnight at 4 °C with isopropanol. Precipitated nucleic acids were centrifuged at 14,000 rpm for 60 min at 4 °C. Pellets were re-suspended once with 1 ml of 70% ethanol, and centrifuged again at 14,000 rpm for 60 min at 4 °C. Pellets (msDNA extracts) were air-dried (15 min), resuspended in 10 μl of distilled water containing RNase A (20 μg ml −1 ), and incubated at 37 °C for 60 min. Samples were subsequently kept at −80 °C until further use. msDNA extracts (10 μl) were electrophoresed (70 V for 3.5 h) in 1× TBE:12% polyacrylamide gels (with 1× TBE buffer), and stained with ethidium bromide. The 50 bp ladder was from Promega.
To assess the methylation status of msDNA, the extracted msDNA was further purified from plasmid DNA contaminants by the crush and soak method 52 . In brief, msDNA extracts (from 200 ml of bacterial cultures) were electrophoresed in 12% TBE-polyacrylamide gels (70 V for 4.5 h). The equivalent of extracted msDNA from 60 ml of culture were loaded per well, in order to increase the efficiency of subsequent elution from the acrylamide gel. Gels were stained with ethidium bromide, and the msDNA-containing-gel slices were transferred to Eppendorf tubes. Next, the gel slices were crushed against the walls of the tubes with a tip, suspended in two gel-slice volumes of acrylamide elution buffer 52 , vortexed and incubated at 37 °C in a table-top roller for 16 h. Samples were centrifuged at 14,000 rpm for 5 min at room temperature, and the supernatants were transferred to fresh tubes. An equal volume of isopropanol was added to the supernatants, samples were vortexed, and msDNA was precipitated overnight at 4 °C. Next, samples were centrifuged at 14,000 rpm for 60 min at 4 °C, pellets were washed once with 1 ml of 70% ethanol, and washed pellets were centrifuged again at 14,000 rpm for 60 min at 4 °C. Pellets (purified msDNA) were air-dried for 15 min, and resuspended in 12 μl of distilled water. Subsequently, 1 U μl −1 DpnI (NEB) was added in 5 μl of purified msDNA and digested overnight at 37 °C. In parallel, 5 μl of purified msDNA were incubated in the same buffer (without DpnI), and msDNA digests were electrophoresed in a denaturing 20% urea-TBE-polyacrylamide gel, as described 53 . In brief, 2× formamide loading buffer (90% formamide, 0.5% EDTA, 0.1% xylene cyanol, 0.1% bromophenol blue) was added to the msDNA digests, and samples were heated to 95 °C for 10 min, and were quickly transferred in ice. The denaturing gel was pre-ran for 1 h at 55 °C, and subsequently msDNA digests were electrophoresed for 3.5 h, with constant voltage (60 V). Finally, DNA were stained with silver by using a silver-stain kit (Roth), following the procedure as described 54 .

Whole-genome sequencing
Genomic DNAs from Retron-Sen2 mutant suppressors were isolated using a kit, by following the guidelines of the manufacturer (Nucle-oSpin Tissue, Mini kit for DNA from cells and tissue; REF 740952.50). For genomic DNA library preparation, 1 μg of input DNA was fragmented with sonication for 2 min, and libraries were constructed using a kit (NEB Ultra DNA library kit for Illumina; E7370L), according to the manufacturer's instructions. The 30 genomic libraries were sequenced using a NextSeq Illumina platform with a 150 base pairs paired-end configuration. Variants were called using breseq v0.28.0 55 , using the S. enterica subsp. enterica serovar Typhimurium strain 14028S genome as reference (RefSeq ID: NC_016856.1). Genotypes of suppressor strains can be found in Supplementary Table 8.

SDS-PAGE and immunoblotting
Samples from rrtT-3xFlag, rcaT-3×Flag, and control strains were suspended in Laemmli buffer, and heated to 95 °C for 10 min. Proteins were separated by SDS-PAGE, and the gel was blotted to a PVDF membrane. Membranes were blocked for 1 h at room temperature with 5% skimmed milk in TBS-T (TBS-TM), and probed overnight at 4 °C either in TBS-TM with 1:1,000 anti-Flag antibody (Sigma-Aldrich; F3165), 1:10,000 anti-LpoA antibody (loading control; wherever applicable, membranes were cut, with one half probed with anti-LpoA 35 , and the other half with anti-Flag), or with a 1:10,000 anti-RecA antibody (Abcam; ab63797). Membranes were incubated for 1 h with HRP-conjugated secondary antibodies (1:5000, anti-mouse, Sigma-Aldrich A9044; Flag, or 1:10,000, anti-rabbit, Merck, GENA934; LpoA and RecA) in TBS-TM. After washing with TBS-T, chemiluminescence substrate (GE-Healthcare) was added, and signal was detected using X-ray films (Advantsta). X-ray films were then scanned at 300 × 300 dpi. Digital images were cropped, and adjusted in Inkscape. Signal quantifications were done in ImageJ.

Affinity purifications
Two colonies of STm Flag-tagged strains (and appropriate negative controls-that is, strains with the same genetic background but in which no gene was tagged) were inoculated in 100 ml LB (starting OD 595 = 0.02), and grown at 37 °C with constant shaking (180 rpm), until OD 595 = 1.2-1.5. Cultures were split in half, and one flask was transferred at 20 °C with constant shaking (180 rpm) for 5 h. The remaining volume was used to prepare the 37 °C samples. From this stage on, samples were kept on ice. Approximately 50 ml of cultures at OD 595 = 1.5 were transferred to 50-ml Falcon tubes, with culture volumes per strain being normalized based on absorbance to adjust for total protein levels across strains. Cultures were centrifuged at 5,000 rpm for 10 min at 4 °C and the supernatant was discarded. Pellets were washed once with 50 ml of ice-cold PBS, and cells were centrifuged again. Pellets were then frozen at −80 °C. Subsequently, pellets were re-suspended in 1.2 ml of lysis buffer (50 μg ml −1 lysozyme, 0.8% NP-40, 1 mM MgCl 2 , 1× protease inhibitors (Roche; cOmplete Protease Inhibitor Cocktail) in PBS), and transferred to Eppendorf tubes. Cells were lysed by ten freeze-thawing cycles (frozen in liquid nitrogen, thawing 5 min at 25 °C with 1,400 rpm shaking per cycle). Lysates were centrifuged at 14,000 rpm for 60 min at 4 °C to remove intact cells and other insoluble components. Samples were taken at this step (input samples). Flag beads (Anti-Flag M2 Affinity Agarose Gel; Sigma-Aldrich) were washed twice (20× the beads volume) with wash buffer (0.8% NP-40 in PBS), and 25 μl of washed Flag beads were added to ~1 ml of lysate. Lysates were incubated with Flag beads overnight on a table-top roller, at 4 °C. Subsequently, beads were centrifuged at 8,200g for 10 min at room temperature, and the supernatants were discarded. The beads were washed 4 times with 1 ml wash buffer (2 min rolling with table-top roller and centrifuged at 8,200g for 2 min at room temperature per wash cycle). After the final wash, 50 μl of elution buffer (150 μg ml −1 3×Flag peptide (Sigma-Aldrich), 0.05% Rapigest (Waters), 1× protease inhibitors in PBS) was added to the Flag beads, and proteins were eluted for 2 h on a table-top roller, at 4 °C. The samples were centrifuged at 8,200g for 15 min at room temperature, 50 μl of eluates were retrieved, and transferred to Eppendorf tubes (IP samples).

Proteomics analysis of affinity purifications
Proteins were digested according to a modified SP3 protocol 56 . In brief, approximately 2 μg of protein was diluted to a total volume of 20 μl of water and added to the bead suspension (10 μg of beads) (Thermo Fischer Scientific, Sera-Mag Speed Beads) in 10 μl 15% formic acid and 30 μl ethanol. After a 15 min incubation at room temperature with shaking, beads were washed 4 times with 70% ethanol. Next, proteins were digested overnight by adding 40 μl of digest solution (5 mM chloroacetamide, 1.25 mM TCEP, 200 ng trypsin, and 200 ng LysC in 100 mM HEPES pH 8). Peptides were eluted from the beads, dried under vacuum, reconstituted in 10 μl of water, and labelled for 30 min at room temperature with 17 μg of TMT10plex (Thermo Fisher Scientific) dissolved in 4 μl of acetonitrile. The reaction was quenched with 4 μl of 5% hydroxylamine, and experiments belonging to the same mass spectrometry run were combined. Samples were desalted with solid-phase extraction on a Waters OASIS HLB μElution Plate (30 μm) and fractionated under high pH conditions prior to analysis with liquid chromatography coupled to tandem mass spectrometry (Q Exactive Plus; Thermo Fisher Scientific), as previously described 57 . Mass spectrometry raw files were processed with isobarQuant, and peptide and protein identification was performed with Mascot 2.5.1 (Matrix Science) against the STm Uni-Prot FASTA (Proteome ID: UP000001014), modified to include known contaminants and the reversed protein sequences (search parameters: trypsin; missed cleavages 3; peptide tolerance 10 ppm; MS/MS tolerance 0.02 Da; fixed modifications were carbamidomethyl on cysteines and TMT10plex on lysine; variable modifications included acetylation on protein N terminus, oxidation of methionine, and TMT10plex on peptide N termini). The fold enrichment of pulled-down proteins in Flag-tagged strains compared to negative controls was calculated, and statistical significance was evaluated using two-tailed limma analysis 58 . A similar analysis was conducted on the input samples to ensure that enriched proteins were not overexpressed in Flag-tagged strains.

Retron identification in isolate genomes and human gut MAGs
Using curated RcaT and Rrt protein sequences to search for homologues, we identified retrons in isolates (annotated NCBI RefSeq genomes; accessed October 2020) and in human gut metagenomes 22 , with mmseqs2 easy-search (version 12.113e3) with standard parameters (5937 retrons identified). To obtain a non-redundant retron set, RcaT sequences were clustered at the 99% identity level by using mmseqs2 easy-cluster (-c 0.8, --cov-mode 0, --min-seq-id 0.99), resulting in 778 unique retrons.

Phylogenetic tree construction
RcaT and Rrt protein sequences from the 778 unique retrons were identified from a curated set of RcaT proteins and were aligned with MAFFT 60 (version v7.458; standard parameters). Maximum-likelihood phylogenies were inferred through FastTree 2 61 (version 2.1.10). The intergenic distances between rcaT and rrt were calculated as the distance between the stop codon of rcaT and the start codon of rrt. In order to make the GTDB taxonomy concordant with the NCBI taxonomy, we renamed 'Firmicutes_C' to 'Firmicutes', 'Bacteroidota' to 'Bacteroidetes', and 'Cyanobacteria' to 'Melainabacteria'.
TAC-TIC procedure 384-colony arrays of the MOB plasmid library (carried within an E. coli F + strain; JA200 26 ) and of the TransBac plasmid library (carried within an E. coli F + dapA − strain; BW38029 Hfr (CIP8 oriT::cat) dap-27 ) were pinned from liquid glycerol stocks to LB ampicillin and LB tetracycline DAP plates, respectively, using a Singer ROTOR and 384-density long-pin Singer RePads, and were grown overnight. Conjugation recipient strains (E. coli BW25113 46 ), carried either a p-rcaT plasmid (for TIC), or a p-retron plasmid (for TAC), which both contain a spectinomycin resistance cassette (plasmids detailed in Supplementary Table 8). Recipient strains were grown overnight in LB spectinomycin, and 200 μl of cultures (diluted to OD 595 = 0.5) were spread using 10-15 glass beads on LB (for MOB), or on LB DAP (for TransBac) Singer rectangular plates. Plates with recipient lawns were let in a non-humid incubator at 37 °C for 1 h to dry. Next, 384-colony arrays of the donor libraries were pinned on top of the recipient lawns, using 384 short-pin Singer RePads. Donor and recipients were allowed to conjugate for 8 h in a humid incubator at 37 °C. Subsequently, cells from the conjugation plates were pinned onto double-antibiotic selection plates, using 384 short-pin Singer RePads, in order to select for BW25113 transconjugants carrying both plasmids (p-rcaT/p-retron + library-plasmids). Double-selection plates contained either ampicillin and spectinomycin, or tetracycline and spectinomycin, for MOB or TransBac libraries, respectively, and transconjugants were grown for 24 h at 37 °C. Transconjugants were subjected to a second round of selection on double-antibiotic plates, and were also re-arrayed in a 1,536-colony format. The 1,536-colony transconjugant plates were incubated for 10 h at 37 °C, and then each plate was pinned (using 1,536-density short-pin Singer RePads) on two technical replicates of double-antibiotic selection plates (third-round of selection; source plates). Source plates were incubated for 6 h at 37 °C and were used to pin onto double-selection LB plates (test plates), using 1,536-density short-pin RePads. Test plates contained either no inducer, only arabinose, only IPTG (low or high), or combinations of both (TIC TransBac screen was performed only with low IPTG concentrations). Test plates were incubated for 13 h at 37 °C, and imaged using a Canon EOS Rebel T3i camera under controlled light settings (S&P robotics).

TAC-TIC data analysis
Bacterial colony morphological features for each strain were quantified by using the Iris image-analysis software 44 , and colony integral opacity values were used as a fitness proxy. To account for effects of plasmid induction on fitness, we used plates containing only the libraries and low or high concentrations of IPTG as controls (control plates). These were compared to plates in which the library-plasmids and the p-rcaT/p-retron were co-induced with IPTG and arabinose (experiment plates). For quality control, we removed strains that were (1) growth-inhibited in the control plates (opacity values < 50,000), (2) mucoid in the control plates 44 (colony densities of both replicates > 51), and (3) noisy strains in control and/or experiment plates (standard deviation for opacity values > 23,000; median opacities were: TAC control, 103,820; TAC experiment, 71,680; TIC control, 106,941; TIC experiment, 24,357). Strains exceeding any of the three cut-offs were flagged and removed from the final reported dataset, but are visible in Supplementary Table 5. Plate exterior opacity values (four outermost rows and columns) were each multiplicatively corrected to match the mean growth of the interior of the plate. Plate-to-plate biases were also multiplicatively corrected to the same mean. Subsequently, z-scores of those corrected opacity values were calculated per condition, and mean z-scores were calculated per mutant across replicates. The final reported score is calculated as the difference between the mean z-scores of each mutant in the experiment and the control plates. All raw and processed data from the TAC-TIC analysis can be found in Supplementary Tables 4 and 5.

Statistical analyses
For the analysis of TAC-TIC data, z-score difference means per overexpression strain were calculated as the average z-score difference across clones and replicates, separately for each overexpression library. One-tailed P values (p.value; Supplementary Tables 5 and 6) were calculated for each overexpression strain per induction condition, by using the probability distribution function for the normal distribution. Parameters used were the means and standard deviations of the score distribution of each condition. One-tailed false-discovery rate (FDR)-corrected P-values (q.value; Supplementary Table 5) were subsequently calculated using the Benjamini-Hochberg method 62 .
For the aggregated prophage genes enrichment analysis (Supplementary Table 4), hit genes were pooled across the MOB 26 and Trans-Bac 27 libraries, and p-values for prophage gene enrichment were calculated using a one-tailed Fisher's exact test. First, E. coli BW25113 and E. coli BL21 (DE3) genes were annotated as prophage genes by using the PHASTER database for E. coli K-12 and BL21 63 (accessed in June 2020; full results in Supplementary Table 4 in the prophage.data tabs). Since both MOB 26 and TransBac 27 libraries are derived from E. coli, only unique genes from the two libraries were accounted for in the background frequency (non-prophage genes). A similar one-tailed Fisher's test was also conducted per induction condition, separately for the two libraries (Supplementary Table 4). Genes expressed in flagged strains were not included in the prophage gene enrichment analyses.

TAC-TIC validation procedure
To test candidate genes for blocker or trigger activity, individual conjugation donor strains were single-colony purified from the MOB 26 and TransBac 27 libraries, and used to build new transconjugants that were assayed through colony-array and spot growth tests. To verify that the plasmids contained the appropriate open reading frames, the plasmids were isolated and sequenced. Trigger validation candidates were selected based on (1) being over the significance cut-off (z-score difference > 1.2), and, (2) scoring as hits in both IPTG concentrations (for MOB). Blocker validation candidates were prioritized based on (1) whether they inhibited the toxin in the low-IPTG condition (for both libraries), (2) candidates ydeA, dapA and lacY were excluded as we hypothesized they affect conjugation or induction, (3) candidates yfbN and yfbO were selected, even though they block only in high IPTG, due to being genetically linked, and, (4) candidate tilS was selected even though it had a score of 3.9 (cut-off 4) because of its potentially interesting function for retron biology.
For colony-array growth tests, MOB donor strains ( JA200 26 ) or TransBac donor strains (BW38029 Hfr (CIP8 oriT::cat) dap-27 ) were grown overnight in 600 μl of LB at 37 °C in a 1 ml volume 96-deep-well plate, aliquoted in 96-well plates with 15% glycerol, and kept at −80 °C until further use. The 96-colony-array donor strains were conjugated with E. coli BW25113 recipient strains carrying plasmids p-empty, p-retron, p-retron-ΔrcaT, and p-rcaT in four separate LB agar plates (conjugation as described in 'TAC-TIC procedure'). Subsequently, the transconjugant strains were combined in a single 384-array plate, and pinned on plates containing either no inducer, only arabinose, only IPTG (low or high), or combinations of both. Plates were incubated for 15 h in a humid incubator at 37 °C, and the 384-density arrayed plates were imaged as described before. Pictures were analysed using Iris 44 , and integral opacity values were used to calculate fitness scores. Fitness scores for TAC were calculated per condition (per plate) as the opacity ratio between E. coli strains carrying p-retron-ΔrcaT and p-retron (and trigger-plasmid-X). Fitness scores for TIC were calculated per-IPTG-condition as the opacity ratio between an E. coli strain carrying p-rcaT (and blocker-plasmid-X) and the average opacity value of strains carrying p-rcaT (and trigger-plasmid-X, as negative control).
For spot growth tests, purified MOB and TransBac library plasmids were first introduced in MFDpir 48 and BW38029 Hfr (CIP8 oriT::cat) dap-27 conjugation donor strains, respectively. Next, donors were conjugated with either E. coli BW25113 carrying plasmids p-retron-ΔrcaT and p-retron (for TAC), or E. coli BW25113 carrying plasmid p-rcaT (for TIC). Conjugation was carried out as described in the plasmid conjugation section. Strains were spotted on plates containing either no inducer, only arabinose, only IPTG (low or high), or combinations of both, and spot growth tests were carried out as described above.

Plasmid conjugation
Mobilizable plasmids were introduced to E. coli or STm strains through conjugation (donors were either E. coli JA200 26 , E. coli BW38029 Hfr (CIP8 oriT::cat) dap-27 or E. coli MFDpir 48 strains). Conjugation was carried out by growing single colonies of both recipient and donor strains in LB overnight at 37 °C (LB supplemented with DAP or appropriate antibiotics where applicable). Subsequently, 200 μl of diluted overnight cultures (OD 595 = 0.5) of the donor strains were spread on LB plates (supplemented with DAP if applicable), and plates were incubated at 37 °C in a dry incubator for 1 h. Next, 10 μl of diluted overnight cultures (OD 595 = 0.5) of the recipient strains were spotted on top of the lawn of the donor strain, and the conjugation plates were incubated for 6 h at 37 °C. Finally, transconjugant strains were selected by streaking them out from the area where the recipient strains were spotted, in either double-antibiotic selection plates, or single-antibiotic plates but without DAP supplementation (if applicable). Selection plates were grown overnight at 37 °C, and transconjugants were single-colony purified for further use. The high-throughput conjugation protocol is described in the TAC-TIC procedure section.

Dam P1 protein levels measurement from phage infection or plasmid induction
To measure the levels of the phage P1 Dam P1 protein during phage infection, an overnight culture of E. coli BW25113 ΔlacY::kan carrying a control plasmid was diluted into 20 ml of OD 595 = 0.001 in LB tetracycline (supplemented with 5 mM CaCl 2 and 10 mM MgCl 2 ), and cells were grown until OD 595 = 0.1 in a water-bath (37 °C, 180 rpm). Cells were infected with phage P1vir (MOI = 2) for 5 min (early phage infection), 35 min (late phage infection), or not infected (uninfected). The cultures were then transferred into 50-ml Falcon tubes containing 30 ml ice-cold PBS (supplemented with 50 mM citrate to sequester divalent cations and inhibit further phage P1vir adsorption). Cultures were centrifuged (4,000 rpm for 10 min at 4 °C), pellets were washed with 50 ml cold PBS-citrate, and centrifuged again (4,000 rpm for 10 min at 4 °C). Next, the cells were resuspended in 100 μl of lysis buffer (PBS supplemented with 2% SDS, 10 mM MgCl 2 , and 0.1 U μl −1 benzonase), and boiled at 95 °C for 10 min in a thermocycler. The proteins in the lysates were quantified by Tandem Mass Tag (TMT) labelling coupled with proteomics and analysed as described in 'Proteomics analysis of affinity purifications'. An MOI of 2 was used to ensure that, on average, every cell would be infected.
To measure the levels of Dam P1 from plasmid induction, an E. coli BW25113 ΔlacY::kan strain carrying an IPTG-inducible plasmid encoding Dam P1 was grown in LB tetracycline (supplemented with 5 mM CaCl 2 , 10 mM MgCl 2 , and varying amounts of IPTG). Cultures were grown, cells were collected at an OD 595 = 0.2 and handled in the same way as described above for the phage samples, and protein levels were quantified by proteomics, and analysed as described in 'Proteomics analysis of affinity purifications'. The ΔlacY mutation was introduced to ensure a linear IPTG induction across all the cells 64 .

Phage defence experiments
Phage lysate titres were calculated in duplicates using the double-agar overlay method 65 . To test a wide range of phage multiplicities of infection (MOIs in phage per cell: 5, 10 −1 , 10 −2 , 10 −3 and 10 −4 ), serial dilutions of phage lysates (5 μl final volume) were added in round-bottomed 96-well plates. If the cells were to be assayed at 37 °C afterwards, plates containing the phages were pre-warmed at 37 °C for 2 h before adding the cells (otherwise they were left at room temperature). E. coli BW25113 strains carrying plasmids encoding retrons (with their native promoters), or a control plasmid, were diluted to OD 595 = 0.001 from overnight cultures grown at 25 °C or 37 °C, and grown until OD 595 = 0.05 at the respective temperature. We used retrons with their native promoters (in plasmid pTU175-pBAD; Supplementary Table 8), as the PBAD promoter is catabolite-repressed in LB (until OD 595 ≈ 0.8). Then, 95 μl of culture at OD 595 = 0.05 was added in the 96-well plates that contained phages and the plates were sealed with breathable membranes (Breathe-Easy). Plates were then incubated with constant shaking (200 rpm), and OD 595 was measured periodically to acquire growth curves in microplate readers (either in a Biotek Synergy HT or in a Molecular Devices Filtermax F5). The plate reader temperatures were set either at 37 °C or at 25 °C, depending on the experiment. Retron-mediated phage defence was scored across phage MOIs by comparing the growth of retron-containing strains, to a strain containing an empty plasmid. All strains for the experiments were grown in LB supplemented with 5 mM CaCl 2 ,10 mM MgCl 2 , and spectinomycin (to maintain the retron-encoding plasmids). Phages P1, T2, T3, T4, T5, and T7 were acquired from DSMZ. Phage P1vir was single-plaque purified from a Typas lab stock. Ffm and Br60 are gifts from V. Mutalik and B. Adler.

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

Data availability
Raw reads from whole-genome sequencing are deposited at the European Nucleotide Archive under accession PRJEB38324. Proteomics data from RcaT and RT immunoprecipitations and phage infections are in Supplementary Tables 1 and 7, and the raw data are deposited at ProteomeXchange under accession PXD022376. All TAC-TIC data are in Supplementary Table 5. Source images and replicates are provided at figshare (https://doi.org/10.6084/m9.figshare.17376488).