Main

In both animal and plant immune systems, TIR domains serve as the signal-transducing components of immune receptors that recognize molecular elements of invading pathogens. In humans, TIR domains in Toll-like receptors transfer the signal through protein–protein interactions1. Plant TIR-containing immune receptors have previously been shown to possess an enzymatic activity, and were reported to produce a molecule that is a variant of cyclic adenine diphosphate ribose (v-cADPR) upon pathogen recognition3,4. Activation of plant TIRs leads to a form of cell suicide known as the hypersensitive response, which prevents pathogen propagation7. The mechanism through which the enzymatic activity of plant TIRs is involved in cell death is, to our knowledge, unknown5,8.

TIR domains have also been found to serve as essential components in a common prokaryotic immune system called Thoeris, which defends bacteria against phage infection6. Thoeris comprises two core proteins, one of which (named ThsB) has a TIR domain (Fig. 1a). Recent investigations of Thoeris proteins in vitro revealed an enzymatic activity of the non-TIR protein ThsA, suggesting that Thoeris defence involves NAD+ hydrolysis that may lead to cell death upon infection9. In the current study, we set out to understand the mechanism of Thoeris-mediated immunity against phages, and to trace possible functional and evolutionary connections between bacterial and eukaryotic TIRs.

Fig. 1: Thoeris causes abortive infection and depletion of NAD+.
figure 1

a, Top, the Thoeris system of B. cereus MSX-D12 used in this study. Gene locus tags and protein domains are indicated. Bottom, Thoeris genes were cloned into B. subtilis BEST7003 under inducible promoters. ThsA was induced with 0.2% xylose and ThsB with 5 µM isopropyl β-d-1-thiogalactopyranoside (IPTG). b, Growth curves of Thoeris-expressing (green) and control (black) cultures with and without infection by phage SPO1 at an MOI of 5 or 0.05. Curves represent three independent experiments. OD600 nm, optical density at 600 nm. c, Magnification of the area marked with a dashed rectangle in b (MOI of 5). d, Levels of NAD+ in control culture (black) and in cells expressing wild-type (WT) Thoeris (green). Time 0 represents uninfected cells. Each line represents the mean of three independent experiments, with individual data points shown. Cells were infected by phage SPO1 at an MOI of 5. AU, arbitrary units.

Source data

Abortive infection through NAD+ depletion

We first asked whether Thoeris defence leads to cell death akin to plant TIR-containing immune systems. Multiple bacterial defence systems are known to protect bacteria by triggering cell death upon infection by phage, a process known as abortive infection10. To test whether Thoeris is an abortive infection system, we carried out experiments using Bacillus subtilis cells expressing the Thoeris system of Bacillus cereus MSX-D126 (Fig. 1a). Cells expressing Thoeris proteins from inducible promoters were protected against phage SPO1 in plaque assay experiments (Fig. 1a, Extended Data Fig. 1a, b). Thoeris-mediated protection from SPO1 infection was also observed in liquid cultures, if phages were added to the culture at a low multiplicity of infection (MOI) (Fig. 1b). However, adding phages at a high MOI, at which nearly all cells are expected to be infected by the initial phage inoculum, resulted in a premature culture collapse (Fig. 1b, c) that did not involve the release of new phages (Extended Data Fig. 1c). The collapse of the culture occurred 70–80 min after initial infection, which is earlier than phage-induced lysis that was observed in Thoeris-lacking cells after 120 min (Fig. 1c). These results suggest that Thoeris defends through abortive infection, leading to the death of infected cells before the maturation of phage progeny.

Although Thoeris-expressing cells showed a premature collapse as compared to control cells, the Thoeris culture was able to recover several hours after the collapse, in contrast to control cells that did not recover following phage lysis at the same time point (Fig. 1b). The recovered cells still underwent abortive infection when isolated, regrown and reinfected by a fresh batch of SPO1 phage, suggesting that the resistance of these cells to the residual phage titre remaining in the culture was transient rather than genetic (Extended Data Fig. 1d, e). It was recently suggested that some Bacillus subtilis cells can temporarily modify their cell wall to evade phage attachment in response to phage-induced death of the surrounding culture11, which might explain the observed culture recovery.

The Thoeris defence system comprises two genes, thsA and thsB, and the presence of both of them is essential for Thoeris defence6. ThsB contains a TIR domain, and ThsA most commonly contains a sirtuin (SIR2) domain at its N terminus (Fig. 1a). It was recently shown that the SIR2 domain within ThsA has a catalytic NADase activity9. NAD+ depletion has been implicated in abortive infection in other phage defence systems12, and it was hypothesized that depletion of NAD+ by ThsA is involved in Thoeris abortive infection9. To test this, we monitored the levels of NAD+ during phage challenge using liquid chromatography and mass spectrometry (LC–MS). In Thoeris-expressing cells, a complete depletion of NAD+ was observed 60 min after the onset of infection by phage SPO1 (Fig. 1d), temporally preceding the culture collapse that occurred 70–80 min after infection (Fig. 1c). The product of NAD+ cleavage—ADP-ribose—was detected simultaneously with the decline of NAD+ levels (Extended Data Fig. 1h). Such NAD+ depletion and ADP-ribose production were not observed in control cells lacking Thoeris, or in uninfected Thoeris-containing cells (time 0) (Fig. 1d, Extended Data Fig. 1h). A point mutation in the active site of the NADase domain in ThsA (N112A), which was shown to be essential for its activity in vitro9, abolished Thoeris-mediated defence6 (Extended Data Fig. 1a, b). The same mutation also abrogated NAD+ depletion after infection (Extended Data Fig. 1i), suggesting that the NADase activity of ThsA is responsible for the observed depletion of NAD+.

Thoeris TIR produces signalling molecules

The TIR domain in the ThsB protein was previously shown to be essential for Thoeris defence6, and, accordingly, a mutation in the conserved glutamic acid residue of the ThsB TIR domain (E85Q) abolished phage defence and NAD+ depletion (Extended Data Fig. 1). A mutation in the parallel conserved glutamic acid residue in plant TIR-domain proteins prevented the production of the v-cADPR molecule following recognition of pathogen molecular signatures3,4. We therefore hypothesized that the Thoeris TIR protein may produce, in response to phage infection, a signalling molecule akin to the v-cADPR molecules generated by plant TIRs, and that this signalling molecule may trigger the NADase activity of ThsA, which would then lead to abortive infection.

To test this hypothesis, we expressed only the Thoeris ThsB TIR protein in B. subtilis cells, and subjected these cells to infection by phage SPO1. At several time points during infection, we lysed the infected cells and filtered the lysates to include only molecules smaller than 3 kDa. We incubated purified ThsA protein with these lysates in vitro to test whether the lysates affect the NADase activity of ThsA (Fig. 2a). Purified ThsA showed marked NADase activity when incubated with cell lysates derived from infected cells that expressed the TIR-containing ThsB protein (Fig. 2b). Only lysates derived from cells 45 min or more after infection triggered the NADase activity of ThsA (Fig. 2b). The activity of ThsA was not triggered when the purified protein was incubated with lysates from uninfected cells, or with lysates from infected control cells that did not express the ThsB TIR protein, or with lysates from infected control cells that expressed the ThsB(E85Q) mutant (Fig. 2b). These results suggest that during phage infection, Thoeris TIR proteins produce a small molecule that is capable of activating the NADase activity of ThsA.

Fig. 2: The NADase activity of ThsA is triggered by small molecules generated in TIR-expressing infected cells.
figure 2

a, Schematic representation of the experiment. Cells expressing ThsB protein, ThsB(E85Q) mutant protein or GFP (control) were infected with SPO1 at an MOI of 5. NADase activity was measured using a nicotinamide 1,N6-ethenoadenine dinucleotide (εNAD) cleavage fluorescence assay. b, NADase activity of purified ThsA protein incubated with lysates derived from control cells (black), ThsB-expressing cells (green) or cells expressing the mutant ThsB(E85Q) (cyan), during infection. Bars represent the mean of three experiments, with individual data points overlaid. Asterisks indicate a statistically significant increase (one-way ANOVA followed by pairwise multiple comparison analysis according to Tukey’s honest significant difference criterion, P < 10−5). c, NADase activity of ThsA when incubated with lysates derived from E. coli cells overexpressing GFP control (black) or BdTIR (yellow). Bars represent the mean of three experiments, with individual data points overlaid. The increase is statistically significant (Student’s t-test, two sided, P = 0.008).

Source data

To investigate whether the bacterial TIR-generated molecular agent that activates ThsA is similar to the molecules generated by plant TIRs, we used lysates from Escherichia coli cells overexpressing a TIR-domain protein from the plant Brachypodium distachyon (BdTIR), which was shown to constitutively produce v-cADPR when expressed in E. coli3. Lysates from BdTIR-expressing E. coli were able to trigger the NADase activity of ThsA (Fig. 2c). By contrast, ThsA was not active in the presence of the canonical cADPR molecule, even when cADPR was supplied at millimolar concentration (Extended Data Fig. 2). These results suggest that the bacterial Thoeris TIR and the plant BdTIR are functionally similar, and that secondary messenger molecules produced by both can activate the Thoeris effector protein.

The signalling molecule is a cADPR isomer

To further study the signalling molecule produced by the Thoeris TIR protein, we used untargeted LC–MS to analyse the metabolite content in B. subtilis cells expressing the Thoeris ThsB TIR protein during infection by phage SPO1. We observed a unique molecule that became detectable in the TIR-expressing infected cells 45 min after infection (Fig. 3a). The molecule was not detected in uninfected cells or at earlier time points after infection, and was also absent from infected cells that expressed the mutated TIR protein ThsB(E85Q) (Fig. 3a). These results suggest that this unique molecule is generated by the TIR protein in response to phage infection. The m/z value of the identified molecule was 542.0683 (positive ionization mode), which is within the expected measurement error of the predicted protonated mass of cyclic ADP-ribose (cADPR; m/z = 542.0684). However, the unique molecule eluted from the liquid chromatography column at a different retention time than the canonical cADPR standard, indicating that it is structurally distinct from the canonical cADPR (Fig. 3b). Tandem mass spectrometry fragmentation analysis (MS/MS) showed that the Thoeris-produced molecule generates molecular fragments similar to those generated by the canonical cADPR (Extended Data Fig. 3a), further supporting the hypothesis that the Thoeris TIR-produced molecule is an isomer of cADPR.

Fig. 3: ThsB produces an isomer of cADPR after phage infection.
figure 3

a, A unique molecule with an m/z value of 542.0683 appears in infected cells that express wild type ThsB. Cells were infected with SPO1 at an MOI of 5. Bars represent the mean area under the curve (AUC) of three experiments, with individual data points overlaid. b, Extracted mass chromatograms of ions with an m/z value of 542.0683, detected in lysates of ThsB-expressing cells 70 min after infection (green curve) and of standard cADPR (blue curve, blue), demonstrating the difference in retention time. c, Structural superimposition of the SLOG domain of ThsA (Protein Data Bank (PDB) code 6LHX; green)9 and the SLOG domain of human TRPM2 bound to ADPR (PDB code 6PUS; wheat)16. d, e, Histograms of the mass of purified ThsA protein particles incubated with lysates derived from SPO1-infected bacteria, expressing either ThsB(E85Q) (d), or ThsB (e). Protein masses in solution were measured using mass photometry. Data for an additional two replicates are presented in Extended Data Fig. 3.

Source data

The SLOG domain mediates signal response

In addition to the SIR2 NADase domain at its N-terminus, ThsA contains another domain, at its C terminus, called SLOG9,13,14. SLOG domains were hypothesized to bind nucleotide-derived signalling molecules, and specifically NAD+ derivatives such as ADPR molecules13,14. Domains homologous to SLOG are found in human cation channels of the TRPM family13, which are triggered by ADPR and its derivatives15,16. Structural superimposition of the SLOG domain of ThsA9 and the ADPR-bound SLOG domain of TRPM2 shows their structural homology in the ADPR-binding pocket region (Fig. 3c). We therefore hypothesized that ThsA is activated when the TIR-produced cADPR isomer binds to its C-terminal SLOG domain.

To examine the role of the Thoeris SLOG domain, we mutated the conserved arginine residue at position 371 within the SLOG domain of ThsA9,14, and found that this mutation abolished Thoeris defence against phages (Extended Data Fig. 3b). We then used mass photometry to monitor the oligomeric state of wild-type and mutant ThsA proteins during exposure to cell lysates containing the signalling cADPR isomer. In the absence of the signalling molecule, the majority of the ThsA proteins were present either in a monomeric form (63.3% ± 17.16% s.d.), or in a tetrameric form (19.6% ± 16.07% s.d.) as previously reported9 (Fig. 3d). However, when exposed to lysates that contain the signalling molecule, a large fraction of the ThsA protein shifted its oligomeric state into a dimer form (40% ± 9.54% s.d.) (Fig. 3e). Because exposure to lysates that contain the signalling molecule activates the NAD+ degradation activity of ThsA (Fig. 2b), these data suggest that the observed shift in the oligomeric state reflects the activation of the ThsA enzyme. ThsA(N112A) proteins, mutated in the SIR2 NADase active side, retained the ability to dimerize after exposure to the signalling molecule, indicating that the NADase activity of the SIR2 domain is not involved in the oligomeric state change (Fig. 3e). By contrast, the SLOG mutant ThsA(R371A) was impaired in its ability to oligomerize and respond to the signalling molecule (Fig. 3d, Extended Data Fig. 3c–e). These results indicate that the SLOG domain of ThsA drives an oligomeric state change in response to the TIR-derived cADPR isomer signal, resulting in activation of the NADase activity of the SIR2 domain.

TIR proteins determine phage specificity

In natural Thoeris systems, the thsA SIR2-domain gene is frequently accompanied by multiple thsB TIR-domain genes6 (Fig. 4a). Different thsB genes at the same locus are usually divergent from one another, often sharing very little sequence identity beyond the general structure of the TIR domain and its conserved active site6,14. We hypothesized that diverse ThsB proteins within the same locus could be responsible for recognition of different phage-associated molecular patterns, akin to the roles of TIR-domain proteins in eukaryotic immune systems.

Fig. 4: Thoeris TIR proteins determine defence specificity.
figure 4

a, Schematic representation of the Thoeris systems from Bacillus dafuensis FJAT-25496 (blue) and B. cereus MSX-D12 (green). Gene locus tags and protein domains are indicated. b, Defence patterns of Thoeris systems containing combinations of ThsA from B. dafuensis and ThsB proteins from B. dafuensis or B. cereus. In each combination, ThsA was induced with 0.2% xylose and ThsB with 100 µM IPTG. A reduction of more than 10-fold in the efficiency of plating (EOP) on system-containing cells compared to control cells is marked by a grey rectangle. EOP data used to generate this figure were collected in three independent replicates, and are presented in Extended Data Fig. 4a. c, Same as b, for combinations of ThsA from B. cereus and ThsB proteins from B. dafuensis or B. cereus. d, NADase activity of purified ThsA protein from B. cereus, incubated with lysates derived from control cells (black), or cells expressing TIR-domain proteins of B. cereus (green) and B. dafuensis (blue shades). Lysates were collected from cells infected by SPO1, at an MOI of 5, before infection (time 0) or 70 min after infection. Bars represent the mean of three experiments, with individual data points overlaid. Asterisks mark a statistically significant increase (one-way ANOVA followed by pairwise multiple comparison analysis according to Tukey’s honest significant difference criterion, P < 0.0005). e, Model for the mechanism of action of Thoeris.

Source data

To test this hypothesis, we examined the Thoeris locus found in Bacillus dafuensis FJAT-25496, which includes two TIR-domain thsB genes present consecutively on the same operon with a single upstream thsA gene (Fig. 4a). We constructed B. subtilis strains that express the B. dafuensis ThsA together with either of the two ThsB proteins (called here TIR1 and TIR2) or with both proteins together (Fig. 4a, b). B. subtilis cells that expressed ThsA + TIR1 were protected from infection by a set of phages including phi29 and SBSphi11, but were sensitive to phages phi3T and SPBeta (Fig. 4b, Extended Data Fig. 4a). By contrast, cells expressing ThsA + TIR2 were protected from phages phi3T and SPBeta, but were sensitive to phages phi29 and SBSphi11 (Fig. 4b, Extended Data Fig. 4a). Cells that expressed ThsA + TIR1 +TIR2 were protected from all four phages, showing that the defence range conferred by the individual TIR proteins is additive (Fig. 4b, Extended Data Fig. 4a). These results are in line with the hypothesis that each TIR-containing ThsB protein recognizes a different phage infection marker to initiate Thoeris defence. Both ThsA + TIR1 and ThsA + TIR2 constructs provided defence against phages SPO1, SBSphiJ, SPR and SBSphi13, implying that these phages present infection markers that activate both TIRs. Notably, hybrid systems in which we co-expressed the ThsA proteins of B. dafuensis or B. cereues with each of the three TIR proteins from both bacteria were also functional in defence against phages (Fig. 4b, c, Extended Data Fig. 4a). Filtered lysates from SPO1-infected cells expressing each of the two TIR proteins from B. dafuensis were able to trigger the NADase activity of ThsA from B. cereus in vitro (Fig. 4d). These results indicate that all three of the TIR proteins tested produce ThsA-activating cADPR isomer molecules.

Cloning of the various TIR proteins with a ThsA(N112A) mutant did not provide defence against any of the phages, demonstrating that an intact ThsA is essential for defence regardless of the associated TIR-domain protein (Extended Data Fig. 4b). With the exception of SBSphiC, the defence specificity against all phages seemed to be determined by the identity of the TIR-domain protein, rather than the ThsA protein, further supporting the role of the TIR-domain proteins as the specificity determinants of Thoeris (Fig. 4b, c).

Discussion

Together, our results suggest a model for the mechanism of the Thoeris anti-phage defence system (Fig. 4e). The TIR-domain protein ThsB is responsible for recognizing phage infection. Once infection has been detected, the TIR domain becomes enzymatically active and catalyses the production of the cADPR isomer molecule. This molecule, in turn, serves as a signalling agent that binds the ThsA effector through its C-terminal SLOG domain, and activates its NADase activity through a change in the ThsA oligomerization state. The NADase effector then depletes NAD+ from the cell, generating cellular conditions that cannot support phage replication and presumably lead to cell death (Fig. 4e). Our results verify that TIR-derived cADPR isomers can serve as immune secondary messengers, and can inform future studies in plant model systems to reveal the role of such TIR-produced molecules in the plant immune response to pathogens.

The phage-mediated trigger for Thoeris activation, as well as the exact molecular structure of the signalling cADPR isomer, remain to be determined. Nucleotide-based immune signalling molecules in bacteria were shown to function in nanomolar or low micromolar concentrations12,17,18, limiting analytical studies of the TIR-derived signalling molecule. Indeed, although the v-cADPR molecule has been observed in multiple studies of plant TIR domains3,4,8, its molecular structure has not yet been deciphered.

TIR domains have been canonically described as protein–protein interaction platforms that mediate immune signalling of Toll-like receptors in animals1. Observations from recent years show that TIRs can also serve as NAD+ depleting enzymes—as in the case of the human SARM1 protein19, TIR-containing effector proteins in pathogenic bacteria20,21, and TIR–STING proteins in bacterial cyclic-oligonucleotide-based antiphage signalling systems (CBASS)12. Moreover, in plants3,4, and as shown here in bacteria, TIR domains can use NAD+ for the production of signalling molecules. Our data imply that TIR-based antiviral immune signalling in bacteria could have been the ancestral form of plant TIR-containing mechanisms of innate immunity.

Methods

Plasmid construction for Bacillus shuttle vectors

The accession numbers for the genes used in this study are listed in Supplementary Table 1. Gene open reading frames (ORFs) were synthesized by Genscript Corp. Bacillus cereus MSX-D12 thsA gene included six additional bases upstream to the ORF annotated in NCBI (GenBank accession: EJR09240.1) to include an upstream ATG. The thsA gene of B. dafuensis FJAT-25496 included 27 additional bases upstream to the annotated ORF to include a possible alternative upstream ATG. Synthesized DNA was used as a template for PCR for subsequent cloning into shuttle vectors for Bacillus transformation. All PCR reactions were performed using KAPA HiFi HotStart ReadyMix (Roche, KK2601). Plasmid maps are included as Supplementary Files 19. All primers used are listed in Supplementary Table 2.

The thsA gene of Bacillus cereus MSX-D12 was amplified using primers OGO611+OGO612. Bacillus dafuensis FJAT-25496 thsA gene was amplified using primers OGO726+OGO727. The thsA genes were cloned into a shuttle vector under the control of the Pxyl promoter (Supplementary Files 1, 2). The shuttle vector contained chloramphenicol resistance and a thrC integration cassette for genomic integration and propagation in Bacillus subtilis. The vector backbone was amplified using primers OGO576 + OGO603.

The thsB genes were cloned into a second shuttle vector under the control of a Phspank promoter, and fused to a C-terminal Twin-Strep tag (Supplementary Files 35). The shuttle vector contained spectinomycin resistance and an amyE integration cassette for genomic integration and propagation in Bacillus subtilis. For the control strain, superfolder GFP gene (sfGFP) was cloned instead of the thsB genes, and the thrC locus was uninterrupted (Supplementary File 6). Bacillus cereus MSX-D12 thsB was amplified using primers OGO685 + OGO686. Bacillus dafuensis FJAT-25496 TIR1 was amplified using primers OGO728 + OGO729. Bacillus dafuensis FJAT-25496 TIR2 was amplified using primers OGO730 + OGO731. The vector backbone was amplified using primers OGO657+OGO658.

The double TIR construct of B. dafuensis FJAT-25496 (TIR1 + TIR2) was constructed by PCR amplification of the TIR2 gene and its ribosome-binding site from its shuttle vector and cloning it downstream to the TIR1 gene on the amyE shuttle vector, to create a bicistronic transcript expressed from the Phspank promoter (Supplementary File 7). The TIR1 vector backbone was amplified using primers OGO706 + OGO888, and the TIR2 insert was amplified using primers OGO887 + OGO889.

Cloning was performed using the NEBuilder HiFi DNA Assembly kit (NEB, E2621). Both shuttle vectors were propagated in E. coli DH5a using a p15a origin of replication with 100 μg ml−1 ampicillin selection. Plasmids were miniprepped from E. coli DH5a before transformation into B. subtilis BEST700322.

Mutagenesis of B. cereus MSX-D12 ThsB(E85Q) (GAA>CAA) was carried out by Genscript Corp. Mutagenesis of B. cereus MSX-D12 ThsA(N112A) was previously described6.

Bacillus transformation

Transformation to B. subtilis BEST7003 was performed using MC medium as previously described23. MC medium was composed of 80 mM K2HPO4, 30 mM KH2PO4, 2% glucose, 30 mM trisodium citrate, 22 μg ml−1 ferric ammonium citrate, 0.1% casein hydrolysate (CAA) and 0.2% potassium glutamate. From an overnight starter of bacteria, 10 μl was diluted in 1 ml of MC medium supplemented with 10 μl 1M MgSO4. After 3 h of incubation (37 °C, 200 rpm), 300 μl of the culture was transferred to a new 15-ml tube and around 200 ng of plasmid DNA was added. The tube was incubated for another 3 h (37 °C, 200 rpm), and the entire reaction was plated on lysogeny broth (LB) agar plates supplemented with 5 μg ml−1 chloramphenicol or 100 μg ml−1 spectinomycin and incubated overnight at 30 °C.

Phage cultivation and plaque assays

Phages were previously received from the Bacillus Genetic Stock Center (BGSC). BGSC IDs for the phages used are 1P4 for SPO1, 1L1 for phi3T, 1L5 for SPβ, 1L56 for SPR and 1P7 for SPP1. Phage phi29 was received from DSMZ (DSM 5546). Phages SBSphiC and SBSphiJ were previously isolated by us6 and are available from BGSC (BGSCID 1P46 and 1P47, respectively). Phages SBSphi11 and SBSphi13 were isolated by us during this study from soil samples as previously described6.

Phages were propagated by infection of exponentially growing B. subtilis BEST7003 culture in magnesium manganese broth (MMB) (LB + 0.1 mM MnCl2 + 5 mM MgCl2) at an MOI of 1:100–1:1,000, incubated at 37 °C with shaking (200 rpm) until clearing of the culture, the lysate was centrifuged and the supernatant was filter-sterilized through a 0.45-µm filter.

Phage titre was determined using the small drop plaque assay method24. Three hundred microlitres of overnight culture of bacteria was mixed with 25 ml MMB + 0.5% agar, poured in a 10-cm square plate and incubated for 1 h at room temperature. For cells that contained inducible constructs, the inducers were added to the agar at a concentration of 0.2% xylose and 5 µM IPTG for the experiments presented in Extended Data Figs. 1, 3b, or 0.2% xylose and 100 µM IPTG for experiments presented in Fig. 4, Extended Data Fig. 4. The phage stock was 10-fold serially diluted and 10-µl drops of diluted phage lysate were placed on the solidified agar. After the drops had dried up, the plates were inverted and incubated at room temperature overnight, and plaques were counted to determine phage titre. Phage efficiency of plating (EOP), representing the magnitude of defence, was determined as the ratio between the number of plaques on the control strain expressing GFP and the number of plaques on the relevant Thoeris strain. When individual plaques could not be counted owing to small size, a faint lysis zone across the drop area was considered to be 100 plaques.

Infection dynamics in liquid culture

Non-induced overnight cultures of B. subtilis cells were diluted 1:100 into fresh MMB medium supplemented with 0.2% xylose and 5 µM IPTG. Cultures were incubated at 37 °C with shaking (200 rpm). When cells reached an OD600 nm of 0.3 in a 1 cm cuvette, 180 µl was dispensed into each microwell in a 96-well plate and infected with 20 µl of SPO1 phage lysate to the desired MOI. Plates were immediately transferred to a plate reader (Tecan Infinite 200) set to 25 °C with 4.5-mm orbital shaking and OD600 nm monitored every 10 min.

Measurements of NAD+ and ADPR levels in vivo

Overnight cultures were diluted 1:50 in 100 ml MMB supplemented with 0.2% xylose and 5 µM IPTG and grown at 37 °C, with 200 rpm shaking, until an OD600 nm of 0.3  in a 1 cm cuvette. A sample of 15 ml for uninfected culture (time 0) was then removed, and SPO1 phage stock was added to the culture to reach an MOI of 5. Flasks were incubated at 25 °C, with 200 rpm shaking, for the duration of the experiment. Samples of 15 ml were then collected at times 15, 30, 45, 60, 70 min after infection. Immediately after sample removal, the sample tube was placed in ice and centrifuged at 4 °C for 8 min to pellet the cells. The supernatant was discarded and the tube was frozen at −80 °C. To extract the metabolites, 600 µl of 100 mM phosphate buffer supplemented with 4 mg ml−1 lysozyme (Sigma, L6876) was added to each pellet. The thawed sample was transferred to a FastPrep Lysing Matrix B in a 2-ml tube (MP Biomedicals, 116911100) and lysed using FastPrep bead beater for 40 s at 6 m s−1. Tubes were then centrifuged at 4 °C for 15 min at 15,000g. The supernatant was transferred to an Amicon Ultra-0.5 Centrifugal Filter Unit 3 KDa (Merck Millipore, UFC500396) and centrifuged for 45 min at 4 °C at 12,000g. Filtrates were stored at −80 °C and taken for LC–MS analysis.

Profiling of polar metabolites was done as previously described25 with minor modifications as described below. In brief, the analysis was performed using an Acquity I class UPLC System combined with a mass spectrometer (Thermo Exactive Plus Orbitrap), which was operated in a positive ionization mode using a mass range of 300–700 m/z. The LC separation was done using the SeQuant Zic-pHilic (150 mm × 2.1 mm) with the SeQuant guard column (20 mm × 2.1 mm) (Merck). The mobile phase B was acetonitrile and mobile phase A was 20 mM ammonium carbonate plus 0.1% ammonia hydroxide in water. The flow rate was kept at 200 μl min−1 and the gradient was as follows: 75% B (0–2 min), decrease to 25% B (2–14 min), 25% B (14–18 min), increase back to 75% B (18–19 min), 75% B (19–23 min). NAD+ and ADPR peaks were identified in the data using a synthetic standard run (Sigma, N8285 and A0752, respectively). NAD+ was detected at m/z 664.1182 (positive ionization mode) and a retention time of 7.8 min. ADPR was detected at m/z 560.0805 (positive ionization mode) and a retention time of 8.4 min. Area under the peak was quantified using MZmine 2.53 (ref. 26,27) with an accepted deviation of 5 ppm.

Cloning of BdTIR

The BdTIR gene from Brachypodium distachyon Bd21 (GenBank accession KQK15683.1; Refseq accession XP_003560074.3) was codon-optimized for E. coli expression using the Genscript codon optimization tool, and synthesized with an N-terminal Twin-Strep tag as described previously3. The gene was synthesized and cloned by Genscript Corp. into a pET30a vector between the NdeI and XhoI sites of the plasmid to fuse a C-terminal 6×His tag from the plasmid backbone (Supplementary File 8). Plasmids were then electroporated into E. coli BL21(DE3) cells, and grown in LB medium supplemented with 50 μg ml−1 kanamycin.

ThsA protein purification

Plasmid pAB15128 was used to generate a protein expression vector. The plasmid backbone was amplified using primers OGO724 + OGO725, and assembled with the sfGFP-Twin-Strep segments from the amyE shuttle vector amplified using primers OGO720 + OGO721. The Bacillus cereus MSX-D12 thsA gene was amplified from the thrC shuttle vector using primers OGO703 + OGO704 and assembled into the amyE shuttle vector backbone amplified using primers OGO657 + OGO658 to be fused with the C-terminal Twin-Strep tag. Then, the tagged gene was amplified using primers OGO720 + OGO721 and cloned into the pAB151 backbone (Supplementary File 9). Plasmids were constructed using the NEBbuilder HiFi DNA Assembly kit, propagated in E. coli DH5a cells, miniprepped, and then electroporated into E. coli BL21(DE3) cells. The ThsA(N112A) mutant gene was produced by Genscript Corp., and the ThsA(R371A) mutant was generated using NEB Q5 site-directed mutagenesis kit (NEB, E0554S) using primers OGO799 + OGO800.

The wild-type and mutated ThsA proteins (N112A and R371A), were expressed under the control of the T7 promoter together with a C-terminal Twin-Strep tag for subsequent purification. Expression was performed in 5 l LB medium supplemented with chloramphenicol (34 mg ml−1) in E. coli BL21(DE3) cells. Induction was performed with 200 mM IPTG at 15 °C overnight. The cultures were collected by centrifugation and lysed by a cooled cell disrupter (Constant Systems) in 100 ml lysis buffer composed of 20 mM HEPES 7.5, 0.3 M NaCl, 10% glycerol and5 mM β-mercaptoethanol, 200 KU/100 ml lysozyme, 20 µg ml−1 DNase, 1 mM MgCl2, 1 mM phenylmethylsulfonyl fluoride (PMSF) and protease inhibitor cocktail (Millipore, 539134). Cell debris were sedimented by centrifugation, and the lysate supernatant was incubated with 2 ml washed StrepTactin XT beads (IBA, 2-5030–025) for 1 h at 4 °C. The sedimented beads were then packed into a column connected to an FPLC allowing the lysate to pass through the column at 1 ml min−1. The column was washed with 20 ml lysis buffer. The ThsA variants were eluted from the column using elution buffer containing 50 mM biotin,100 mM Tris pH 8, 150 mM NaCl and 1 mM EDTA. Peaks containing ThsA were injected to a size-exclusion chromatography (SEC) column (Superdex 200_16/60, GE Healthcare, 28-9893-35) equilibrated with SEC buffer (20 mM HEPES pH 7.5, 200 mM NaCl and 2 mM DTT). Monomer peak was collected from the SEC column, aliquoted and frozen at −80 °C to be used for subsequent experiments.

Cell lysate preparation

Overnight cultures of the ThsB-expressing, ThsB(E85Q)-expressing, and GFP-expressing (control) strains were diluted 1:100 in MMB supplemented with 0.2% xylose and 100 µM IPTG, and incubated at 37 °C with shaking (200 rpm) until reaching an OD600 nm of 0.3 in a 1 cm cuvette. SPO1 phage stock was added to the culture to reach an MOI of 5. Flasks were incubated at 25 °C with shaking (200 rpm) for the duration of the experiment. Samples (2 × 50 ml) were collected at various time points after infection. Immediately after sample removal, the sample tube was placed on ice, and then centrifuged at 4 °C for 8 min to pellet the cells. The supernatant was discarded and the tube was frozen at −80 °C. To extract the metabolites, 300 µl of 100mM phosphate buffer at pH 8, supplemented with 4 mg ml−1 lysozyme, was added to each pellet. The tubes were then incubated for 5 min at 37 °C, and returned to ice. For the experiments presented in Figs. 2, 3, Two resuspended pellets of 50 ml culture each were united, and the thawed sample was transferred to a FastPrep Lysing Matrix B 2 ml tube (MP Biomedicals, 116911100) and lysed using a FastPrep bead beater for 40 s at 6 m s−1, two cycles. Tubes were then centrifuged at 4 °C for 15 min at 15,000g. Supernatant was transferred to an Amicon Ultra-0.5 Centrifugal Filter Unit 3 kDa (Merck Millipore, UFC500396) and centrifuged for 45 min at 4 °C at 12,000g. For the experiment presented in Fig. 4d, a single pellet from 50 ml culture sample was used, resuspended in 600 µl buffer and processed as described. Filtrate was taken and used for LC–MS analysis or enzymatic activity assays.

For BdTIR lysate preparation, an overnight culture of E. coli BL21(DE3) cells carrying the BdTIR plasmid was diluted 1:100 in LB, incubated at 37 °C with shaking (200 rpm) for 3 h, induced with 100 µM IPTG, and incubated for 3 additional hours. The culture was then collected in 50-ml tubes, centrifuged for 8 min at 4 °C to pellet the cells, the supernatant was discarded and pellets were frozen at −80 °C. Cell lysate preparation was performed as described above from a single pellet of 50 ml culture sample. For the control lysates, the same process was done with cells expressing GFP from the pAB151 vector backbone.

ThsA NADase activity assay

The NADase reaction was performed in black 96-well half area plates (Corning, 3694). In each reaction microwell, ThsA purified protein was added to cell lysate or 100 mM sodium phosphate buffer pH 8 supplemented with cADPR standard (Sigma, C7344) to a final concentration of 100 nM protein in a 50 µl final volume reaction. Five microlitres of 5 mM nicotinamide 1,N6-ethenoadenine dinucleotide (εNAD, Sigma, N2630) solution was added to each well immediately before the beginning of measurements and mixed by pipetting to reach a concentration of 500 µM in the 50 µl final reaction volume. Plates were incubated inside a Tecan Infinite M200 plate reader at 25 °C, and measurements were taken every 1 min at 300 nm excitation wavelength and 410 nm emission wavelength. Reaction rate was calculated from the linear part of the initial reaction or from the rate during the first minute for fast reactions.

LC–MS identification of Thoeris cADPR isomer

Cell lysates were prepared as described above and sent for analysis at MS-Omics. Sample analysis was carried out by MS-Omics as follows. Samples were diluted 1:1 in 10% ultra-pure water and 90% acetonitrile containing 10 mM ammonium acetate at pH 9, then filtered through a Costar Spin-X centrifuge tube filter 0.22-μm nylon membrane. The analysis was carried out using a Vanquish Horizon UHPLC System coupled to a Q Exactive HF Hybrid Quadrupole-Orbitrap Mass Spectrometer (Thermo Fisher Scientific). The UHPLC was performed using an Infinity Lab PoroShell 120 HILIC-Z PEEK lined column with dimensions of 2.1 × 150 mm and a particle size of 2.7 µm (Agilent Technologies). The composition of mobile phase A was 10 mM ammonium acetate at pH 9 in 90% acetonitrile LC–MS grade (VWR Chemicals) and 10 % ultra-pure water from Direct-Q 3 UV Water Purification System with LC-Pak Polisher (Merck KGaA) and mobile phase B was 10 mM ammonium acetate at pH 9 in ultra-pure water with 15 µM medronic acid (InfinityLab Deactivator additive, Agilent Technologies). The flow rate was kept at 250 µl ml−1 consisting of a 2 min hold at 10% B, increased to 40% B at 14 min, held till 15 min, decreased to 10% B at 16 min and held for 8 min. The column temperature was set at 30 °C and an injection volume of 5 µl. An electrospray ionization interface was used as ionization source. Analysis was performed in positive ionization mode from m/z 300 to 900 at a mass resolution of 120,000 (at m/z 200). Peak areas were extracted using Compound Discoverer 3.1 (Thermo Fisher Scientific) with an accepted deviation of 3 ppm. The standard cADPR peak was identified using a synthetic standard run (Sigma-Aldrich, C7344). MS/MS spectra collection was performed using the same instrument at a resolution of 30,000. Fragmentation was done through a higher-energy collisional dissociation cell using a normalized collision energy of 20, 40 and 60 eV where the spectrum is the sum of each collision energy.

Structural superimposition of ThsA and TRPM2

The structures of B. cereus MSX-D12 ThsA (PDB code 6LHX) and human TRPM2 bound to Ca2+ and ADPR (PDB code 6PUS) were downloaded from the PDB29. The SLOG domain of ThsA was defined as residues 281–471 of chain A of 6LHX. The SLOG domain of TRPM2 was defined as residues 167–437 of chain C of 6PUS. The domains were aligned using the ‘super’ structural imposition function of PyMOL (Schrödinger LLC) v.2.4.0 with 25 cycles limit. Residues 247–277 and 370–412 of 6PUS did not align with ThsA and were not represented in the visualization shown in Fig. 3d for clarity.

Mass photometry analysis of ThsA protein particles

Mass photometry30 measurements were acquired using a OneMP mass photometer (Refeyn Ltd). Microscope coverslips (no. 1.5, 24 × 50 Marienfeld, 0107222) were cleaned by sequential sonication in 50% isopropanol (HPLC grade)/Milli-Q H2O, and Milli-Q H2O (5 min each), followed by drying with a clean nitrogen stream. Four reusable culturewell gaskets 3 mm diameter × 1 mm depth (Sigma, GBL103250-10EA) were cut, washedwith ethanol followed by MilliQ water and dried using nitrogen stream. Dried gaskets were placed at the centre of the coverslip, where each well was used for one measurement. To find focus, fresh 100 mM sodium phosphate pH 8 buffer (15 µl) was first loaded into the well, the focal position was identified and secured in place for the entire measurement, with an autofocus system based on total internal reflection.

Purified ThsA protein was diluted to a concentration of 1 µM in sodium phosphate buffer. One microlitre of the diluted protein was added to 8 µl of lysate derived from SPO1-infected bacteria, 70 min after infection, of bacteria expressing either ThsB or ThsB(E85Q). The lysate was supplemented with 1 µl of 10 mM NAD+ to a final concentration of 1 mM NAD+. The protein was incubated in the lysate + NAD+ for 5 min before introduction into the mass photometer. For each acquisition, 5 µl of diluted protein in lysate was introduced into the measurement well with the loaded buffer and mixed several times. After autofocus stabilization, movies were recorded for a duration of 60 s. Data acquisition was performed using AcquireMP (Refeyn Ltd, v.2.3) and data analysis was performed using DiscoverMP (Refeyn Ltd, v.2.3).

Data analysis

Data analysis was performed using Microsoft Excel 2016 and MATLAB R2020a. Graph plotting and statistical analysis was performed using MATLAB.

Reporting summary

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