Interpreting Molecular Dynamics Forces as Deep Learning Gradients Improves Quality Of Predicted Protein Structures

Jonathan King, David Ryan KoesbioRxiv 2023

Abstract

Protein structure predictions from deep learning models like AlphaFold2, despite their remarkable accuracy, are likely insufficient for direct use in downstream tasks like molecular docking. The functionality of such models could be improved with a combination of increased accuracy and physical intuition. We propose a new method to train deep learning protein structure prediction models using molecular dynamics force fields to work toward these goals. Our custom PyTorch loss function, OpenMM-Loss, represents the potential energy of a predicted structure. OpenMM-Loss can be applied to any all-atom representation of protein structure capable of mapping into our software package, SidechainNet. We demonstrate our method’s efficacy by finetuning OpenFold. We show that subsequently predicted protein structures, both before and after a relaxation procedure, exhibit comparable accuracy while displaying lower potential energy and improved structural quality as assessed by MolProbity metrics.

Introduction

While models like AlphaFold2 (AF2) have revolutionized protein structure prediction, they face a significant "physics problem." These models are primarily trained to match the static coordinates of proteins found in the Protein Data Bank (PDB). However, PDB structures often represent "frozen" crystal states that may not accurately reflect a protein's behavior in a natural, aqueous environment.

Furthermore, AF2 predictions frequently contain subtle physical irregularities, such as atomic clashes or awkward sidechain orientations. While these errors might seem negligible in terms of overall shape, they are catastrophic for downstream tasks like molecular docking. If a binding pocket is incorrectly shaped by even a fraction of an Angstrom, drug-protein simulations will fail. This research bridges the gap between "black-box" deep learning and classical biophysics by treating molecular dynamics (MD) forces as gradients for backpropagation.

Methodology

The core innovation of this work is the OpenMM-Loss function, implemented in PyTorch. This framework leverages the fundamental physical principle that force is the negative gradient of potential energy ($F = -\nabla U$). By defining the training loss as the potential energy of the protein (calculated via a standard MD force field like AMBER), the gradients required to update the neural network become the physical forces acting on the atoms.

The OpenMM-Loss training framework: ML models predict all-atom structures, which are processed via SidechainNet and OpenMM to calculate physical forces used as gradients for backpropagation.

To implement this, the authors addressed several technical hurdles:

  • Differentiable Hydrogens: MD force fields require hydrogen atoms, which AF2 does not predict. The authors utilized the Natural extension of Reference Frame (NeRF) technique to add hydrogens in a differentiable manner, allowing gradients to flow back to the heavy atoms.
  • Energy Landscape Smoothing: Protein energy landscapes are rugged; a single atomic clash can result in near-infinite energy. A custom "leaky" sigmoid function was developed to map these astronomical values into a manageable range (e.g., -4 to 1) while maintaining a signal for optimization.

Training was conducted using SidechainNet, an all-atom protein structure dataset. The authors created scnmin, a subset of ~32,000 structures pre-minimized using MD force fields to provide physically ideal targets for the model.

Results and Discussion

Finetuning OpenFold (an open-source AF2 implementation) with OpenMM-Loss yielded significant improvements in structural quality without sacrificing backbone accuracy. The models demonstrated a notable decrease in MolProbity Scores and Clash Scores. For instance, the baseline AF2 Clash Score of ~33.8 was reduced to 26.5 in the best-performing unrelaxed model.

Distribution of OpenMM-Loss across various model configurations, demonstrating that the combination of minimized data (scnmin) and OpenMM-Loss (OMM) significantly lowers the potential energy of predicted structures.

Crucially, the model maintained its predictive accuracy, with lDDT (Local Distance Difference Test) scores remaining comparable to the baseline (~0.746). The results suggest a powerful synergy between high-quality data and physical loss functions: the best performance was achieved by training on physically minimized data (scnmin) while simultaneously utilizing the OpenMM-Loss function. This approach ensures the model learns the "rules" of chemistry, such as Van der Waals repulsions and bond angle constraints, directly during the training phase.

Conclusion

This framework demonstrates that directly incorporating biophysical principles into deep learning training can reduce structural irregularities in protein predictions. While currently limited to proteins, future work aims to extend this to protein-ligand complexes, which would be a major advancement for computational drug discovery. By providing better starting points for structural relaxation, OpenMM-Loss paves the way for more effective and physically grounded downstream applications in structural biology.

Summary updated

BibTeX
@misc{king2023interpreting,
  author = {Jonathan King and David Ryan Koes},
  title = {{Interpreting Molecular Dynamics Forces as Deep Learning Gradients Improves Quality Of Predicted Protein Structures}},
  year = {2023},
  doi = {10.1101/2023.10.03.560775},
  howpublished = {bioRxiv},
}
Figure