mlmm-toolkit: An End-to-End ML/MM ONIOM Platform for Automated Enzymatic Reaction Mechanism Analysis
Overview
mlmm-toolkit is an open-source CLI for ML/MM ONIOM analyses of enzymatic reactions. It replaces the QM region of conventional QM/MM with a machine-learning interatomic potential (MLIP, default: UMA) while keeping the surrounding protein under an analytical Amber force field (hessian_ff), and chains ML-region selection → MM topology/layer preparation → MEP search → TS optimization → IRC → thermochemical correction → DFT single-point in one command. A link-atom boundary handles amino-acid residues straddling the ML/MM cut, and a microiteration scheme separates ML and MM relaxation in large systems.
Test a reaction mechanism in a single command:
# Multi-structure MEP (R + P endpoints → MEP, with TS optimization + thermo)
mlmm all -i R.pdb P.pdb -c 'SAM,GPP' -l 'SAM:1,GPP:-3' --tsopt --thermo
The source repository includes full-system COMT and BezA endpoint mechanisms, a methyltransferase scan, and a 122-atom ML/MM fixture; see examples/. Each stage is also exposed as an individual subcommand.
Prerequisites: input PDB/mmCIF structures must already contain hydrogens; multiple reaction states must share the same atoms in the same order (only coordinates differ).
mlmm allrunsmm-parmautomatically. Match-l RES:CHARGEto the H count actually present (e.g. SAM with 23 H =SAM:1cation, 22 H =SAM:0neutral) — full input-prep checklist in docs/getting-started.md.
Colab GUI workspace
An interactive GUI workspace is available in Google Colab. It brings full-system coordinates and topology input, ML-region setup, Mol* visualization and atom picking, controls generated from the live CLI, execution, and linked MEP/IRC/result inspection into one notebook. Choose a GPU runtime and open the Colab GUI workspace.
Related tools
| Tool | Use case |
|---|---|
| pdb2reaction | Pure-MLIP reaction paths for cluster models and small molecules from PDB / XYZ / GJF. |
| uma_pysis | Lightweight YAML-driven UMA–pysisyphus interface for quick/exploratory reaction-mechanism studies (GS / TS / IRC / ΔG). |
mlmm-toolkitbundles a GPU-optimized pysisyphus fork that is not compatible with upstream pysisyphus — do not install it into an environment that already has upstream pysisyphus.
Documentation
- Getting Started · mmCIF and Large Structures · Concepts · Installation · Troubleshooting
- Python API · CLI Conventions · YAML Reference · JSON Output Schema
- Full command index: docs/index.md
System requirements
| Component | Requirement |
|---|---|
| OS | Linux recommended; native Windows unsupported (AmberTools/tleap unavailable). |
| Python | 3.12 recommended (minimum 3.11). ORB requires 3.11 or 3.12. |
| GPU / CUDA / VRAM | A backend-compatible NVIDIA GPU/driver for GPU execution; size VRAM from a representative target-system pilot. |
| RAM / Disk | Size RAM and disk for the selected backend, model cache, topology tools, and expected artifacts. |
AmberTools (tleap) is required to generate a topology with mm-parm or all; reuse an existing matching --parm to skip that preparation. The default hessian_ff backend needs a C++20-capable compiler (validated with GCC 13.3) to JIT-compile native kernels on first use. pdbfixer is optional — only mm-parm --add-h needs it — conda install -c conda-forge ambertools pdbfixer -y installs both. CPU-only ML/MM execution is supported but can be substantially slower than GPU execution; benchmark the selected backend and system. Full requirement and tuning details: docs/getting-started.md#installation.
Installation
# 1. New env + AmberTools + CUDA-enabled PyTorch
conda create -n mlmm-toolkit python=3.12 -y && conda activate mlmm-toolkit
conda install -c conda-forge ambertools pdbfixer -y
pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cu130
# 2. Install mlmm-toolkit
pip install mlmm-toolkit
# 3. Authenticate Hugging Face once (only required for the default UMA backend)
# Accept the FAIR Chemistry License v1 at https://huggingface.co/facebook/UMA, then:
hf auth login # interactive
# OR: export HF_TOKEN=hf_xxx && hf auth login --token "$HF_TOKEN" # CI / HPC
Avoid AmberTools conflicts: on clusters with a system AmberTools module loaded, run
module unload amberbefore installing to prevent a ParmEd conflict with the conda-installed AmberTools.
Optional extras (install only what you need):
| Extra | Adds |
|---|---|
[orb] / [aimnet] |
Orb / AIMNet2 MLIP backend — not HF-gated |
[dft] |
PySCF + GPU4PySCF single-point DFT (--dft / mlmm dft); cost and memory depend on the system and method |
[mcp] |
Model Context Protocol server (mlmm-mcp) for agent clients |
[pdbfixer] |
PDBFixer extra (alternative to the conda install above) |
[openmm] |
OpenMM low-level backend, including virtual-site water models |
The MACE backend (-b mace) is not a pip extra: mace-torch pins e3nn==0.4.4, which conflicts with fairchem-core's e3nn>=0.5 (UMA), so it needs a dedicated environment — pip uninstall -y fairchem-core && pip install mace-torch (see docs/getting-started.md#installation).
CUDA module-load recipes, alternative-backend installs, DMF / cyipopt, Plotly Chromium, and HPC job-script templates: docs/getting-started.md and docs/device-hpc.md.
Preparing an Enzyme-Substrate System
For most systems the only hard requirement is a PDB with explicit hydrogens (at the intended protonation state). mlmm all then builds the MM topology, selects the ML region, and runs the whole pipeline in one command — see Quick Examples for the three input modes (multi-structure R → P, single-structure scan, TS-only). The preparation steps below are optional.
-
Build a structural model of the complex. Download coordinates from the Protein Data Bank. If an experimental structure is not available, use structure-prediction programs such as AlphaFold3, Boltz2, or Chai; docking programs; or GUI software such as PyMOL. Add hydrogens at the intended protonation state (or let
mm-parm --add-h --ph 7add them). For multi-structure (R → P) runs, every PDB must share the same atoms in the same order. -
(Optional) Build the MM topology yourself — it is automatic by default.
mlmm all(viamlmm mm-parm) generates the Amber.parm7/.rst7from the PDB automatically; unknown residues (ligands, cofactors) are parameterized with GAFF2 / AM1-BCC — pass formal charges with-l 'RES:CHARGE'. Build the topology by hand when it helps — a custom force field, special solvation, or a system the automatic route cannot handle — then pass it with--parm. To mimic aqueous conditions, solvate the complex and remove water molecules beyond ~6 Å (see the OpenMM cookbook / tleap). With an explicit--out-prefix(or--add-h),mm-parmalso exports LEaP's topology-matched PDB and fills missing element columns while preserving its atom records and order. -
(Optional) Define the ML region yourself.
mlmm allextracts the ML region from-c/--centerand-r/--radiusautomatically. To define it yourself instead, build an ML-region PDB — withmlmm extractor any molecular viewer — and feed it tomlmm all(or the per-stage subcommands) with--model-pdb; this skips the automatic extraction:mlmm extract -i complex.pdb -c 'SAM,GPP' -r 6.0 -l 'SAM:1,GPP:-3' -o ml_region.pdb
Important:
model.pdbmust be an unchanged subset of the full PDB/parm7atom topology. Preserve original atom order, names, residue IDs, and chain IDs; do not add link H manually. Terminate retained backbone fragments consistently at Cα (CA), put other ML/MM boundaries on aliphatic C–C single bonds whenever possible, and avoid peptide/polar/conjugated/metal bonds. Use the same selection for every R/IM/P state. (In PyMOL, tick "Original atom order" when exporting.) See How to constructmodel.pdb.ML-region precedence is explicit:
--model-pdbwins; otherwisealluses-c/--centerextraction, while per-stage commands may use--model-indicesor--detect-layer(B factors 0/10/20). You never specify link H for the normal case. The calculator finds everyparm7bond crossing the ML selection and inserts one link H there; Cartesian distance is used only to place that H along the known bond, not to decide whether a bond exists.--link-atom-methodselects scaled or fixed placement.
Quick Examples
# Multi-structure MEP (R + P → MEP, with TS + thermo + DFT)
mlmm all -i R.pdb P.pdb -c 'SAM,GPP' -l 'SAM:1,GPP:-3' --tsopt --thermo --dft
# Scan mode (single structure → staged bond scans → MEP)
mlmm all -i R.pdb -c 'SAM,GPP' -l 'SAM:1,GPP:-3' \
--scan-lists "[('SAM 359 CS1','GPP 360 C8',1.3)]"
# TS-only validation (existing TS candidate)
mlmm all -i TS_candidate_layered.pdb --parm complex.parm7 -q 1 --tsopt --opt-mode grad
For Gaussian-ONIOM / ORCA-QM/MM input-deck export and import use oniom-export / oniom-import. Per-stage walkthrough (mm-parm → extract → define-layer → opt → path-search → tsopt → freq → irc → dft): docs/getting-started.md and docs/quickstart-all.md. Working examples (COMT, BezA, methyltransferase, and toy system): examples/.
Output
A run writes its deliverables to --out-dir (default ./result_all/):
segments/seg_NN/{reactant,ts,product}.pdbfor MEP-oriented segments; TS-only mode writes chemically unassigned{e1,ts,e2}.pdbmep.pdb/mep_trj.xyz— the merged reaction path;energy_diagram_MEP.png— barrier diagramsummary.log/summary.json- Reusable inputs for follow-up runs:
ml_region.pdb(--model-pdb),mm_parm/*.parm7(--parm),layered/(B-factor-annotated full-system PDBs) - Directly inspectable model systems before/after link-H insertion:
ml_region_without_linkH.xyzandml_region_with_linkH.xyz, plus matching PDB companions for PDB input
Pipeline scratch lives under _work/ (safe to delete). Full layout and filename conventions: docs/output-layout.md.
CLI Subcommands
| Subcommand | Role | Doc |
|---|---|---|
all (default) |
End-to-end: extract → MM topology/layers → MEP → TS → IRC → freq → DFT | all |
mm-parm |
Generate parm7/rst7 via AmberTools | mm-parm |
extract |
Extract active-site pocket | extract |
define-layer |
Assign 3-layer ML/MM B-factor encoding | define-layer |
add-elem-info / fix-altloc |
Repair PDB element columns / resolve altlocs | add-elem-info · fix-altloc |
opt / tsopt |
Geometry / TS optimization | opt · tsopt |
path-opt / path-search |
MEP via GSM/DMF; recursive refinement | path-opt · path-search |
scan / scan2d / scan3d |
1D / 2D / 3D bond-distance scans | scan · scan2d · scan3d |
freq / irc |
Vibrational analysis + thermo / IRC (EulerPC) | freq · irc |
dft / sp |
Single-point DFT / single-point ML/MM ONIOM | dft · sp |
bond-summary |
Compare structures, report bond changes | bond-summary |
trj2fig / energy-diagram |
Energy plot / R→TS→P diagram | trj2fig · energy-diagram |
oniom-export / oniom-import |
Gaussian ONIOM / ORCA QM/MM input-deck exchange | oniom-export · oniom-import |
3-layer system (ML / Movable-MM / Frozen-MM, B-factor encoded), link-atom treatment, and units (energy: eV or Hartree; coordinates: Å or Bohr; forces: eV/Å or Hartree/Bohr): docs/concepts.md. Python API (MLMMCore, MLMMASECalculator, pysisyphus mlmm calculator): docs/python-api.md.
Getting Help
mlmm --help # top-level
mlmm <subcmd> --help # core options
mlmm <subcmd> --help-advanced # full option set
Issues: https://github.com/t-0hmura/mlmm_toolkit/issues.
Citation
@article{ohmura2025mlmm,
author = {Ohmura, Takuto and Inoue, Sei and Terada, Tohru},
title = {ML/MM Toolkit -- Toward Accelerated Mechanistic Investigation of Enzymatic Reactions},
year = {2025}, journal = {ChemRxiv}, doi = {10.26434/chemrxiv-2025-jft1k}
}
Agent Skills
Agent Skills for Claude Code / Codex / Cursor etc. in skills/ — copy into your project's skill location (e.g. .claude/skills/) to let an agent drive mlmm-toolkit workflows and subcommands.
Known limitations
- MACE + UMA cannot coexist (
e3nnversion conflict). Use separate conda envs. - DFT single-point cost and practical region size depend on method, basis, hardware, memory, and system; benchmark the intended setup before production.
- MLIP backends can differ in stationary-point curvature; validate the selected backend on representative structures and inspect the modes.
- CPU-only execution may be substantially slower than GPU depending on the
backend and system; AmberTools (
tleap) is required formm-parm.
Contributing
Issues and pull requests are welcome — see CONTRIBUTING.md.
License
GNU General Public License version 3 or later (GPL-3.0-or-later).
Metadata
Release files for mlmm-toolkit 0.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mlmm_toolkit-0.3.6.tar.gz | 3.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mlmm_toolkit-0.3.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.2 MB
Release files / mlmm_toolkit-0.3.6.tar.gz
| Download URL | mlmm_toolkit-0.3.6.tar.gz |
|---|---|
| Size | 3.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f83a8b425216a346d94a92ea33f93e3dd270ad518ac0b33dc8fa56da5d61d43
|
|
BLAKE2b-256 checksum How to use checksums |
46a3ca0bf13f2ba59b370d9303d11bac00e8f22a4e0224242e61d73dabba9abe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency logRelease files / mlmm_toolkit-0.3.6-py3-none-any.whl
| Download URL | mlmm_toolkit-0.3.6-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2fd37850ca2785940bd7db72c5b44d8c22c59f35fd74882f0d492582e4a166c6
|
|
BLAKE2b-256 checksum How to use checksums |
48d79631ab0563c008f18ffd0fa2e84228d9357c6c2fae2ef1d6ed60ace343f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.
Transparency log