GROMACS Skills

v1.0.0

GROMACS 分子动力学模拟软件命令参考。当 Agent 需要执行 GROMACS 命令但不清楚用法时调用。功能覆盖:(1) 拓扑与结构处理 - pdb2gmx、editconf、solvate、insert-molecules、genrestr;(2) 模拟设置与运行 - grompp、mdrun;(3) 轨...

1· 216·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for charleshahn/gromacs-skills.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "GROMACS Skills" (charleshahn/gromacs-skills) from ClawHub.
Skill page: https://clawhub.ai/charleshahn/gromacs-skills
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install charleshahn/gromacs-skills

ClawHub CLI

Package manager switcher

npx clawhub@latest install gromacs-skills
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the provided artifacts: the files are detailed GROMACS command and parameter references. No unrelated env vars, binaries, or installs are requested.
Instruction Scope
SKILL.md limits itself to help text, example gmx commands, advice to prefer local `gmx <command> -h`, and guidance to avoid running long production `mdrun` runs autonomously. It does not instruct reading unrelated system files or exfiltrating data.
Install Mechanism
No install spec or downloaded code — instruction-only skill. Nothing is written to disk or fetched at install time.
Credentials
No environment variables, credentials, or configuration paths are requested. The skill’s needs are proportional to a documentation/reference skill.
Persistence & Privilege
always is false and the skill does not request elevated or persistent privileges or attempt to modify other skills or system settings. Autonomous invocation is allowed by default but is appropriate for a helper skill.
Assessment
This skill is a local GROMACS command/reference guide and appears coherent. Before enabling it, ensure you actually want an agent that can run local shell commands (it may invoke `gmx` if given permission) and confirm GROMACS is installed and at the expected version. The SKILL explicitly warns agents not to run long production `mdrun` jobs — prefer to have the agent generate scripts for you to run on your compute environment. If you do not want the agent to execute commands on your machine, restrict model-invoked execution or only use the skill interactively.

Like a lobster shell, security has layers — review code before you run it.

latestvk974vnbmwqa07a7d92nb7h0a918322zs
216downloads
1stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

GROMACS

重要:始终先查看本地帮助

GROMACS 版本差异可能导致参数不同。务必先运行 gmx <command> -h 获取该命令最准确的参数信息。

GROMACS 是分子动力学模拟软件包,可模拟从几百到数百万粒子的系统。本技能提供 GROMACS 命令参考和工作流指南。

快速入门

检查版本

gmx --version

记录版本号以便查阅对应文档。

获取帮助

优先级 1:本地帮助(最快、版本匹配)

gmx <command> -h

优先级 2:在线文档(详细、官方)

# 带版本号搜索
web_search: "site:manual.gromacs.org gmx <command> <version>"
# 示例: "site:manual.gromacs.org gmx rms 2024.3"

命令分类

分类主要命令说明
拓扑与结构pdb2gmx, editconf, solvate, insert-molecules, genrestr生成拓扑、定义盒子、添加溶剂
模拟设置grompp, mdrun生成运行文件、执行模拟
能量分析energy, eneconv, bar提取能量、自由能计算
轨迹分析rms, rmsf, gyrate, hbond, distance, angle, dihedral, cluster, mindist, sasa, principal, do_dsspRMSD/RMSF、氢键、距离、二级结构等
结构分析covar, anaeig, mdmat, sham, order, rotacf, dielectricPCA、距离矩阵、自由能景观
轨迹处理trjconv, trjcat, trjorder, dump格式转换、PBC 修正、轨迹拼接
索引与选择make_ndx, select, genion创建索引组、选择原子、添加离子
工具xpm2ps, x2top, check, wham, tune_pme格式转换、检查文件、WHAM 分析

完整命令说明请参阅 command-categories.md

常用参数

输入输出

参数说明
-f INPUT输入轨迹/结构文件
-s TOPOLOGY输入拓扑文件(.tpr)
-n INDEX输入索引文件(.ndx)
-o OUTPUT输出文件
-deffnm BASENAME默认文件名前缀

时间选择

参数说明
-b TIME起始时间(ps)
-e TIME结束时间(ps)
-dt TIME时间步长(ps)

轨迹处理

参数说明
-pbc TYPEPBC 处理(none, mol, atom, com, nojump)
-center居中坐标
-fit TYPE拟合轨迹(none, rot+trans 等)

性能参数

参数说明
-nt NUMBER线程数
-ntomp NUMBEROpenMP 线程数
-nb TYPE邻居搜索(cpu, gpu)

完整参数说明请参阅 common-parameters.md

如何使用 GROMACS 命令

核心原则:始终先查看本地帮助

# 查看命令帮助
gmx <command> -h

# 示例
gmx rms -h
gmx trjconv -h
gmx energy -h

本地帮助提供:

  • 完整参数列表
  • 默认值说明
  • 输入/输出文件要求
  • 使用示例

在线文档查询(本地帮助不够时):

# 带版本号搜索官方文档
web_search: "site:manual.gromacs.org gmx <command> <version>"
# 示例: "site:manual.gromacs.org gmx rms 2024.3"

文件格式

输入格式

格式说明
.pdbProtein Data Bank 格式
.groGROMACS 坐标格式
.tprGROMACS 运行输入文件(拓扑+参数)
.xtc压缩轨迹(有损,适合长模拟)
.trr全精度轨迹
.ndx索引文件(原子组)
.mdp分子动力学参数文件
.top拓扑文件

输出格式

格式说明
.xvgGrace/XVG 图表格式(时间序列数据)
.xpm像素图格式(矩阵、热图)
.edr能量文件(二进制)
.log日志文件
.cpt检查点文件(用于续算)

版本兼容性

不同 GROMACS 版本可能有参数差异:

  • .tpr 文件不兼容不同主版本
  • 升级版本后需重新生成 .tpr 文件
  • 始终检查 .mdp 参数是否有效
  • 版本差异请查询官方文档:site:manual.gromacs.org <version>

与 DuIvyTools 配合

GROMACS 输出文件可使用 DuIvyTools 可视化:

  • .xvg 文件:RMSD、RMSF、能量、氢键等时间序列数据
  • .xpm 文件:DCCM、FEL、DSSP 等矩阵数据

使用 duivytools-skills 技能进行可视化:

# 可视化 RMSD
dit xvg_show -f rmsd.xvg -x "Time (ns)" -y "RMSD (nm)"

# 可视化 DCCM
dit xpm_show -f dccm.xpm -cmap coolwarm -zmin -1 -zmax 1

# 可视化自由能景观
dit xpm_show -f fel.xpm -m 3d -eg plotly

性能优化

并行执行

# OpenMP(多线程)
gmx mdrun -nt 4 -s topol.tpr -deffnm md

# MPI(多节点)
mpirun -np 4 gmx_mpi mdrun -s topol.tpr -deffnm md

# 混合 MPI+OpenMP
mpirun -np 2 gmx_mpi mdrun -ntomp 2 -s topol.tpr -deffnm md

GPU 加速

# GPU 用于非键相互作用
gmx mdrun -ntomp 4 -nb gpu -s topol.tpr -deffnm md

# GPU 用于更新
gmx mdrun -ntomp 4 -nb gpu -update gpu -s topol.tpr -deffnm md

常见问题

"Fatal error: No such group":索引组未找到

  • 解决方案:使用 make_ndx 创建正确的索引文件

"Fatal error: Domain decomposition error":并行设置问题

  • 解决方案:调整 MPI 进程数或域分解参数

"Fatal error: Number of coordinates does not match topology":文件不匹配

  • 解决方案:重新生成拓扑或坐标文件

最佳实践

  • 使用前检查版本
  • 优先使用本地帮助获取准确参数
  • 大模拟前先在小系统测试
  • 生产运行时监控能量守恒
  • 修改前备份文件
  • 记录所有参数以便复现
  • 使用 DuIvyTools 进行可视化分析

重要安全提示

Production Run(生产运行)

Agent 不应主动执行 mdrun 生产运行。正确的做法是:

  • 生成运行脚本(如 run.sh)供用户执行
  • 脚本应包含完整的运行命令和参数
  • 让用户在合适的计算环境中自行运行

示例脚本:

#!/bin/bash
# run_md.sh - 生产运行脚本
gmx mdrun -s md.tpr -deffnm md -ntomp 4 -nb gpu

Agent 可以执行的操作:

  • ✅ 能量最小化(短时间)
  • ✅ NVT/NPT 平衡(短时间)
  • ✅ 分析命令(rms, rmsf, hbond 等)
  • ✅ 轨迹处理(trjconv)
  • ❌ 长时间生产运行(应由用户执行)

参考文档

相关资源

Comments

Loading comments...