OpenMM molecular dynamics engine for protein and ligand simulations. Run NVE/NVT/NPT ensembles, compute free energies, analyze dynamics. Supports AMBER, CHARMM, OPLS force fields and GPU acceleration. For classical MD with periodic systems, use ase. For quick quantum chemistry, use mopac.
OpenMM is a toolkit for molecular simulation, particularly suited for biomolecular systems (proteins, ligands, membranes). This skill provides computational investigation capabilities for protein dynamics, ligand binding exploration, conformational sampling, and free energy calculations. OpenMM supports GPU acceleration for high-performance simulations and multiple force fields (AMBER, CHARMM, OPLS).
Basic MD Run:
Simulate protein motion in explicit solvent:
from openmm import *
from openmm.app import *
from openmm.unit import *
# Load structure
pdb = PDBFile('protein.pdb')
# Create force field and system
forcefield = ForceField('amber14-all.xml', 'amber14/tip3p.xml')
system = forcefield.createSystem(pdb.topology, nonbondedMethod=PME)
# Create integrator (NVT ensemble)
integrator = LangevinIntegrator(300*kelvin, 1/picosecond, 2*femtoseconds)
# Run simulation
simulation = Simulation(pdb.topology, system, integrator)
simulation.context.setPositions(pdb.positions)
simulation.minimizeEnergy()
simulation.reporters.append(PDBReporter('trajectory.pdb', 1000))
simulation.step(100000) # 200 ps
Key Ensembles:
Protein-Ligand Complex Dynamics:
Simulate ligand movement in protein binding pocket:
# Load complex (protein + ligand)
pdb = PDBFile('complex.pdb')
# Create system with AMBER FF
forcefield = ForceField('amber14-all.xml', 'amber14/tip3p.xml')
system = forcefield.createSystem(
pdb.topology,
nonbondedMethod=PME,
constraints=HBonds
)
# Run with restraints on protein (ligand free)
# Can use positional restraints to keep protein stable
Binding Free Energy (Alchemical):
Calculate free energy of ligand binding:
# Thermodynamic Integration (TI) or
# Free Energy Perturbation (FEP)
# Alchemically transform ligand from bound → unbound state
Enhanced Sampling Techniques:
Explore conformational landscape:
# Replica Exchange Molecular Dynamics (REMD)
# Multiple replicas at different temperatures
# Exchanges improve sampling efficiency
# Or: Simulated annealing
# Gradual temperature reduction
Structure Optimization:
Relax structures before MD:
simulation.minimizeEnergy(maxIterations=1000)
Finds local energy minimum without dynamics.
Extract Properties:
Compute from trajectories:
- Root-mean-square deviation (RMSD)
- Radius of gyration (Rg)
- Hydrogen bond occupancy
- Dihedral angles (phi/psi for proteins)
- Free energy differences
- Binding free energies (MM-PBSA)
Computational Drug Discovery:
Protein Engineering:
Structural Biology:
Membrane Systems:
Input:
pdb (X-ray structures)ase (optimized geometries)pubchem (ligand structures)uniprot (homology modeling)Output:
tdcarxivTimescales:
GPU Acceleration:
# 1. Prepare protein structure
python openmm_setup.py --pdb protein.pdb --force-field amber14
# 2. Run MD simulation
python openmm_md.py --structure prepared.pdb --temperature 300 \
--ensemble nvt --duration 100 # ns
# 3. Analyze trajectory
python openmm_analysis.py --trajectory trajectory.dcd \
--reference protein.pdb --metrics rmsd radius-of-gyration