Skip to main content
BAGEL (Biomolecular Algorithm for Guidance in Energy Landscapes) is a Python library for computational protein design. It finds amino acid sequences that give rise to structures meeting specified design criteria using Monte Carlo optimization.

Architecture

BAGEL follows a modular architecture with these core concepts:
  • System — Top-level container representing the full design task. Contains one or more States.
  • State — A multimeric collection of Chains with associated EnergyTerms. Multiple states can share chains.
  • Chain — A monomeric sequence of Residues with mutability controls.
  • Residue — A single amino acid with a name, index, and mutability flag.
  • EnergyTerm — A scoring function that evaluates how well a structure meets a design criterion. Each term uses an Oracle to get structural predictions.
  • Oracle — An algorithm (e.g., ESMFold, ESM-2) that predicts properties from sequence (structure, embeddings).

Optimization Flow

  1. Define your Chains with sequences and mutability
  2. Create States grouping chains with EnergyTerms
  3. Wrap states in a System
  4. Choose a MutationProtocol (Canonical or GrandCanonical)
  5. Run a Minimizer (SimulatedAnnealing, SimulatedTempering) with optional Callbacks

Module Reference

Core

Residue, Chain, State, System — the fundamental data structures.

Energies

EnergyTerm and 15+ built-in scoring functions (pTM, pLDDT, PAE, SASA, etc.).

Minimizers

Monte Carlo, Simulated Annealing, and Simulated Tempering optimizers.

Mutation

Canonical (substitution-only) and GrandCanonical (add/remove/substitute) protocols.

Oracles

Structure prediction (ESMFold) and embedding (ESM-2) oracles.

Callbacks

Logging, early stopping, structure saving, and W&B integration.

Analysis

Post-optimization analysis and visualization tools.

Import Patterns