Source-linked AI summary
PhaTYP: Predicting the lifestyle for bacteriophages using BERT
Jiayu Shang, Xubo Tang, Yanni Sun
TL;DR
Phage lifestyle prediction is difficult because annotations are scarce and existing methods perform poorly on short contigs, motivating a computational approach for metagenomic data. PhaTYP combines BERT-based protein representations with self-supervised and fine-tuning tasks, and it outperforms available methods, including on short contigs, while supporting neonatal gut analysis.
Problem
Limited lifestyle annotations and the abundance of metagenomic phage contigs make accurate prediction difficult, particularly for short contigs.
Method
PhaTYP uses BERT to learn protein composition and associations through self-supervised learning followed by lifestyle-prediction fine-tuning.
Results
PhaTYP achieves the highest performance on complete genomes and improves short-contig accuracy by over 10% against state-of-the-art methods.
Takeaways & Limitations
PhaTYP provides a means to analyze phage composition and lifestyle in metagenomic data, including human neonates’ gut data.
Takeaways & Limitations
Training currently requires substantial computational resources, including four 24Gb GPU units.
Abstract
from arXiv · showhide
Bacteriophages (or phages), which infect bacteria, have two distinct lifestyles: virulent and temperate. Predicting the lifestyle of phages helps decipher their interactions with their bacterial hosts, aiding phages' applications in fields such as phage therapy. Because experimental methods for annotating the lifestyle of phages cannot keep pace with the fast accumulation of sequenced phages, computational method for predicting phages' lifestyles has become an attractive alternative. Despite some promising results, computational lifestyle prediction remains difficult because of the limited known annotations and the sheer amount of sequenced phage contigs assembled from metagenomic data. In particular, most of the existing tools cannot precisely predict phages' lifestyles for short contigs. In this work, we develop PhaTYP (Phage TYPe prediction tool) to improve the accuracy of lifestyle prediction on short contigs. We design two different training tasks, self-supervised and fine-tuning tasks, to overcome lifestyle prediction difficulties. We rigorously tested and compared PhaTYP with four state-of-the-art methods: DeePhage, PHACTS, PhagePred, and BACPHLIP. The experimental results show that PhaTYP outperforms all these methods and achieves more stable performance on short contigs. In addition, we demonstrated the utility of PhaTYP for analyzing the phage lifestyle on human neonates' gut data. This application shows that PhaTYP is a useful means for studying phages in metagenomic data and helps extend our understanding of microbial communities.
1 Introduction
Phage lifestyle annotations matter for understanding phage–host interactions and applications, but experimental annotation cannot match sequencing growth. Computational prediction is therefore attractive yet challenged by scarce labels, metagenomic scale, and reduced accuracy on short contigs.
- Virulent phages kill hosts without genome integration, whereas temperate phages integrate into host chromosomes and can later enter the lytic cycle.
- Lifestyle annotation supports understanding phage composition, microbial interactions, and applications including phage therapy.
- 1,290 virulent and 577 temperate phages were annotated versus 4,517 RefSeq phages in 2021, while IMG/VR v3 contained nearly 2 million uncultivated phage-like genomes.
- Marker-gene approaches are constrained because few genes identify lifestyles, especially among virulent phages.
- Short-contig prediction remains difficult: PHACTS accuracy decreases on short contigs, limiting the applicability of such strategies to metagenomic data.
- PhaTYP uses contextualized BERT embeddings of protein composition and associations, improving short-contig accuracy by over 10% while achieving the highest performance on complete genomes.
2 Method
PhaTYP converts phage contigs into protein-based token sequences and applies an eight-layer bidirectional Transformer. It combines self-supervised masked-token learning on broad phage data with supervised fine-tuning for virulent-versus-temperate classification.
- 2 Method: PhaTYP treats proteins as sentence tokens and uses an eight-layer bidirectional Transformer to learn protein composition and associations.
- Fine-tuning: The fine-tuning task uses phages with known lifestyle annotations to output probabilities for virulent and temperate classes.
- Self-supervised training: The self-supervised task masks proteins and learns to recover the original token using all available RefSeq phage genomes.
- Sequence embedding: Prodigal predicts genes, DIAMOND BLASTP assigns proteins to clusters, and the resulting contigs become protein-based sentences capped at 300 tokens.
- Sequence embedding: A learnable embedding layer combines token and positional information into a dense 300×512 representation instead of a sparse 300×63,855 one-hot matrix.
- Model structure: Multi-head attention extracts associations between protein tokens, while feed-forward layers, residual connections, and layer normalization form the Transformer block.
3 Result
PhaTYP was evaluated against existing lifestyle-prediction tools on complete genomes, low-similarity genomes, short contigs, and case-study data. It achieved the best reported performance in several comparisons, while revealing trade-offs involving runtime, sequence length, and training similarity.
- Complete genomes: PhaTYP, DeePhage, and BACPHLIP achieved high accuracy on complete phage genomes, with PhaTYP showing the best ROC-curve performance.The comparison used averaged ten-fold evaluation, and ROC curves assessed sensitivity-specificity tradeoffs.
- Complete genomes: PhaTYP identified temperate phages with higher specificity than the other tools, and self-supervised training improved classification accuracy.Detailed complete-genome results were reported under default score cutoffs.
- Runtime: PhaTYP was not the fastest method because approximately 85% of its runtime was spent running DIAMOND BLASTP, while DeePhage required less time using k-mer features alone.The runtime comparison covered ten-fold cross-validation on the specified CPU and GPU hardware.
- Low-similarity test set: Lower similarity between test and training genomes affected specificity more than sensitivity, but PhaTYP still achieved the best results on the harder test set.AUCROC decreased for all methods except BACPHLIP, likely because its provided training data overlapped with the test phages.
- Short contigs: Short-contig performance generally increased with contig length, while self-supervised learning improved PhaTYP’s accuracy when classification information was limited.The authors plausibly attribute this benefit to more generalized protein embeddings that reduce overfitting and provide prior knowledge.
- Infant-gut case study: In infant-gut data, the percentage of temperate phages decreased as infants grew, and delivery type was associated with lifestyle composition at month 0.The authors report that the trend was also observed among newly colonized phages and that delivery-related differences became smaller with age.
- Infant-gut case study: Feeding type showed little difference at month 1, but the proportion of temperate phages decreased more rapidly with formula feeding than with mixed feeding by later sampling.The comparison used infant samples at months 1 and 4.
4 Discussion
PhaTYP combines self-supervised protein-association learning with fine-tuning for lifestyle prediction, achieving stable short-contig performance and accurate predictions across tested data. Its application to neonatal gut data supports its use for analyzing phage composition, while computational cost remains an optimization target.
- PhaTYP uses self-supervised learning for protein association and fine-tuning for lifestyle prediction.
- PhaTYP achieves more stable performance on short contigs than other lifestyle-prediction methods.
- PhaTYP’s neonatal gut application yielded insights into early viral colonization that were mostly consistent with recently published studies.
- Training currently requires substantial computational resources, including four 24Gb GPU units, motivating knowledge distillation for a lighter model.
- PhaTYP achieves the most accurate lifestyle prediction among available tools on simulated and real sequencing data.
7 Funding
The work was supported by City University of Hong Kong and the Hong Kong Innovation and Technology Commission.
- City University of Hong Kong provided support through Projects 9678241 and 7005453.
- The Hong Kong Innovation and Technology Commission provided support through InnoHK Project CIMDA.
- The listed funding sources are City University of Hong Kong and the Hong Kong Innovation and Technology Commission.