Abstract
Aligning DNA sequences to an annotated reference is a key step for genotyping in biology. Recent scientific studies have demonstrated improved inference by aligning reads to a variation graph, i.e., a reference sequence augmented with known genetic variations. Given a variation graph in the form of a directed acyclic string graph, the sequence to graph alignment problem seeks to find the best matching path in the graph for an input query sequence. Solving this problem exactly using a sequential dynamic programming algorithm takes quadratic time in terms of the graph size and query length, making it difficult to scale to high throughput DNA sequencing data. In this work, we propose the first parallel algorithm for computing sequence to graph alignments that leverages multiple cores and single-instruction multiple-data (SIMD) operations. We take advantage of the available inter-task parallelism, and provide a novel blocked approach to compute the score matrix while ensuring high memory locality. Using a 48-core Intel Xeon Skylake processor, the proposed algorithm achieves peak performance of 317 billion cell updates per second (GCUPS), and demonstrates near linear weak and strong scaling on up to 48 cores. It delivers significant performance gains compared to existing algorithms, and results in run-time reduction from multiple days to three hours for the problem of optimally aligning high coverage long (PacBio/ONT) or short (Illumina) DNA reads to an MHC human variation graph containing 10 million vertices.
Introduction: Beyond the Linear Reference
Traditionally, genomics relies on a "linear reference"—a single representative DNA sequence. However, a linear reference fails to capture the vast genetic diversity across populations. Variation graphs solve this by representing the genome as a Directed Acyclic Graph (DAG), where nodes are DNA bases and paths represent known genetic variations.
The challenge is computational: aligning a DNA "read" (a short snippet of sequenced DNA) to a graph is far more complex than aligning it to a linear string. While the standard Smith-Waterman algorithm works for linear sequences, extending it to graphs requires a Dynamic Programming (DP) approach that takes quadratic time relative to graph size and read length. For massive human variation graphs with millions of vertices, existing tools are either too slow or use heuristics that sacrifice accuracy.
PaSGAL: A Parallel Sequence-to-Graph Aligner
To address these challenges, we introduce PaSGAL (Parallel Sequence-to-Graph Aligner), the first parallel algorithm designed to compute sequence-to-graph alignments by leveraging multi-core processors and SIMD instructions. The algorithm follows a three-stage strategy:
- DP-fwd: Computes the ending position and score of the optimal alignment.
- DP-rev: Computes the starting position by running the DP in reverse.
- Traceback: Recomputes a small section of the score matrix to produce the final base-to-base alignment.
Algorithmic Complexity and SIMD Vectorization
The primary difficulty in graph alignment lies in the increased number of dependencies within the DP matrix. In a linear reference, each cell $C_{i,j}$ depends only on its immediate neighbors. In a graph, a node can have multiple predecessors, requiring the algorithm to check multiple potential paths for every cell update.
PaSGAL overcomes this by using AVX-512 SIMD instructions, processing 16 to 64 cells of the DP matrix in a single CPU cycle. Furthermore, it employs inter-task parallelism, aligning thousands of different reads simultaneously across multiple CPU cores to maximize throughput.
Optimizing for Memory Locality
A naive parallel DP algorithm is often throttled by memory bandwidth—the "memory wall." PaSGAL introduces a blocked computation strategy to solve this. By exploiting the fact that over 99.9% of genomic variations are local, the algorithm processes the DP matrix in small $16 \times 8$ blocks. This ensures that the most frequently accessed graph data remains in the high-speed L1 cache, significantly reducing slow DRAM accesses and enabling near-linear scaling.
Performance and Impact
We evaluated PaSGAL using medically significant human genomic regions, such as the Major Histocompatibility Complex (MHC), which contains over 10 million vertices.
- Throughput: PaSGAL achieved a peak performance of 317 billion cell updates per second (GCUPS) on a 48-core Intel Xeon Skylake processor.
- Speedup: Compared to existing exact aligners like
vg-exact, PaSGAL is 10x to 25x faster while maintaining lower memory overhead. - Real-world Efficiency: The time required to align high-coverage reads to the MHC graph was reduced from several days to just three hours.
Conclusion and Future Work
PaSGAL demonstrates that high-performance computing techniques can make exact graph alignment practical for large-scale genomic studies. Future work will focus on supporting affine gap penalties to better model biological insertions and deletions, as well as extending the algorithm to handle cyclic graphs common in bacterial genomes.
Summary updated