Probabilistic Multiple Sequence Alignment using Spatial Transformations

Secundino López, Søren Hauberg, Wouter BoomsmabioRxiv 2024

Abstract

Multiple Sequence Alignment (MSA) has long been a prominent and critical tool in bioinformatics and computational biology. Its importance lies in its ability to provide valuable insights into the relationships between sequences and the evolutionary pressure leading to amino acid preferences at particular sites in a protein. Despite the recent advances in protein language models, MSAs remain critical in many applications, e.g. for state-of-the-art prediction of 3D structure and protein variant effects. Sequence alignment is typically considered a deterministic preprocessing step, leading to a single static MSA. Especially for low-similarity sequences, parts of an alignment will be subject to substantial uncertainty, which is disregarded when processing a static MSA. Earlier, HMM-based approaches handled this uncertainty by considering the full posterior ensemble over alignments. In this paper, we explore whether a similar approach is feasible within a modern deep learning approach, where we move beyond the Markovian restrictions of earlier models. In particular, we consider whether we can learn the alignment process as distribution over spatial transformations, in combination with a deep latent variable model of protein sequences.

Introduction: Beyond the Deterministic Black Box

In bioinformatics, Multiple Sequence Alignment (MSA) is the foundational tool for understanding protein structure and function. However, most modern pipelines treat MSA as a deterministic black box: raw sequences are input, and a single, fixed alignment is output. This approach suffers from two major drawbacks. First, it ignores uncertainty; for sequences with low similarity, there is rarely one "correct" alignment, and ignoring this ambiguity can propagate errors into downstream tasks like 3D structure prediction. Second, older probabilistic methods like Profile HMMs rely on the Markov assumption, struggling to model long-range correlations between amino acids that are distant in sequence but close in 3D space.

This research reimagines MSA not as a static preprocessing step, but as a probabilistic "spatial transformation" problem. By combining deep latent variable models with diffeomorphic warping, the authors propose a framework that learns to align protein sequences while explicitly accounting for evolutionary uncertainty.

Methodology: Alignment as Geometry

The core innovation lies in treating alignment as a coordinate transformation. The model frames MSA as a Disentanglement Representation Learning problem, where the "true" biological signal is an invariant representation that has been "warped" by evolution.

Key Architectural Components

  • CPAB Transformations: The model utilizes Continuous Piecewise-Affine Based (CPAB) transformations—a type of diffeomorphic mapping. This allows the model to stretch or compress the sequence grid smoothly to align residues without breaking the sequence order.
  • Discrete to Continuous Bridge: To apply continuous transformations to discrete amino acid strings, the authors employ Multi-Output Gaussian Processes (MO-GP). This acts as a smoothing operator, allowing the model to interpolate between residues during warping.
  • C-VITAE Architecture: The framework is based on a Conditional Variationally Inferred Transformational Autoencoder. It utilizes two latent variables: $z_A$ for sequence features ("style") and $z_P$ for transformation parameters.
Probabilistic Graphical Model (PGM) with pretrained guidance showing the relationship between latent variables and the transformation process.

To handle long-range dependencies in longer sequences, a "Light Attention" block was integrated to improve feature extraction for the alignment process. However, this addition introduced a cycle into the Directed Acyclic Graph (DAG), making the Evidence Lower Bound (ELBO) non-tractable and requiring complex sampling for optimization.

Conceptualizing the Transformation

By using diffeomorphic transformations, the model ensures that the biological order of the sequence is preserved. The model learns a function that shifts the entire coordinate system of the sequence rather than making discrete residue-by-residue matching decisions. Because the model is probabilistic, it provides a distribution of alignments rather than a single static result, allowing for the quantification of alignment uncertainty.

Visualization of the spatial transformation mapping a reference sequence (left) to an observed warped state (right).

Experimental Validation

The proof-of-concept was validated using both synthetic and real-world data:

  1. Synthetic Data: The model successfully aligned amino acids across columns in a 5-character alphabet dataset, proving the viability of spatial transformations for discrete symbols.
  2. WW Domain (Real Protein Data): Using sequences from the RSP5 domain, the model was pre-trained on 224 aligned sequences to establish an informative prior. It successfully aligned 15 novel test sequences, suggesting that the learned transformation profiles are specific to the protein family and generalize well.

Limitations and Future Directions

As a proof-of-concept, several challenges remain. The current model relies heavily on an "informative prior" (a VAE trained on pre-aligned sequences); the ultimate goal is to align sequences entirely from scratch. Additionally, the non-tractable nature of the ELBO when using attention mechanisms necessitates more efficient sampling methods like MCMC. Finally, while effective for small domains like the WW domain, scaling this approach to massive, multi-domain proteins will require significant computational optimization.

Summary updated

BibTeX
@misc{lopez2024probabilistic,
  author = {Secundino López and Søren Hauberg and Wouter Boomsma},
  title = {{Probabilistic Multiple Sequence Alignment using Spatial Transformations}},
  year = {2024},
  doi = {10.1101/2024.10.12.617969},
  howpublished = {bioRxiv},
}
Figure