← 返回 Skills 市场
charleshahn

GROMACS Skills

作者 CharlesHahn · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
223
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gromacs-skills
功能描述
GROMACS 分子动力学模拟软件命令参考。当 Agent 需要执行 GROMACS 命令但不清楚用法时调用。功能覆盖:(1) 拓扑与结构处理 - pdb2gmx、editconf、solvate、insert-molecules、genrestr;(2) 模拟设置与运行 - grompp、mdrun;(3) 轨...
使用说明 (SKILL.md)

GROMACS

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

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

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

快速入门

检查版本

gmx --version

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

获取帮助

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

gmx \x3Ccommand> -h

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

# 带版本号搜索
web_search: "site:manual.gromacs.org gmx \x3Ccommand> \x3Cversion>"
# 示例: "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_dssp RMSD/RMSF、氢键、距离、二级结构等
结构分析 covar, anaeig, mdmat, sham, order, rotacf, dielectric PCA、距离矩阵、自由能景观
轨迹处理 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 TYPE PBC 处理(none, mol, atom, com, nojump)
-center 居中坐标
-fit TYPE 拟合轨迹(none, rot+trans 等)

性能参数

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

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

如何使用 GROMACS 命令

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

# 查看命令帮助
gmx \x3Ccommand> -h

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

本地帮助提供:

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

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

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

文件格式

输入格式

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

输出格式

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

版本兼容性

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

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

与 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)
  • ❌ 长时间生产运行(应由用户执行)

参考文档

相关资源

安全使用建议
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.
功能分析
Type: OpenClaw Skill Name: gromacs-skills Version: 1.0.0 The gromacs-skills bundle is a comprehensive documentation and command reference for the GROMACS molecular dynamics software. It provides legitimate usage examples, parameter explanations, and safety guidelines (e.g., in SKILL.md) that explicitly advise the agent against running long-duration simulations directly, suggesting instead that it generate scripts for the user. No signs of data exfiltration, malicious execution, or prompt injection were found.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gromacs-skills
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gromacs-skills 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
gromacs-skills 1.0.0 初始版本 - 提供 GROMACS 分子动力学模拟命令与参数详尽参考 - 覆盖命令类别:拓扑与结构、模拟设置、能量与轨迹分析、工具等 - 强调优先使用本地 gmx <command> -h 获取命令帮助 - 列举输入输出文件格式与常用命令参数 - 补充性能优化、常见问题与最佳实践指导 - 明确安全原则:生产运行应生成脚本,由用户执行
元数据
Slug gromacs-skills
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

GROMACS Skills 是什么?

GROMACS 分子动力学模拟软件命令参考。当 Agent 需要执行 GROMACS 命令但不清楚用法时调用。功能覆盖:(1) 拓扑与结构处理 - pdb2gmx、editconf、solvate、insert-molecules、genrestr;(2) 模拟设置与运行 - grompp、mdrun;(3) 轨... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 223 次。

如何安装 GROMACS Skills?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gromacs-skills」即可一键安装,无需额外配置。

GROMACS Skills 是免费的吗?

是的,GROMACS Skills 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

GROMACS Skills 支持哪些平台?

GROMACS Skills 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 GROMACS Skills?

由 CharlesHahn(@charleshahn)开发并维护,当前版本 v1.0.0。

💬 留言讨论