microsoft/bioemu

Inference code for scalable emulation of protein equilibrium ensembles with generative deep learning

BioEmu – a diffusion‑based protein‑structure generator

What it is – BioEmu (Biomolecular Emulator) is a Python library that can sample plausible 3‑D structures for a single‑chain protein given only its amino‑acid sequence. It does this with a diffusion model trained on molecular‑dynamics simulations, and it ships the model weights so you can run inference locally or on Azure AI Foundry.

Key capabilities

  • Fast sampling of thousands of structures per GPU (e.g. ~4 min for 100‑aa proteins on an A100).
  • Physical steering: optional potentials (Cα‑Cα distance, steric clash avoidance) are applied during diffusion via Sequential Monte Carlo (SMC) or Feynman‑Kac Corrector (FKC) to reduce unphysical chain breaks.
  • Side‑chain reconstruction & short MD relaxation via the optional bioemu[md] extra, which wraps the HPacker tool and a brief NVT equilibration.
  • Zero‑setup MSA/embedding: an inlined copy of ColabFold/AlphaFold2 automatically fetches MSAs and computes embeddings the first time you run the sampler.
  • Azure AI Foundry support for one‑click cloud execution.

Installation

# Core package (Linux only, Python ≥3.10)
pip install bioemu
# With GPU acceleration (CUDA) – pulls in torch‑CUDA wheels
pip install "bioemu[cuda]"
# Optional side‑chain/MD tools
pip install "bioemu[md]"

The first run will download AlphaFold2 weights (3.5 GB) to `/.cache/colabfold/`.

Basic usage (CLI)

python -m bioemu.sample \
    --sequence GYDPETGTWG \
    --num_samples 10 \
    --output_dir ~/test_chignolin

Or via the Python API:

from bioemu.sample import main as sample
sample(sequence='GYDPETGTWG', num_samples=10, output_dir='~/test_chignolin')

Model checkpoints are fetched automatically from the Microsoft BioEmu HuggingFace repo; you can select a specific version with --model_name="bioemu-v1.1".

Physical steering (recommended for realistic backbones)

python -m bioemu.sample \
    --sequence GYDPETGTWG \
    --num_samples 100 \
    --output_dir ~/steered \
    --denoiser_config src/bioemu/config/steering/physical_steering.yaml

The YAML config lets you tune:

  • num_particles (how many diffusion particles per output sample)
  • ess_threshold (when to resample particles)
  • start/end diffusion times for applying the potentials
  • Which potentials to use (e.g., CaCaDistance, PairwiseClash).

Side‑chain reconstruction & MD relaxation

python -m bioemu.sidechain_relax \
    --pdb-path samples.pdb \
    --xtc-path samples.xtc \
    --md-protocol nvt_equil   # optional short NVT run

The script installs HPacker in an isolated virtualenv if needed. Use --no-md-equil to skip the MD step.

Where to find more

  • Paper & citation: Scalable emulation of protein equilibrium ensembles with generative deep learning (Science, 2025). DOI 10.1126/science.adv9817.
  • Model weights: hosted on HuggingFace under microsoft/bioemu.
  • Training data: CATH, Octapeptides, MegaSim (Zenodo links provided).
  • Benchmarks: see the companion bioemu-benchmarks repo for reproducing the paper’s results.
  • Azure AI Foundry: follow AZURE_AI_FOUNDRY.md for a cloud‑hosted deployment.

License & attribution BioEmu itself is released under the MIT license. It bundles code from AlphaFold2 (Apache 2.0), OpenFold (Apache 2.0) and ColabFold (MIT). When using the library, cite the Science paper and the Zenodo DOI shown at the top of the README.


This summary is based solely on the repository’s README; no additional features have been inferred.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project