Abstract
MOTIVATION: B-cell lineage trees describe the evolutionary process of immunoglobulin genes during affinity maturation. Existing methods for building B-cell lineage trees generally do not guarantee the parent-to-child inheritance and accumulation of advantageous mutations under successive rounds of somatic hypermutation (SHM) and selection, and are often incompatible with repertoire input. RESULTS: To address previous limitations, we developed AffMB (Affinity Maturation of B-cell receptor), a comprehensive toolkit for tracking affinity maturation through the generation and visualization of SHM-ordered, inheritance-based B-cell lineage trees from single-cell or bulk B-cell receptor sequencing data. The SHM-ordered inheritance tree algorithm outperformed state-of-the-art benchmarks in simulations. When applied to single-cell data from BNT162b2 vaccination (n = 42), AffMB demonstrated the ability to infer immunization responses and showed the feasibility of identifying potential high-affinity antibody sequences. AVAILABILITY AND IMPLEMENTATION: AffMB is an open-source Python package that supports contig FASTA or AIRR rearrangement TSV inputs. The source code for AffMB is freely available at https://github.com/deepomicslab/AffMB.