Heuristic Multi-site Optimization for Protein Sequence Design using Masked Protein Language Models
Protein sequence design for tailored functional properties is a fundamental task in protein engineering, with critical applications in drug discovery and therapeutic development. Efficient navigation of the combinatorial vastness of protein sequence space to identify functional variants remains a formidable challenge. Conventional approaches, which predominantly rely on template-based local search or single-residue mutagenesis, are constrained by their susceptibility to local optima and their potential risk of destabilizing native structural stability. In this study, we introduce ProtHMSO, a heuristic multi-site optimization framework leveraging masked protein language models (ProtLMs) for context-aware sequence exploration. ProtHMSO mimics natural evolutionary mechanisms by employing ProtLM-derived substitution probabilities to guide heuristic searches for synergistic mutations, thereby constraining combinatorial search spaces through evolutionary and biophysical priors. Given a starting sequence and a predictive fitness model, ProtHMSO heuristically generates high-fitness multi-site variants under evolutionary constraints. Besides, ProtHMSO can also be as a modular plugin that enhances the convergence efficiency of genetic algorithms (GAs) and Monte Carlo tree search (MCTS) by integrating evolutionary priors into exploration strategies. Benchmark experiments demonstrate that protein sequences generated by ProtHMSO exhibit superior functional performance and closer alignment with natural sequence distribution, compared with state-of-the-art methods. These advancements highlight that ProtHMSO has strong potential and compatibility to accelerate functional protein discovery, offering a robust framework for efficient and context-aware exploration of protein sequence space.
This project provides a Heuristic Multi-site Optimization framework for Protein Sequence Design (ProtHMSO) using Masked Protein Language Models. Follow the steps below to run the code and evaluate the results.
Python (Version 3.8 or higher is recommended)
pip install -r requirements.txt
Step 1: Generate Sequences by Running the Optimization Algorithm All optimization algorithm scripts are located in the OPT_Code directory.
Example: Running a Random and ESM2 script python <randomVSESM2_1.py> Running these scripts will generate optimized protein sequences, which are typically saved to a specific output file or directory (for instance, results.zip in the project root might be an example output).
Step 2: Evaluate Sequence Performance with the Predictor Tool The predictor directory contains tools for evaluating the performance of sequences generated by the scripts in OPT_Code.
Run the evaluation script in predictor directory, providing the sequence file generated in Step 1, then you can run the ipynb file to evaluate the generated sequence. The evaluation tool will analyze the input sequences and output relevant performance metrics.
OPT_Code: Optimization code for each method for different cases
ProtLM: Protein Language Model used
ProteinGym-data: ProteinGym dataset used in this paper
images: Model framework diagram
predictor: Prediction models and execution code for each metric used in this paper
srcdata: Original case dataset used in this paper
plot.ipynb: Violin plotting code
requirements.txt: Runtime environment requirements
results.zip: Experimental results obtained in this paper
If you use this code or our model for your publication, please cite the original paper.