GROMACS MD Automation
Goal
Take a user's system description and structure, then run a scientifically sound GROMACS MD simulation with minimal back-and-forth and report the results.
Language
Users may write in Chinese (中文), English, or Japanese (日本語). Respond in the language the user uses.
Workflow
0. Collect inputs (ask only for what is missing)
- System type: protein / protein-ligand / nucleic acid / membrane / other
- Structure: PDB ID, PDB file, or ligand SMILES/SDF (sequence-only -> suggest AlphaFold modeling first)
- Goal: stability, conformational change, binding, free energy, etc.
- Optional preferences: force field, water model, temperature (default 310 K), simulation length (default 100 ns), salt concentration
See references/workflow.md for the input table and default choices. Do not block on optional preferences; use the defaults.
1. Verify environment
Run:
gmx --version (expect GPU support: CUDA and GROMACS >= 2024)
nvidia-smi (GPU visible)
If missing or broken, fix the environment first (references/workflow.md, Environment section).
2. Create the project directory
- Create
~/md_projects/<project>/ inside WSL. Never run large simulations on /mnt/c (slow I/O).
- Use subdirectories:
top/, em/, nvt/, npt/, md/, analysis/.
3. Build topology and solvate (per system type)
- Protein/peptide:
gmx pdb2gmx with the chosen force field; check termini, disulfides, and missing atoms.
- Protein-ligand: parameterize the ligand first (acpype/GAFF2 for AMBER, CGenFF for CHARMM), merge with the protein, and verify residue names/charges.
- Nucleic acid:
pdb2gmx supports DNA/RNA with AMBER or CHARMM force fields.
- Membrane: prepare with CHARMM-GUI or insane.py, then follow the membrane notes in references/workflow.md.
Then run editconf -d 1.0, solvate, and genion (neutralize, default 0.15 M NaCl). See references/workflow.md for exact commands.
4. Energy minimization
grompp with assets/templates/em.mdp, then mdrun.
- Acceptance: potential energy negative and converged (Fmax < 1000 kJ/mol/nm), no LINCS warnings.
5. Equilibration
- NVT (100 ps) then NPT (100 ps) with position restraints on heavy atoms.
- Use assets/templates/nvt.mdp and npt.mdp; adjust
tc-grps to the actual groups in the system.
- Acceptance: temperature and pressure stable near targets, no explosions.
6. Production MD
- Use assets/templates/md.mdp; set
nsteps for the requested time.
- Run on GPU:
gmx mdrun -deffnm md -nb gpu -pme gpu -update gpu -bonded gpu
- Drop
-bonded gpu for systems without GPU-supported bonded types.
- Check the first ~1 ns: energy, temperature, pressure, RMSD drift.
7. Analysis
- Core analyses:
gmx rms, rmsf, gyrate, hbond, energy, distances/contacts.
- Free-energy methods (umbrella sampling, gmx_MMPBSA, FEP) only when explicitly requested; confirm with the user because they are long and method-sensitive.
- Produce plots (matplotlib or xmgrace). Verify convergence before interpreting.
8. Report
Summarize: system, protocol (force field, water model, ions, time), GPU performance, key results (RMSD/RMSF/Rg/hydrogen bonds), equilibrium status, and caveats. Suggest next steps.
Rules
- Never fabricate results; only report numbers from actual output files.
- Validate every
mdrun completion: check for Finished mdrun and scan the log for fatal warnings.
- Scientific validity matters: ask when the force field or other choices would materially change the result.
- Keep raw trajectories (.xtc) and logs; all analysis must be reproducible.
Resources
- references/workflow.md - detailed commands per system type, recipes, and common errors
- assets/templates/*.mdp - ready-to-use EM/NVT/NPT/production parameter files
1---2name: gromacs-md3description: Automate GROMACS molecular dynamics (MD) simulations end-to-end. Use when the user wants to set up, run, debug, or analyze MD simulations with GROMACS/gmx, including protein, protein-ligand, peptide, nucleic-acid, or membrane systems; build topologies and .mdp files; run pdb2gmx, solvate, genion, grompp, mdrun; perform energy minimization, NVT/NPT equilibration, and production runs with GPU acceleration; analyze trajectories (RMSD, RMSF, Rg, hydrogen bonds, contacts, free energy); or troubleshoot GROMACS errors. Also triggered by Chinese requests containing GROMACS, gmx, or 分子动力学模拟, and Japanese requests containing 分子動力学シミュレーション.4---56# GROMACS MD Automation78## Goal910Take a user's system description and structure, then run a scientifically sound GROMACS MD simulation with minimal back-and-forth and report the results.1112## Language1314Users may write in Chinese (中文), English, or Japanese (日本語). Respond in the language the user uses.1516## Workflow1718### 0. Collect inputs (ask only for what is missing)1920- System type: protein / protein-ligand / nucleic acid / membrane / other21- Structure: PDB ID, PDB file, or ligand SMILES/SDF (sequence-only -> suggest AlphaFold modeling first)22- Goal: stability, conformational change, binding, free energy, etc.23- Optional preferences: force field, water model, temperature (default 310 K), simulation length (default 100 ns), salt concentration2425See references/workflow.md for the input table and default choices. Do not block on optional preferences; use the defaults.2627### 1. Verify environment2829Run:3031- `gmx --version` (expect `GPU support: CUDA` and GROMACS >= 2024)32- `nvidia-smi` (GPU visible)3334If missing or broken, fix the environment first (references/workflow.md, Environment section).3536### 2. Create the project directory3738- Create `~/md_projects/<project>/` inside WSL. Never run large simulations on `/mnt/c` (slow I/O).39- Use subdirectories: `top/`, `em/`, `nvt/`, `npt/`, `md/`, `analysis/`.4041### 3. Build topology and solvate (per system type)4243- Protein/peptide: `gmx pdb2gmx` with the chosen force field; check termini, disulfides, and missing atoms.44- Protein-ligand: parameterize the ligand first (acpype/GAFF2 for AMBER, CGenFF for CHARMM), merge with the protein, and verify residue names/charges.45- Nucleic acid: `pdb2gmx` supports DNA/RNA with AMBER or CHARMM force fields.46- Membrane: prepare with CHARMM-GUI or insane.py, then follow the membrane notes in references/workflow.md.4748Then run `editconf -d 1.0`, `solvate`, and `genion` (neutralize, default 0.15 M NaCl). See references/workflow.md for exact commands.4950### 4. Energy minimization5152- `grompp` with assets/templates/em.mdp, then `mdrun`.53- Acceptance: potential energy negative and converged (Fmax < 1000 kJ/mol/nm), no LINCS warnings.5455### 5. Equilibration5657- NVT (100 ps) then NPT (100 ps) with position restraints on heavy atoms.58- Use assets/templates/nvt.mdp and npt.mdp; adjust `tc-grps` to the actual groups in the system.59- Acceptance: temperature and pressure stable near targets, no explosions.6061### 6. Production MD6263- Use assets/templates/md.mdp; set `nsteps` for the requested time.64- Run on GPU:6566```bash67gmx mdrun -deffnm md -nb gpu -pme gpu -update gpu -bonded gpu68```6970- Drop `-bonded gpu` for systems without GPU-supported bonded types.71- Check the first ~1 ns: energy, temperature, pressure, RMSD drift.7273### 7. Analysis7475- Core analyses: `gmx rms`, `rmsf`, `gyrate`, `hbond`, `energy`, distances/contacts.76- Free-energy methods (umbrella sampling, gmx_MMPBSA, FEP) only when explicitly requested; confirm with the user because they are long and method-sensitive.77- Produce plots (matplotlib or xmgrace). Verify convergence before interpreting.7879### 8. Report8081Summarize: system, protocol (force field, water model, ions, time), GPU performance, key results (RMSD/RMSF/Rg/hydrogen bonds), equilibrium status, and caveats. Suggest next steps.8283## Rules8485- Never fabricate results; only report numbers from actual output files.86- Validate every `mdrun` completion: check for `Finished mdrun` and scan the log for fatal warnings.87- Scientific validity matters: ask when the force field or other choices would materially change the result.88- Keep raw trajectories (.xtc) and logs; all analysis must be reproducible.8990## Resources9192- references/workflow.md - detailed commands per system type, recipes, and common errors93- assets/templates/*.mdp - ready-to-use EM/NVT/NPT/production parameter files