Source-linked AI summary
PhaTYP: Predicting the lifestyle for bacteriophages using BERT
Jiayu Shang, Xubo Tang, Yanni Sun
TL;DR
Computational phage-lifestyle prediction is challenged by limited annotations and short contigs. PhaTYP uses self-supervised learning and fine-tuning with a BERT-based model; it outperforms available methods and achieves more stable performance on short contigs.
Problem
Computational phage-lifestyle prediction is challenged by few annotated reference phages, while lifestyle annotations matter for phage applications.
Source: §1 · pp. 1–2Method
PhaTYP uses BERT-based contextual representations to learn protein composition and associations, with self-supervised learning followed by fine-tuning for lifestyle prediction.
Source: §1.2 · p. 2, §2 · p. 2, §4 · p. 13Results
PhaTYP outperformed available lifestyle-prediction methods and achieved more stable performance on short contigs.
Source: §4 · pp. 12–13Takeaways & Limitations
PhaTYP provides a means to study phage composition in metagenomic data, including early viral colonization in human neonates.
Source: §4 · p. 13Training PhaTYP requires substantial computational resources, including four 24Gb GPU units to accelerate training.
Source: §4 · p. 13
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
PhaTYP applies BERT to phage lifestyle prediction, addressing scarce annotations and fragmented metagenomic contigs. The paper reports improved performance, particularly on short contigs.
1 Introduction
- Virulent phages support therapy, while temperate phages can engineer host genomes and functions; costly, slow culturing motivates computational annotation of metagenomic phages.Source: §1 · pp. 1–2
- Only 1,290 virulent and 577 temperate phages had known labels, while metagenomic genomes reach nearly 2 million; incomplete, ambiguous fragments compound prediction difficulty.Source: §1 · p. 2
1.1 Related work
- Marker genes risk low recall on fragments; PHACTS reaches ~60% below 2 kbp, BACPHLIP is for complete genomes, while DeePhage handles 100-bp contigs but tops ~80%.PhagePred instead uses learned k-mer-frequency Markov distances.Source: §1.1 · p. 2
1.2 Overview
- PhaTYP achieves the highest performance on complete genomes and improves short-contig accuracy by over 10% against state-of-the-art methods.Source: §1.2 · p. 2
- PhaTYP uses BERT contextualized embeddings to learn protein composition and associations from phage genomes, evaluating contigs of different lengths and real metagenomic assemblies.Source: §1.2 · p. 2
2 Method
PhaTYP adapts an eight-layer bidirectional Transformer to protein-tokenized phage genomes, pairing masked-language pretraining on RefSeq phages with lifestyle-classification fine-tuning to address limited annotations and short contigs.
2.1 Sequence embedding
- Phage proteins are clustered into 63,855 vocabulary tokens, and contigs are translated, assigned their best-alignment tokens, truncated or padded to 298 tokens, then combined with learned token and position embeddings.Prodigal identifies genes; DIAMOND BLASTP matches query proteins to clusters. The 512-dimensional embeddings are trained end-to-end.Source: §2.1 · pp. 3–4
2.2 Model structure
- PhaTYP stacks eight Transformer blocks, each using eight-head attention to learn associations among protein tokens, with feed-forward layers, residual connections, and layer normalization.The Transformer output retains the embedding dimensions, allowing each position to represent latent features for its protein token.Source: §2.2 · p. 4
2.3 Self-supervised training for Masked LM
- Masked-language pretraining uses all available RefSeq phage genomes to learn protein associations by predicting masked tokens, including genomes without lifestyle annotations.The dataset contains 3,474 genomes and 142,434 contigs; 5% of sentence tokens are randomly masked for cross-entropy training.Source: Figure 1 · p. 3, §2.3 · p. 5
2.4 Fine-tuning the model for lifestyle classification
- For lifestyle fine-tuning, PhaTYP classifies phages as virulent or temperate from the [CLS] output, using augmented fragments from 100 bp to 20 kbp.The dataset comprises 1,290 virulent and 577 temperate phages; augmentation yields 160,000 contigs, and a fully connected layer predicts the two classes.Source: Figure 1 · p. 3, §2.4 · p. 6
2.5 Model training
- Both training tasks use ten-fold cross-validation and Adam at a 0.001 learning rate; the lowest-loss pretraining model is fine-tuned, and the best-AUCROC model is retained.Training used four GTX 2080Ti GPUs.Source: §2.5 · p. 6
3 Result
Across genome benchmarks, short contigs, crAssphages, and infant-gut metagenomes, PhaTYP generally performed well and revealed age- and delivery-associated patterns in predicted phage lifestyles.
3.1 Classification performance comparison using ten-fold cross-validation
- PhaTYP had the best ROC performance on complete genomes and higher specificity for identifying temperate phages than the other tools.The ablation study also found that self-supervised learning improved classification accuracy.Source: Figure 4 · p. 7, §3.1 · p. 7, Table 2 · p. 7
- On the low-similarity test set, PhaTYP still had the best results, while test-set similarity affected specificity more than sensitivity and AUCROC decreased for all methods except BACPHLIP.The authors suggest BACPHLIP’s exception may reflect overlap between the test phages and its provided-model training data.Source: Figure 5 · p. 8, §3.1 · p. 8, Table 4 · p. 8
- PhaTYP outperformed the other tools on short contigs, and its accuracy improved with fragment length while self-supervised learning helped especially on short sequences.Training one model with contigs of different lengths and their complete genomes did not affect classification performance, allowing one model to handle multiple length ranges and save computational resources.Source: Figure 6 · p. 9, §3.1 · pp. 9–10
3.2 Predicting the lifestyle of crAssphages
- PhaTYP correctly classified all 33 tested crAssphages as virulent, while PhagePred ranked second and improved relative to earlier experiments.The authors suggest PhagePred’s k-mer frequency feature may be important for crAssphages.Source: Figure 7 · p. 10, §3.2 · p. 10
3.3 Case study: phage lifestyle analysis for infants
- Among 2,291 metagenomic phage contigs, 23 with integrase homology (identity >90%, coverage >90%, e-value <1e-10) were labeled temperate; PhaTYP and DeePhage correctly classified all 23, while integrase classified only ~1%.Source: §3.3 · p. 11, Figure 8 · p. 11
- Predicted temperate-phage proportions decreased as infants grew, and the same trend among newly colonized phages had a smaller p-value; these findings were consistent with the original study.The authors interpret the pattern as a shift from prophages induced from pioneer bacteria toward more environmentally acquired phages and bacteria as infants grow.Source: §3.3 · p. 11, Figure 9 · p. 12
- Delivery type was associated with phage lifestyle composition at month 0, and the difference among delivery types gradually diminished with age.The authors suggest, following, that environmental contamination differences between delivery types may affect the gut microbiome at month 0.Source: Figure 10 · p. 12, §3.3 · p. 12
- Feeding type showed little difference at month 1, but the predicted temperate-phage proportion declined more rapidly by month 4 among formula-fed infants than among mixed-fed infants.The authors propose that breastfeeding may reduce microbial infection and contribute to relatively stable environments for infants with access to breast milk.Source: §3.3 · p. 12
4 Discussion
PhaTYP predicts phage lifestyles, outperforming available tools on simulated and real sequencing data, and was applied to analyze phages in human neonates’ gut data.
- PhaTYP combines self-supervised protein-association learning with fine-tuning for lifestyle prediction, achieving more stable performance on short contigs than other methods.Source: §4 · pp. 12–13
- In human neonates, PhaTYP’s lifestyle predictions yielded insights mostly consistent with recently published studies, supporting its use to analyze phage composition in metagenomic data.Source: §4 · p. 13
- Future work could distill PhaTYP to reduce its parameter size and training-resource demands, which currently include four 24Gb GPU units.Source: §4 · p. 13
- Another planned extension is incorporating phage identification [35] so users can analyze phage lifestyles directly in metagenomic data.Source: §4 · p. 13
- PhaTYP achieved the most accurate lifestyle prediction among available tools on simulated and real sequencing data.Source: §4 · p. 13