Introduction

Author

Truong Phi

Overview

The Positional Burrows-Wheeler Transform (PBWT), introduced by Richard Durbin in 2014 (Durbin 2014), is an efficient and scalable data structure for handling large haplotype datasets. It has been applied in many important genomic tasks:

Motivation

The PBWT algorithm is powerful, yet it can be challenging for newcomers to grasp. I am grateful for Alistair Miles’s insightful blog post, which provides a practical bridge between Richard Durbin’s original paper and a working implementation.

However, there is still a need for a deeper intuition of the underlying processes and how they were implemented in practice. I created this blog to provide mental models of how PBWT algorithms function. By analyzing Richard Durbin’s source code, I have developed simplified pseudo-code that captures the core logic and created illustrative algorithmic diagrams to visualize how the algorithms are implemented with a specific example.

Content covered

  • Construction: How to build prefix and divergence arrays (Algorithms 1&2).
  • Internal Matching: Identifying shared segments and maximal matches within a population:
  • External Querying: Mapping a new haplotype against a PBWT database (Algorithm 2&5).

Baaijens, Jasmijn A., Paola Bonizzoni, Christina Boucher, et al. 2022. “Computational Graph Pangenomics: A Tutorial on Data Structures and Their Applications.” Natural Computing 21 (1): 81–108. https://doi.org/10.1007/s11047-022-09882-6.
Browning, Brian L., Xiaowen Tian, Ying Zhou, and Sharon R. Browning. 2021. “Fast Two-Stage Phasing of Large-Scale Sequence Data.” The American Journal of Human Genetics 108 (10): 1880–90. https://doi.org/10.1016/j.ajhg.2021.08.005.
Durbin, Richard. 2014. “Efficient Haplotype Matching and Storage Using the Positional BurrowsWheeler Transform (PBWT).” Bioinformatics 30 (9): 1266–72. https://doi.org/10.1093/bioinformatics/btu014.
Naseri, Ardalan, Xiaoming Liu, Kecong Tang, Shaojie Zhang, and Degui Zhi. 2019. RaPID: Ultra-Fast, Powerful, and Accurate Detection of Segments Identical by Descent (IBD) in Biobank-Scale Cohorts.” Genome Biology 20 (1): 143. https://doi.org/10.1186/s13059-019-1754-8.
Rubinacci, Simone, Olivier Delaneau, and Jonathan Marchini. 2020. “Genotype Imputation Using the Positional Burrows Wheeler Transform.” PLOS Genetics 16 (11): e1009049. https://doi.org/10.1371/journal.pgen.1009049.
Rubinacci, Simone, Robin J. Hofmeister, Bárbara Sousa Da Mota, and Olivier Delaneau. 2023. “Imputation of Low-Coverage Sequencing Data from 150,119 UK Biobank Genomes.” Nature Genetics 55 (7): 1088–90. https://doi.org/10.1038/s41588-023-01438-3.