All the mice used in the study were housed in specific pathogen-free conditions with a 12 h dark–light cycle and were housed in individually ventilated filter cages with autoclaved food and bedding at the Yale University animal facility. The Tlr9−/− NOD mice were generated by backcrossing Tlr9−/− C57BL/6 mice  with our NOD mice, for over 11 generations. The purity of the NOD genetic background was confirmed by mouse genome SNP scan with Illumina Infinium panel (DartMouse, Lebanon, NH, USA). Tlr9−/− NOD.Scid mice were generated by breeding Tlr9−/− NOD mice with NOD.Scid mice, which were originally purchased from the Jackson Laboratory (Bar Harbor, ME, USA) and maintained at Yale University for ~25 years. Wild-type (WT) C57BL/6 (Tlr9+/+ C57BL/6) mice were also purchased from the Jackson Laboratory and maintained at Yale University for ~10 years. The use of the animals in this study was approved by the IACUC of Yale University. All mice used in different experiments were randomly selected from different breeding cages and different litters. Experimenters were not blinded in this study.
Natural history of diabetes development
Tlr9−/− NOD mice and Tlr9+/+ NOD littermates were screened for glycosuria weekly for spontaneous diabetes development, up to 32 weeks of age. Diabetes was confirmed by blood glucose of ≥13.9 mmol/l with a FreeStyle glucose meter (Abbott, Chicago, IL, USA).
Streptozotocin-induced diabetes development
Female Tlr9−/− NOD mice and Tlr9+/+ NOD littermates (5–6 weeks old) were treated with either high-dose streptozotocin (STZ) (100 mg/kg, administered by two consecutive i.p. injections, 24 h apart) or low-dose STZ (40 mg/kg, administered by i.p. injection, once daily, for 5 days). Mice were screened for glycosuria daily for diabetes development and confirmed as above.
Intra-peritoneal glucose tolerance test
Intra-peritoneal glucose tolerance tests (IPGTTs) were performed in 5–6-week-old Tlr9−/− NOD, Tlr9+/+ NOD, Tlr9−/− C57BL/6, Tlr9+/+ C57BL/6, Tlr9−/− NOD.Scid and Tlr9+/+ NOD.Scid mice. The mice were fasted overnight with free access to water and the blood glucose was measured before (time zero) and after i.p. injection of glucose (1 g/kg) at different time points from blood samples. Blood glucose was measured by a FreeStyle glucose meter (Abbott). Data are shown from one out of three experiments, each confirming the significant difference.
Insulin tolerance test
Insulin tolerance tests (ITTs) were performed in 5–6-week-old male Tlr9−/− C57BL/6 mice and Tlr9+/+ C57BL/6 mice. The mice were fasted for 6 h with free access to water and the blood glucose was measured before and after i.p. injection of insulin (Humulin-R, 0.75 U/kg; Eli Lilly, Indianapolis, IN, USA) at different time points, as described for IPGTT.
Islet and beta cell isolation
Pancreatic islets were isolated as previously described . Mice were euthanised by cervical dislocation. The pancreas was inflated with 3 ml cold collagenase (Sigma; St Louis, MO, USA) solution (0.3 mg/ml) through the bile duct with a 20G needle starting at the gall bladder. The pancreas was then removed into a siliconised glass tube containing 2 ml of 1 mg/ml collagenase solution and digested at 37°C in a water bath for 12–15 min. After three washes of the digested pancreas, islets were hand-picked and counted under a dissecting microscope for further experiments. For single-cell isolation, the islets were treated with Cell Dissociation Solution (Sigma) and the single-cell suspension was harvested. Beta cells from the dissociated islets were stained with fluorochrome-conjugated monoclonal antibodies to CD45 (BioLegend; San Diego, CA, USA), CD140a (BioLegend) and FluoZin-3-acetoxymethyl (AM) (CD45−FluoZin-3-AM+; ThermoFisher, Waltham, ME, USA)  before being analysed by flow cytometry (LSRII; BD Bioscience, San Diego, CA, USA).
Pancreatic islets were isolated as described above. RNA from islets of 3–4-week-old female Tlr9+/+ NOD mice and Tlr9−/− NOD mice was extracted with an RNAeasy kit (Qiagen, Hilden, Germany) and quantified by NanoDrop (ThermoFisher). Equal amounts of RNA were reverse transcribed using SuperScript III First-strand synthesis kit with random hexamers (Invitrogen, Carlsbad, CA, USA). Quantitative PCR (qPCR) was performed using the Bio-Rad iQ5 qPCR detection system (Hercules, CA, USA) with the specific primers for Pdx-1 (also known as Pdx1) (5′-CAGCAGAACCGGAGGAGAAT-3′ and 5′-CGACGGTTTTGGAACCAGAT-3′) and Ngn3 (also known as Neurog3) (5′-CCCGCAGCTCTCTGTTCTTT-3′ and 5′-GGGTCTCTTGGGACACTTGG-3′) (Sigma). The relative expression of mRNA levels was determined with the 2−∆∆Ct method by normalisation with the housekeeping gene Gapdh (5′-AGGTCGGTGTGAACGGATTTG-3′ and 5′-TGTAGACCATGTAGTTGAGGTCA-3′).
Cell staining for flow cytometry
For direct staining, single-cell suspensions (~5 × 104 to 2 × 105 cells) of immune cells or islet cells were incubated with a 2.4G2 Fc-blocking antibody (10 mins, room temperature) prior to staining with pre-titrated amounts of monoclonal antibodies conjugated with different fluorochromes to combinations of CD3 (17A2), CD4 (GK1.5), CD44 (IM7), CD45 (30-F11) CD62L (MEL-14), CD140a (APA5) and a viability dye (all from BioLegend) in staining buffer (PBS containing 1% FCS) and kept on ice and in the dark for 30 min. The cells were washed twice with 2 ml staining buffer and fixed with 200 μl fixation buffer (eBioScience; San Diego, CA, USA) before analysis by flow cytometry. All antibodies were titrated using mouse splenocytes at different dilutions with the final dilution applied found to be most appropriate for the particular batch of antibody used and our flow cytometer set up.
For intracellular staining, the single-cell suspension was treated with Perm/Fix buffer (eBioscience) followed by pre-titrated monoclonal antibodies conjugated with different fluorochromes to FoxP3 (FJK-16S, eBioscience) or FluoZin-3-AM (ThermoFisher). After 30 min incubation on ice or at room temperature, the cells were washed twice with 2 ml staining buffer and analysed by flow cytometry. FoxP3 was titrated using mouse splenocytes at different dilutions with the final dilution applied found to be appropriate for the batch used and our flow cytometer set up. For Fluozin-3-AM, mouse islets were used to titrate the antibody, with 1:2000 dilution used found to be appropriate for the particular batch of antibody used and our flow cytometer set up. Dilutions were determined where they gave the clearest separation from the negative background or isotype control.
Insulin release assay
An insulin release assay was performed as previously described  with modification. Hand-picked pancreatic islets from randomly selected Tlr9−/− and Tlr9+/+ NOD or C57BL/6 mice (5–6 weeks old) were equally distributed to 30 islets/tube after stabilising with low-glucose KRB buffer. The islets were then stimulated with KRB containing high glucose (25 mmol/l) and the supernatant fractions were harvested every 5 min after glucose stimulation. Secreted insulin in the supernatant fractions was measured using the insulin RIA kit (EMD-Millipore, Burlington, ME, USA).
Evaluation of islet mass
Ex vivo pancreases from randomly selected 5–6-week-old female Tlr9−/− NOD and Tlr9+/+ NOD mice were fixed in periodate–lysine–paraformaldehyde, sucrose infused and then frozen in Tissue-Tek OCT (Bayer, Elkhart, IN, USA). The pancreas was cut in its entirety into hundreds of 10 μm thick sections and every tenth section was stained with haematoxylin alone (to better visualise the islets) and photographed under the microscope. Islet mass was measured using Image J software (NIH, Bethesda, MD, USA). H&E staining of sections was conducted purely for improving the contrast of the images for the photographs presented in Fig. 4b.
In vitro TLR9 antagonist treatment
Freshly isolated islets from Tlr9+/+ NOD mice (5-week-old females) were cultured overnight with the TLR9 antagonist CpG- oligodeoxynucleotides (ODN) (2088; Invivogen, San Diego, CA, USA) or control CpG-ODN (Invivogen), both at 10 μg/ml. After extensive washing, a single-cell suspension was prepared as described earlier and stained with fluorochrome-conjugated monoclonal antibodies to CD45, CD140a and FluoZin-3-AM before analysis by flow cytometry. Another set of freshly isolated islets from Tlr9+/+ NOD mice was used for insulin release assay, after overnight culture in the presence of the TLR9 antagonist CpG-ODN or control CpG-ODN.
In vivo treatment with TLR9 antagonist or chloroquine and diabetes development
Randomly chosen Tlr9+/+ female NOD mice were treated with TLR9 antagonist CpG-ODN (2088) or control ODN, 10 μg/mouse, administered as two i.p. injections, 3 days apart, 1 week after mating. Another set of randomly chosen Tlr9+/+ pregnant female NOD mice were treated with chloroquine (20 μg/g body weight), administered as two i.p. injections, 3 days apart. The female offspring from the treated mothers were investigated for CD140a-expressing islet beta cells, the number of islet beta cells and insulin-secreting function at ~5 weeks old. A third group of randomly chosen pregnant female Tlr9+/+ NOD mice were also treated with antagonist CpG-ODN or control ODN and the natural history of diabetes development was observed in the female progeny of the treated pregnant mice.
No data were excluded and all viable mice within the different genotypes were included, with the exception of any obvious runts or under-developed mice. No outcomes or conditions were measured or used that are not reported in the results section. Statistical analyses were performed using GraphPad Prism software (San Diego, CA, USA). Diabetes incidence was compared using logrank test. The in vivo and in vitro assays were analysed with Student’s unpaired t test or ANOVA for statistical significance.