Skip to main content

Streamlines preparation and equilibration of molecular complex for MD simulations

Whether the atomic coordinates come from experimentally determined complex structures or from co-folding AI models, they often require adjustments such as correcting ligand stereochemistry or fixing other structural details needed for molecular dynamics. mdworks streamlines this process by making it easy to prepare a valid protein-ligand complex and setup up and run equilibrium MD simulations with OpenMM.

Install

pixi

# For more details, visit https://pixi.prefix.dev/latest/installation/
$ curl -fsSL https://pixi.sh/install.sh | sh

mdworks

$ git clone https://github.com/sunghunbae/mdworks.git
$ cd mdworks
$ pixi install

Jupyter Notebook

# Add `mdworks` environment to JupyterLab
$ python -m ipykernel install --user --name='mdworks'

# Start the Jupyter lab
$ jupyter lab

Usage

Command-line interface workflow

2RAP (The small G protein RAP2A in complex with GTP)

$ mdworks --help

$ mdworks ready --help

# fix input PDB using PDBFixer and PDB2PQR
$ mdworks ready input.pdb --ligand UNL

# guess SMILES from a ligand PDB
$ mdworks guess input_UNL.pdb

# cut input PDB to reduce system size for MD
$ mdworks cut input_complex.pdb A:1-46,A:288-298

$ mdworks relax --help

# run restrained energy minimization (with implicit solvent)
# partial charges are assigned with AM1-BCC by default
$ mdworks relax input_complex_cut.pdb --smiles `cat input_UNL.smi`

# build a MD system with explicit solvent
$ mdworks build input_complex_cut_relaxed.pdb.gz --smiles `cat input_UNL.smi`

# run multi-stage equilibration MD simulations
$ mdworks equi input_complex_cut_relaxed.pdb.gz

# run production MD simulations
$ mdworks prod --time 5.0 input_complex_cut_relaxed.pdb.gz

# extend production MD simulations
$ mdworks prod --time 10.0 input_complex_cut_relaxed.pdb.gz
# Since 5.0 ns production simulation has been already completed,
# only remaining 5.0 ns production simulation will be conducted.
# The trajectories will be appended to the production .dcd file.

Python package

from mdworks import ValidComplex
from mdworks.protocol import Equilibrium

vc = ValidComplex('protein_ligand_complex.cif')

# fix ligand stereochemistry
vc.fix_ligand(`target_SMILES`)

# am1bcc charges
vc.assign_ligand_charges()

# build openmm system
vc.build()

# run multi-stage equilibrium MD simulations
md = Equilibrium(vc)
md.run()

Built-in Protocols

Relax (Restrained Energy Minimization)

Energy minimization with positional restraints on heavy atoms (k=1000) in implicit solvent (gbn2). Similar protocol is also known as Amber Relaxation. AlphaFold’s relaxation protocol uses OpenMM with an Amber force field (typically amber99sb) and implicit solvent to perform iterative, restrained energy minimization. It resolves steric clashes and stereochemical violations by progressively weakening harmonic restraints on the backbone while minimizing the potential energy.

Equilibrium (Multi-stage Equilibrium)

Stage Temperature (K) Posres (kJ/mol/nm**2) Friction (1/ps) Time (ps) Timestep (fs) Tag
Energy Minimization 1000 _0_min
NVT cold 10 1000 5 100 1 _1_nvt_cold
NVT warm 10 ⟶ 300 1000 1 145 2 _2_nvt_warm
NPT posres 300 1000 ⟶ 0 1 300 2 _3_npt_posres
NPT free 300 0 1 500 2 _4_npt_free

Desmond (Schrodinger Desmond Default Equilibrium)

  1. Energy Minimization
  2. Brownian Dynamics NVT, T = 10 K, small timesteps, and restraints on solute heavy atoms, 100ps, k=50
  3. NVT, T = 10 K, small timesteps, and restraints on solute heavy atoms, 12ps, k=50
  4. NPT, T = 10 K, and restraints on solute heavy atoms, 12ps, k=50
  5. NPT and restraints on solute heavy atoms, 12ps, k=50
  6. NPT and no restraints, 24ps

Notes on positional restraint force constant, k:

  • k=50 (kcal/mol/A^2) is equal to 20,920 (kJ/mol/nm^2) (1 kcal/mol/A^2 = 418.4 kJ/mol/nm^2)
  • k is scaled down to the typically used positional restraint force constant (1000 kJ/mol/nm^2) in the current protocol
Stage Temperature (K) Posres (kJ/mol/nm**2) Friction (1/ps) Time (ps) Timestep (fs) Tag
Energy Minimization 1000 _0_min
Brownian 10 1000 50 100 1 _1_brownian
NVT cold 10 1000 1 12 2 _2_nvt_cold
NPT cold 10 200 1 12 2 _3_npt_cold
NPT warm 10 ⟶ 300 40 1 12 2 _4_npt_warm
NPT free 300 0 1 24 2 _5_npt_free

Brownian dynamics corresponds to:

  • Motion dominated by friction + random force
  • Inertia negligible
  • Overdamped limit of Langevin dynamics
  • Langevin dynamics with very high friction and small timestep
  • Use with positional restraints is recommended
  • When to use:
    • Initial solvent relaxation
    • Ion placement adjustment
    • Avoids solute distortion
    • Prevents pressure spikes later

Production (Production MD)

HMR (hydrogen mass repartitioning) is used by default to enable 4 femtosecond timestep.

Metadata

Release files for mdworks 0.25.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mdworks 0.25.9
File Size Uploaded
mdworks-0.25.9.tar.gz 6.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for mdworks 0.25.9
File Interpreter ABI Platform
mdworks-0.25.9-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 MB

Release files / mdworks-0.25.9.tar.gz

Download URL mdworks-0.25.9.tar.gz
Size 6.2 MB
Tags Source
SHA-256 checksum
How to use checksums
86f6a776a9227389c5a30e654d9d78e9283f820581883960935a9bc2ff322c14
BLAKE2b-256 checksum
How to use checksums
b73e0b8a453ac330e5f50e89979759b43704afc9b7106b09634afbc0ddcbfa47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / mdworks-0.25.9-py3-none-any.whl

Download URL mdworks-0.25.9-py3-none-any.whl
Size 71.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72e029e02ae0f1b5e8e1c352a6a7c0400b78e8834cf7c13bb68e03f5286cd9f5
BLAKE2b-256 checksum
How to use checksums
5f8db4ec5211ea5c60e00963ac26b25ca162e136e9da5b334291574176241d8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.25.9 This release

2 release files

0.25.8

2 release files

0.25.7

2 release files

0.21.0

2 release files

0.17.0

2 release files

0.15.0

2 release files

0.13.0

2 release files

0.5.0

2 release files

0.4.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page