directed evolution for proteins
EvoEmu.
UCSF QBI Hackathon · 1st Place

EvoEmu performs directed evolution for proteins in silico. Instead of optimizing for one static fold, it evolves a sequence toward a target conformational landscape, which is the range of shapes a protein actually moves between. It won 1st place at the UCSF QBI Hackathon.
Why conformational landscapes
Most structure prediction treats a protein as one fixed shape, but real proteins move between states, and function often depends on the balance between those states rather than any single one. EvoEmu optimizes that balance directly. The score is a log likelihood ratio between two structural states sampled from an ensemble, so a candidate is judged on how its shapes are distributed rather than on one predicted fold.
The search loop
You provide a starting sequence and a target, and it runs a genetic search within a fixed budget. Each generation does four things.
- It generates candidate mutants. ESM-2 scores substitutions at each position and the mutation operator samples from that distribution, so proposals stay in the region of sequence space the model considers plausible. A random mutation mode is available as a baseline for comparison.
- It scores them. BioEmu samples each candidate structural ensemble and reduces it to a log likelihood ratio between the two states.
- It keeps the top 20 candidates as the elite.
- It crosses and re-mutates the elite into the next generation, then repeats until the generation budget is spent.
Two ways to set the target
- Fit to LLR, where you provide the populations of two states as percentages and it optimizes toward that ratio.
- Fit to structure, where you provide a target pdb file and it optimizes toward the sequence and landscape from that structure.
Running it
- A FastAPI server exposes the search as a job. You post to start a run, poll for status, and subscribe to a server sent events stream to follow it generation by generation. The frontend is a single static HTML file with no build step.
- Sequences fold live in the browser. The server proxies ESMFold through the ESM Atlas API and 3Dmol.js renders the result, so the structure can be watched as the search progresses.
- A CLI runs the same engine from YAML configs, which is what I use for runs on a GPU VM. A setup script installs the real BioEmu weights and CUDA dependencies.
- A mock scoring mode reproduces the full pipeline without a GPU, which keeps demos fast and the pytest suite deterministic.
Conclusion
EvoEmu shows that existing models can be combined into something neither one does alone. No models are trained here, since ESM-2 proposes mutations, BioEmu scores structures, and the genetic algorithm drives the search. Optimizing for a landscape rather than a single fold is the part I want to keep developing, which is what the QBI grant is funding.
Screenshots
