ScienceMicrobiologyPeer-reviewed journal article
DefensePredictor: A Machine Learning Model to Discover Novel Prokaryotic Immune Systems
Abstract
Anti-phage defense systems protect bacteria from viruses. Studying defense systems has begun to reveal the evolutionary roots of eukaryotic innate immunity and produced important biotechnologies such as CRISPR-Cas9. Dozens of new systems have been discovered by looking for systems that co-localize in genomes, but this approach cannot identify systems outside defense islands. Here, we present DefensePredictor, a machine-learning model that leverages embeddings from a protein language model to classify proteins as defensive. We applied DefensePredictor to 69 diverse E. coli strains and validated 45 previously unknown systems, with >750 additional unique proteins receiving high confidence predictions. Our model, provided as open-source software, will help comprehensively map the anti-phage defense landscape of bacteria, further reveal connections between prokaryotic and eukaryotic immunity, and accelerate biotechnology development.
- organism: E. coli
- organism: bacteria (other)
- organism: virus
- assay: protein sequence
- assay: whole-genome sequencing
- assay: protein structure
- assay: proteomics
- research focus: sequence-to-function modeling
- research focus: software / tool
- research focus: cell type annotation
- approach: transformer / foundation model
- approach: machine learning (classical)
- approach: experimental assay
- approach: deep learning
In-depth summary
Claude Opus 5.5 · xhigh effort · 5 Nov 2026 · from the full text of version 1 (8 Jan 2025) · CC BY-NC 4.0
DefensePredictor combines ESM2 protein language model embeddings with genomic context features in a gradient boosting classifier to identify prokaryotic anti-phage defense genes, validating 45 previously unknown Escherichia coli systems.
Existing anti-phage defense discovery methods rely on genomic co-localization within defense islands or laborious experimental screens, missing systems located elsewhere. By combining protein language model embeddings of a center gene and its neighbors with genomic features, DefensePredictor detects anti-phage defense genes across entire prokaryotic genomes regardless of defense island proximity.
Key results
ShownDefensePredictor outperforms guilt-by-association and remote homology searches on a held-out test set of unseen defense protein families.
Trained on ~100,000 positive defense genes (229 HMM clusters) and ~1.6 million negative genes from 17,454 RefSeq genomes using 3,319 ESM2 and genomic features, DefensePredictor achieved an Average Precision (AP) of 0.95 on a test set of ~10,000 defense genes (40 unseen HMM clusters) and ~166,000 negative genes, compared to AP = 0.38 for guilt-by-association, 0.33 for HMM alignment, and 0.7 for ESM2 cosine similarity. · DefensePredictor achieves high precision and…; Dataset assembly; Figure legends
ShownApplying DefensePredictor to 69 Escherichia coli strains predicts 782 unique defense protein clusters, 85% of which reside outside canonical defense islands.
At a probability cutoff of 0.999 (log-odds > 7.2), DefensePredictor identified ~2,500 defense genes out of 321,347 genes across 69 E. coli strains (vs 395 by DefenseFinder), clustering into 782 unique proteins including 235 without detectable homology (>=50% coverage) to known defense proteins; 20% reside in plasmids, 24% in prophages, and only 15% within 10 genes of a known defense gene. · Prediction of novel defense genes in a diverse…; Figure legends
ShownExperimental plaque assays validate 45 predicted transcriptional units (TUs) against a panel of 24 E. coli phages and identify 10 functional domains not previously validated in phage defense.
Cloning 106 predicted TUs into E. coli MG1655 validated 45 systems (42%, DS-1 to DS-45) that reduced plating efficiency >=10-fold or plaque size, with validation correlating with predicted log-odds (r = 0.94); mutagenesis confirmed essential residues in domains including an SMPDL3A-like metallophosphatase (DS-8, DS-9), CBS domain (DS-11), HipA-like kinase (DS-6), diadenylate cyclase (DS-2), and PIN ribonucleases. · Predicted novel defense systems provide…; Novel defense domains are essential for…; Figure legends
ShownPangenome-scale application across 3,000 E. coli and 500 diverse prokaryotic genomes reveals thousands of uncharacterized defense protein clusters without saturation.
DefensePredictor predicted an average of 28 defense systems per genome across 3,000 E. coli/Shigella genomes (vs 4.5 for DefenseFinder), yielding 1,374 unique uncharacterized defense protein clusters (only 4% and 3% detected by DefenseFinder 1.3.0 and PADLOC 2.0.0), and averaged 27 systems per genome across 500 diverse bacterial genomes (vs 6.2 for DefenseFinder), totaling 3,376 unique uncharacterized clusters. · Thousands of predicted novel defense genes…; Predicting defense systems in set of 3,000 E…; Figure legends
Methods, data and reproducibility
Extracted 640-D ESM2 embeddings and 119 genomic features (GC content, dinucleotide frequencies, length, spacing, orientation) across 5-gene windows from 17,454 RefSeq genomes to train a LightGBM classifier (DefensePredictor). Predicted defense genes across 69 E. coli strains, 3,000 E. coli/Shigella genomes, and 500 diverse prokaryotic genomes, and experimentally tested 106 TUs against 24 phages in E. coli MG1655.
- Bacterial, archaeal, and viral representative and reference genomes from RefSeq (May 2, 2023) for training, validation, and testing · multiple species (bacteria, archaea, viruses) · n = 17,454 genomes (~244,000 positive defense homologs, ~14 million negative genes)
- Diverse Escherichia coli strains (primarily ECOR collection) for defense prediction and experimental validation in E. coli MG1655 against 24 phages · E. coli · n = 69 strains (321,347 genes); 106 TUs tested against 24 phages
- Assembled Escherichia coli and Shigella genomes and diverse prokaryotic genomes from NCBI for pangenome scaling analysis · multiple species (E. coli, Shigella, bacteria) · n = 3,000 E. coli/Shigella genomes and 500 diverse bacterial genomes
- Methods & tools
- DefensePredictor, ESM2 (esm2_t30_150M_UR50D), LightGBM, DefenseFinder, MMseqs2, HHblits, HHpred, HMMER, geNomad, AlphaFold3, PADLOC, optuna
- Code
- https://github.com/PeterDeWeirdt/defense_predictorhttps://github.com/PeterDeWeirdt/defense_predictor_manuscript
- Software & environment
- DefenseFinder versions 1.2.2 and 1.3.0; PADLOC 2.0.0; ESM2 model esm2_t30_150M_UR50D; Pfam35 database; UniRef30_2019_11; LightGBM; optuna; shap (S11, S12, S15, S16, S25).
- Assay conditions & compute
- Run on MIT Supercloud nodes equipped with Nvidia Volta V100 GPUs and Xeon Platinum 8260 / Gold 6248 CPUs; scores a prokaryotic genome in <5 minutes (S2, S10).
Limitations (3)
- DefensePredictor has an estimated in silico false negative rate of ~25% at the protein family level (predicting >50% of members in 30 of 40 test HMM clusters) and did not recover all defense genes found by homology tools (S3, S9). · stated by the authors
- Unvalidated candidate systems in the experimental screen may reflect false positives, phages not included in the 24-phage panel, inadequate expression in E. coli K-12 MG1655, or inaccurate transcriptional unit boundary definitions (S9). · stated by the authors
- Because the training set is enriched for defense systems identified or validated in E. coli, model performance on distantly related prokaryotic species remains to be experimentally verified (S9). · stated by the authors
Read this if you mine microbial genomes or mobile genetic elements for anti-phage defense systems, or apply protein language models to functional gene discovery.
- Citations
- 44
- FWCI
- 114.74
- Field percentile
- top 1%
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- Protein and genomic language models chart a vast landscape of antiphage defenses
Ernest Mordret, Alexandre Hervé, … Aude G. Bernheim·bioRxiv·Jan 8, 2025
- Exploring the diversity of anti-defense systems across prokaryotes, phages, and mobile genetic elements
Florian Tesson, Erin D. Huiting, … Aude G. Bernheim·Nucleic Acids ResearchPeer-reviewed·Dec 6, 2024
- Mapping the landscape of anti-phage defense mechanisms in the E. coli pangenome
C. Vassallo, C. Doering, … M. T. Laub·bioRxiv·May 12, 2022
- New antiviral defences are genetically embedded within prokaryotic immune systems.
L. J. Payne, T. C. D. Hughes, … S. A. Jackson·bioRxiv·Jan 29, 2024
- Leveraging defense system modularity to discover anti-phage systems
Liu yanqiu, Tan keyi, … Wenyuan Han·bioRxiv·Dec 8, 2025
- An expanding arsenal of immune systems that protect bacteria from phages
A. Millman, S. Melamed, … R. Sorek·bioRxiv·May 11, 2022