Decoding positive selection in Mycobacterium tuberculosis with phylogeny-guided graph attention models
Abstract
Abstract Motivation Positive selection is a key evolutionary force in Mycobacterium tuberculosis , driving the emergence of adaptive mutations that influence drug resistance, transmissibility, and virulence of tuberculosis. Phylogenetic trees capture the hierarchical evolutionary relationships among isolates, making them an ideal framework for detecting such adaptive signals. Here, we present a phylogeny-guided graph attention network approach, coupled with a novel method for converting SNP-annotated phylogenetic trees into graph structures suitable for graph neural network processing. Results Using a dataset of 1000 M. tuberculosis isolates, representing the four main lineages, and 206 single-nucleotide variants (75 resistance-associated and 131 neutral) spanning 79 drug-resistance genes, we constructed graphs where nodes represented individual isolates and edges reflected phylogenetic distances. To reduce noise and highlight local evolutionary structure, we pruned edges between isolates separated by more than seven internal nodes. Node features were encoded as binary indicators of SNP presence or absence, and the graph attention network (GAT) architecture comprised two attention layers with a residual connection, followed by global attention pooling and a multilayer perceptron classifier. The model achieved higher accuracy (0.81, AUC 0.82) than a homoplasy-count baseline (0.71) on the held-out test set. Under repeated cross-validation, however, F1 scores did not differ significantly (0.56 vs. 0.58; paired Wilcoxon p = 0.98), reflecting a specificity-sensitivity trade-off: the GAT favoured specificity (0.89), the baseline favoured sensitivity. Applying the model to 138 WHO-classified “uncertain” variants identified 28 high-confidence candidates, including rpoC Ile491Val (rifampicin, compensatory), ubiA Arg240Cys (ethambutol), and rpsA Ala412Val (pyrazinamide). These findings demonstrate the feasibility of encoding phylogenetic trees as graph neural network-compatible structures and the utility of attention-based models for detecting positive-selection signals, supporting genomic surveillance and prioritisation of candidates for experimental validation. Availability and Implementation The source code for the model can be found at https://github.com/linfeng-wang/Phylogeny-Guided_GAT .
Fields of Study & Subjects
Tuberculosis Research and Epidemiology
Machine Learning in Bioinformatics
Genomics and Phylogenetic Studies
Publication details
- Journal / source
- BMC Bioinformatics
- Publisher
- Springer Science and Business Media LLC
- Publication date
- 6 August 2026
- Language
- EN