Health and life sciences

Machine learning for protein engineering

Protein engineers use machine learning to predict how mutations change activity, stability or binding, rank variants before building them in the laboratory, and choose the next round of mutations to test. Protein language models give useful scores even before any assay data exists.

How machine learning is used in protein engineering

Predicting the effect of mutations without assay data

Models trained on natural sequence families score how plausible a mutation is, which correlates with measured effects on function. These zero-shot scores are useful before a single variant has been measured in your own laboratory.

Real exampleDeepSequence (Riesselman et al., 2018)An unsupervised latent variable model of sequence families that predicted the effects of mutations across many deep mutational scanning experiments better than existing methods using the same evolutionary data.

Guiding directed evolution

After one round of measured variants, a supervised model learns the sequence to function mapping and proposes the next round to build. This replaces random mutagenesis with a ranked list of candidates.

Real exampleMachine-learning-guided directed evolution (Yang, Wu and Arnold, 2019)A review that sets out the steps for building machine learning sequence-function models and using them to select variants likely to have improved properties, illustrated with two case studies.

Engineering with very few measurements

When assays are slow, models combine a representation learned from natural sequences with a handful of measured variants. This keeps the number of laboratory measurements small while still searching a large sequence space.

Real exampleLow-N protein engineering (Biswas et al., 2021)Used as few as 24 functionally assayed mutant sequences to build a virtual fitness landscape and screen ten million sequences in silico, demonstrated on avGFP and TEM-1 beta-lactamase.

Improving binding in antibodies

General protein language models suggest mutations that look evolutionarily plausible, and the small suggested sets are then screened for improved binding. The model is given no information about the target.

Real exampleLanguage-model-guided antibody evolution (Hie et al., 2024)Screened 20 or fewer variants of each of seven antibodies across two rounds of laboratory evolution, improving binding affinities of four mature antibodies up to sevenfold and three unmatured antibodies up to 160-fold.

Benchmarking variant effect predictors

Public benchmarks collect deep mutational scanning datasets and score predictors on them in a consistent way. They let you compare methods before committing to one in your own project.

Real exampleProteinGymA public benchmark site that collects deep mutational scanning and clinical variant datasets and reports how protein fitness predictors perform on them.

Can you learn machine learning for protein engineering?

Yes. Protein engineers, biochemists and machine learning practitioners all learn it, and the first useful projects need only Python and regression. Start with sequence encodings and supervised models on deep mutational scanning data, then add protein language models and the evaluation habits that stop a model from flattering itself.

  1. Python and sequence handlingRead FASTA files, align sequences, and turn variants into tables of positions and measured values.Learn it in Python
  2. Regression and validationFit linear and tree models to variant effects, and hold out whole positions or families rather than random rows.Learn it in Machine Learning
  3. Statistics of assay dataLearn replicate noise, measurement ceilings and correlation metrics, because assay quality limits what any model can learn.Learn it in Statistics
  4. Protein language modelsUse pretrained models such as ESM-2 for embeddings and zero-shot scores, then fine-tune when you have enough measurements.Learn it in Deep Learning
  5. Design, build, test cyclesPlan each round so the variants you build also improve the next model, not just the current best candidate.

Moving into machine learning for protein engineering

If you already work in the field

Protein engineers already own the assay, the variants and the knowledge of what a real improvement looks like. Add Python and regression, then model your laboratory's existing variant data and use the model to pick part of the next round while the usual method picks the rest.

If you come from data science or ML

Data scientists need to learn what a deep mutational scan measures, how noisy assays are and why a correlation of 0.5 can still be useful. Start on public benchmarks such as ProteinGym, then work with a laboratory that can test the variants your model proposes.

Roles that do this workProtein engineerComputational protein scientistMachine learning scientist, biologicsBioinformatics scientist

Tools you will use

ToolWhat you use it for
ESM-2 in Hugging Face TransformersLoad protein language models to embed sequences and score mutations without training data.
scikit-learnFit ridge regression and gradient boosting on one-hot or embedding features of variants.
ColabFoldPredict structures of variants to inspect where mutations sit in the fold.
PyTorchFine-tune protein language models or train small neural networks on assay data.

Public data to practise on

  • ProteinGym: Deep mutational scanning assays with measured fitness for many proteins, set up as benchmarks for variant effect prediction.
  • MaveDB: Public repository of multiplexed assays of variant effect, with scores for individual protein variants.

Your first project

Download one deep mutational scanning assay from ProteinGym, predict variant fitness with ridge regression on one-hot encoded mutations, and compare it with ESM-2 zero-shot scores using Spearman correlation on held-out positions.

Common questions

How many measured variants do you need before a model helps?

Supervised models become useful with a few dozen to a few hundred consistently measured variants, and zero-shot language model scores need none at all. Measurement quality matters more than count.

Are protein language models better than simple sequence features?

Not always. One-hot encodings and simple descriptors are strong when you have many measurements from one protein; language models help most when data is scarce or spread across families.

How should variant models be validated?

Hold out whole positions, mutational rounds or related proteins. Random splits leak information between variants of the same site and make the model look better than it is.

Can a model predict stability and activity at the same time?

Only if both are measured. Large stability datasets exist and can be modelled separately, but a model trained on stability does not tell you about catalytic activity.

Courses for these skills

New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.