Skip to content
Skillpedia
Machine learning51k · #1908

molecular-dynamics

Lets your agent run and analyze molecular dynamics simulations. It's useful for studying protein-molecule interactions and biophysics.

What it does

This tool simulates how molecules move over time. It helps understand protein stability, how drugs bind to them, and how they change shape.

When to use it

  • ✓To see if a change in a protein makes it more or less stable.
  • ✓To simulate how a drug fits and interacts with a protein.
  • ✓To explore the different shapes a protein can take.

Example of what to ask your AI

“Simulate the stability of protein X after mutation Y.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/molecular-dynamics/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/molecular-dynamics/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool uses programs called OpenMM and MDAnalysis. OpenMM simulates the movement of molecules, and MDAnalysis helps analyze the results of this simulation.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add K-Dense-AI/scientific-agent-skills --skill molecular-dynamics

Or download just the file:

curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/molecular-dynamics/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Molecular Dynamics

Overview

Molecular dynamics (MD) simulation computationally models the time evolution of molecular systems by integrating Newton's equations of motion. This skill covers two complementary tools:

  • OpenMM (https://openmm.org/): High-performance MD simulation engine with GPU support, Python API, and flexible force field support
  • MDAnalysis (https://mdanalysis.org/): Python library for reading, writing, and analyzing MD trajectories from all major simulation packages

Reviewed versions: OpenMM 8.6.1 and MDAnalysis 2.10.0. Reference-platform smoke checks use small synthetic systems; GPU performance and scientific convergence are not established by them. OpenMM latest API pages identify a development build, so the installed 8.6.1 API is the executable reference.

Installation into a dedicated environment:

uv venv --python 3.12 .venv-md
uv pip install --python .venv-md/bin/python "openmm==8.6.1" "MDAnalysis==2.10.0" matplotlib pandas
# Windows: use .venv-md/Scripts/python.exe instead

When to Use This Skill

Use molecular dynamics when:

  • Protein stability analysis: How does a mutation affect protein dynamics?
  • Drug binding simulations: Characterize binding mode and residence time of a ligand
  • Conformational sampling: Explore protein flexibility and conformational changes
  • Protein-protein interaction: Model interface dynamics and binding energetics
  • RMSD/RMSF analysis: Quantify structural fluctuations from a reference structure
  • Free energy estimation: Compute binding free energy or conformational free energy
  • Membrane simulations: Model proteins in lipid bilayers
  • Intrinsically disordered proteins: Study IDR conformational ensembles

Core Workflow: OpenMM Simulation

Examples require system-specific preparation and validation. Review biological assembly, alternate locations, missing loops, termini, protonation, disulfides, ligands and cofactors before parameterization. An MD trajectory alone does not establish binding free energy or residence time.

The functions below form one Python module: execute their import blocks together. Use a new output prefix for every stage to avoid overwriting earlier results.

1. System Preparation

from openmm.app import *
from openmm import *
from openmm.unit import *

def prepare_system_from_pdb(pdb_file, forcefield_name="amber14-all.xml",
                              water_model="amber14/tip3pfb.xml", ph=7.0):
    """
    Prepare an OpenMM system from a PDB file.

    Args:
        pdb_file: Path to cleaned PDB file (use PDBFixer for raw PDB files)
        forcefield_name: Force field XML file
        water_model: Water model XML file

    Returns:
        modeller, system
    """
    # Load PDB
    pdb = PDBFile(pdb_file)

    # Load force field
    forcefield = ForceField(forcefield_name, water_model)

    # Add hydrogens and solvate
    modeller = Modeller(pdb.topology, pdb.positions)
    modeller.addHydrogens(forcefield, pH=ph)

    # TIP3P geometry also serves TIP3P-FB; XML supplies the parameters.
    # 10 Å padding; added salt excludes neutralizing counterions.
    modeller.addSolvent(
        forcefield,
        model='tip3p',
        padding=10*angstroms,
        ionicStrength=0.15*molar, neutralize=True
    )

    print(f"System: {modeller.topology.getNumAtoms()} atoms, "
          f"{modeller.topology.getNumResidues()} residues")

    # Create system
    system = forcefield.createSystem(
        modeller.topology,
        nonbondedMethod=PME,         # Particle Mesh Ewald for long-range electrostatics
        nonbondedCutoff=1.0*nanometer,
        constraints=HBonds,           # Constrain bonds involving H (not intermolecular H-bonds)
        rigidWater=True,
        ewaldErrorTolerance=0.0005
    )

    return modeller, system

2. Energy Minimization

from openmm.app import *
from openmm import *
from openmm.unit import *

def minimize_energy(modeller, system, output_pdb="minimized.pdb",
                     max_iterations=1000, tolerance=10.0, platform_name=None):
    """
    Energy minimize the system to remove steric clashes.

    Args:
        modeller: Modeller object with topology and positions
        system: OpenMM System
        output_pdb: Path to save minimized structure
        max_iterations: Maximum minimization steps
        tolerance: Convergence criterion in kJ/mol/nm

    Returns:

…
FAQ

What is a molecular dynamics simulation?

It's a way to use computers to predict how molecules move and interact over time, like watching a movie of their behavior.

What is a 'force field'?

It's a set of rules and parameters that tell the computer how forces between atoms and molecules work, allowing it to simulate their movement.

What is a PDB file?

It's a file that describes the 3D structure of a molecule, like a protein, in a format computers can read.

Details

Original description by the author

Runs and analyzes molecular dynamics simulations with OpenMM and MDAnalysis. Sets up protein/small molecule systems, defines force fields, runs energy minimization and production MD, and analyzes trajectories (RMSD, RMSF, contact maps, free energy surfaces). For structural biology, drug binding, and biophysics.

repo: K-Dense-AI/scientific-agent-skills

Popularity

GitHub stars
51k
Ranking position
#1908
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills