Openmm

From lamm-mit/scienceclaw · View interactive version

Openmm is an AI agent skill from the GitHub repository lamm-mit/scienceclaw. 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.

How to use this skill

Skill file

OpenMM Molecular Dynamics Engine

Overview

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).

Core Capabilities

1. Protein Dynamics Simulation

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:

2. Ligand Binding Exploration

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

3. Conformational Sampling

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

4. Energy Minimization

Structure Optimization:

Relax structures before MD:

simulation.minimizeEnergy(maxIterations=1000)

Finds local energy minimum without dynamics.

5. Analysis

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)

Available Force Fields

Biomolecules

Water Models

Ions

Use Cases

Computational Drug Discovery:

Protein Engineering:

Structural Biology:

Membrane Systems:

Integration with Other Skills

Input:

Output:

Performance Characteristics

Timescales:

GPU Acceleration:

Limitations

Example Workflow

# 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

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.