The phylogenetic inference package GCtree uses abundance of sampled sequences to improve the performance of parsimony-based inference, using a branching process model. Our previous work showed that GCtree performs competitively on B-cell receptor data, compared with other similar tools. In this article, we describe recent enhancements to GCtree, including an efficient tree storage data structure that discovers additional diversity of parsimonious trees with negligible additional computational cost. We also describe a suite of new objective functions that can be used to rank these trees, including a Poisson context likelihood function that models sequence evolution in a context-sensitive way. We validate these additions to GCtree with simulated B-cell receptor data, and benchmark performance against other phylogenetic inference tools. This article is part of the theme issue ‘"A mathematical theory of evolution": phylogenetic models dating back 100 years’.
Antibodies play a crucial role in adaptive immunity. They develop as B cell receptors (BCRs): membrane-bound forms of antibodies that are expressed on the surfaces of B cells. BCRs are refined through affinity maturation, a process of somatic hypermutation (SHM) and natural selection, to improve binding to an antigen. Computational models of affinity maturation have developed from two main perspectives: molecular evolution and language modeling. The molecular evolution perspective focuses on nucleotide sequence context to describe mutation and selection; the language modeling perspective involves learning patterns from large data sets of protein sequences. In this paper, we compared models from both perspectives on their ability to predict the course of antibody affinity maturation along phylogenetic trees of BCR sequences. This included models of SHM, models of SHM combined with an estimate of selection, and protein language models. We evaluated these models for large human BCR repertoire data sets, as well as an antigen-specific mouse experiment with a pre-rearranged cognate naive antibody. We demonstrated that precise modeling of SHM, which requires the nucleotide context, provides a substantial amount of predictive power for predicting the course of affinity maturation. Notably, a simple nucleotide-based convolutional neural network modeling SHM outperformed state-of-the-art protein language models, including one trained exclusively on antibody sequences. Furthermore, incorporating estimates of selection based on a custom deep mutational scanning experiment brought only modest improvement in predictive power. To support further research, we introduce EPAM (Evaluating Predictions of Affinity Maturation), a benchmarking framework to integrate evolutionary principles with advances in language modeling, offering a road map for understanding antibody evolution and improving predictive models.
B cells and the antibodies they produce are vital to health and survival, motivating research on the details of the mutational and evolutionary processes in the germinal centers (GCs) from which mature B cells arise. It is known that B cells with higher affinity for their cognate antigen (Ag) will, on average, tend to have more offspring. However, the exact form of this relationship between affinity and fecundity, which we call the “affinity-fitness response function”, is not known. Here we use deep learning and simulation-based inference to learn this function from a unique experiment that replays a particular combination of GC conditions many times. All code is freely available at https://github.com/matsengrp/gcdyn , while datasets and inference results can be found at https://doi.org/10.5281/zenodo.15022130 .