This repository provides a workflow for analyzing mutation effects on proteins using a Maximum Entropy (MaxEnt) model trained on multiple sequence alignment (MSA) data.
More details of the MaxEnt model can be found at Enhancing computational enzyme design by a maximum entropy strategy
The MaxEnt model assigns a sequence probability P(S) for each sequence S, representing the likelihood of observing S within the natural sequence space.
The statistical energy of a sequence is defined as: E(S) = -log P(S). In the model training, we minimize E(S). The algorithm therefore outputs statistical energy values for any input sequence S. The repository includes scripts to compute site-saturation mutagenesis energies, enabling the evaluation of all possible single-point variants at each site.
We also define the evolutionary score as: Φ(S) = log P(S). This score is simply the negative of the statistical energy: Φ(S) = -E(S). Higher Φ(S) values indicate sequences more consistent with natural evolutionary constraints.
git clone https://github.com/EvoCatalysis/MaxEnt-Pytorch.git
cd MaxEnt-Pytorch
pip install -r requirements.txtConvert a FASTA file into one-hot encoded matrix and compute sequence weights.
python msa_lib.py --msa input.fasta --gap_cutoff 0.7Train a MaxEnt model using the processed MSA.
python train_maxent.py --device 'cuda' --n_epochs 1000Predict mutation energy changes compared to the wild-type based on the trained model.
python mut_energy_maxent_single_all.py| File | Description |
|---|---|
msa_lib.py |
Preprocess MSA file |
train_maxent.py |
Train MaxEnt model on one-hot encoded MSA |
mut_energy_maxent_single_all.py |
Compute mutation energies |
requirements.txt |
Python dependencies |
Please cite: Xie, W. J., Asadi, M., & Warshel, A. (2022). Enhancing computational enzyme design by a maximum entropy strategy . Proceedings of the National Academy of Sciences USA, 119(7), e2122355119.