Molecular Dynamics logo

Molecular Dynamics

Community
ssinder
molecular-dynamics

Analyses molecular-dynamics trajectories with a self-contained pure-numpy DCD and PDB trajectory parser plus built-in Kabsch-Sander alignment, SVD-based PCA, hierarchical clustering of RMSD matrices, geometric hydrogen-bond detection, RMSF, radius of gyration, Ramachandran analysis, inter-chain contacts and Shrake-Rupley SASA. This skill should be used when trajectory RMSD or RMSF, PCA, conformational clustering, hydrogen-bond occupancy, Ramachandran plots or solvent-accessible surface analysis is requested.

Overview

Publisherssinder
Repositorybioinformatics-agent-skills
Skill namemolecular-dynamics
Stars
75
Forks
2
Bundled files
8
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ssinder on GitHub. Read the source before you install it.

Installation

Install the Molecular Dynamics AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/molecular-dynamics
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ssinder/bioinformatics-agent-skills.git /tmp/bioinformatics-agent-skills
mkdir -p .claude/skills
cp -r /tmp/bioinformatics-agent-skills/skills/molecular-dynamics .claude/skills/molecular-dynamics
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Molecular Dynamics in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Molecular Dynamics on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Molecular Dynamics is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Molecular Dynamics Trajectory Analysis

Overview

This skill turns raw MD trajectories into quantitative conformational descriptors. It ships a self-contained pure-numpy DCD parser (DCD is a Fortran-style fixed-length record stream: an 84-byte header record followed by per-frame coordinate records), so a trajectory produced by NAMD, CHARMM, GROMACS or LAMMPS can be analysed without installing MDAnalysis. A multi-model PDB parser and an XYZ parser are provided as well, and MDAnalysis is used automatically when it is available.

All core algorithms are implemented directly and are numerically well-defined:

  • Kabsch-Sander optimal rigid-body superposition via SVD of the covariance matrix (with the determinant correction that prevents reflection).
  • PCA by eigendecomposition of the coordinate covariance matrix.
  • Hierarchical clustering (average/complete/ward linkage) of the pairwise RMSD matrix.
  • Hydrogen bonds by a distance + angle geometric criterion.
  • Shrake-Rupley solvent-accessible surface area.
  • Ramachandran region assignment from backbone φ/ψ dihedrals.

run_simulation.py drives a real MD run through OpenMM when OpenMM is installed (force-field setup, Langevin thermostat, minimisation, equilibration, production run, DCD output).

When to Use This Skill

  • RMSD / RMSF / radius-of-gyration time series from a DCD trajectory
  • Principal component analysis of conformational motion
  • Clustering a trajectory into conformational states (RMSD matrix + linkage)
  • Hydrogen-bond counts and occupancy across frames
  • Ramachandran distribution and secondary-structure validation of a trajectory
  • Inter-chain contact stability in a protein–protein or protein–ligand complex
  • Solvent-accessible surface area and buried-surface estimation
  • Reading DCD files without installing MDAnalysis
  • Running a short MD simulation with OpenMM

Quick Start

bash
# 基础分析(DCD + 拓扑 PDB)
python scripts/run_analysis.py --input traj.dcd --topology system.pdb \
    --output results/

# 只算 RMSD 与 RMSF
python scripts/run_analysis.py --input traj.dcd --topology system.pdb \
    --analysis rmsd,rmsf --output results/

# 跳过平衡阶段(只看生产段)
python scripts/run_analysis.py --input traj.dcd --topology system.pdb \
    --start 500 --stride 2 --output results/

# 按簇数做构象聚类
python scripts/run_analysis.py --input traj.dcd --topology system.pdb \
    --analysis cluster --n-clusters 5 --output results/

# 用 OpenMM 跑一段模拟(生产期)
python scripts/run_simulation.py --input system.pdb --output results/ --steps 100000

# 复合物的分阶段平衡协议(NVT → NPT → 生产期,带位置限制)
python scripts/run_simulation.py --input complex.pdb --output results/ \
    --nvt-steps 50000 --npt-steps 50000 --restraints backbone \
    --monitor-chain-separation --steps 500000

# 生产期也保持弱位置限制(k=10 kJ/mol/Ų)
python scripts/run_simulation.py --input complex.pdb --output results/ \
    --nvt-steps 50000 --restraints backbone --production-restraint-force-constant 10

Workflow

Analysis path

  1. Load — trajectory_io.py reads the trajectory. MDAnalysis is tried first; otherwise the built-in parsers handle .dcd (Fortran record stream), .pdb (multi-model) and .xyz. Topology (atom names, elements, chains, residues) comes from the --topology PDB when supplied.
  2. Select — the selection string (protein, name CA, resname LIG, resid 1-50, chain A) is resolved to an atom index array; masses are attached for mass-weighted quantities.
  3. Superpose — every frame is aligned to the reference frame by kabsch_align, giving the rotation matrix, translation and residual RMSD.
  4. Analyse — RMSD (global + per-residue Cα), RMSF, radius of gyration, hydrogen bonds, PCA, dihedral series, Ramachandran, conformational clustering, inter-chain contacts and SASA.
  5. Report — writes md_analysis.json and md_analysis_frames.csv.

Simulation path (run_simulation.py)

The simulation follows a staged equilibration protocol, which is the standard way to avoid the two classic failure modes of complex simulations: chains drifting apart during equilibration, and sampling a structure that never relaxed out of its crystal-packing geometry.

  1. Minimise — simulation.minimizeEnergy() removes the steric clashes inherited from the input structure.
  2. NVT equilibration (--nvt-steps) — constant volume, velocities re-drawn at the target temperature. Optional position restraints (--restraints) hold the backbone in place so only side chains and solvent relax.
  3. NPT equilibration (--npt-steps) — a MonteCarloBarostat is added and the simulation is rebuilt so the pressure coupling takes effect on the density.
  4. Production — position restraints are removed by default (use --production-restraint-force-constant to keep a weak version). Chain separation is monitored throughout if --monitor-chain-separation is set.
  5. Stability check — the final coordinates are screened for NaN / Inf / numerical blow-up; if found, the simulation is rolled back to the input structure and the reason is recorded in the report.

Implementation note. Position restraints must be added to the System before the Simulation (and therefore the Context) is created — modifying system afterwards does not rebuild the context, so the force would silently never take effect. The same applies when adding the barostat or removing the restraints: the simulation is rebuilt and positions plus velocities are carried over.

Parameters

ParameterDefaultDescription
--inputrequired轨迹文件路径(DCD / PDB / XYZ)
--topology—拓扑 PDB,提供原子名 / 元素 / 链 / 残基信息
--outputresults/输出目录
--start / --stop / --stride0 / — / 1帧范围与步长
--selectionprotein分析选择串
--analysisall分析项逗号分隔:rmsd,rmsf,rg,hbond,pca,dihedral,ramachandran,cluster,interchain,sasa
--fit-reference0RMSD 叠合参考帧
--hbond-angle120.0氢键最小 D-H···A 角度(度)
--hbond-h-dist2.5H···A 最大距离(Å)
--hbond-da-dist3.5D···A 最大距离(Å)
--n-clusters自动聚类簇数
--cluster-threshold自动聚类 RMSD 阈值(Å),给出时优先
--contact-dist4.5链间接触距离阈值(Å)
--sasa-points100SASA 每原子球面采样点数
--max-cluster-frames200参与聚类的最大帧数
--formatbothjson / csv / both

run_simulation.py 额外参数:

ParameterDefaultDescription
--force-fieldamber14力场预设:amber14 / amber99 / charmm36
--solventimplicit溶剂处理:none / implicit / vacuum
--steps1000生产期步数
--equilibration-steps100NVT/NPT 之后的通用平衡步数
--minimize-steps200能量最小化步数
--temperature300.0温度(K)
--friction1.0Langevin 摩擦系数 /ps
--timestep0.002积分步长(ps)
--platform—OpenMM 平台名(CUDA / CPU / OpenCL)
--nvt-steps0NVT 平衡步数(0 = 跳过)
--npt-steps0NPT 平衡步数(0 = 跳过)
--pressure1.0NPT 目标压力(bar)
--restraintsnone平衡期位置限制:none / backbone / ca / heavy / all
--restraint-force-constant100.0位置限制力常数(kJ/mol/Ų)
--production-restraint-force-constant0.0生产期位置限制力常数(>0 表示保留限制)
--monitor-chain-separationoff监测链间距离,检测复合物解离
--chain-separation-threshold30.0链间距告警阈值(Å)
--chain-monitor-interval10000链分离检查间隔(步)
--check-onlyoff仅检查 OpenMM 是否可用并退出

Outputs

FileContent
md_analysis.json完整结果:RMSD/RMSF/Rg/氢键/PCA/二面角/Ramachandran/聚类/链间接触/SASA
md_analysis_frames.csv逐帧汇总表(帧号、时间、RMSD、Rg、氢键数、SASA)
trajectory.dcdOpenMM 模拟输出轨迹(run_simulation.py)
final_state.pdb模拟末态结构(run_simulation.py)
state.csv模拟过程状态报告(能量、温度、体积)
simulation_report.json模拟参数与结果摘要(含 stages / restraints / stability / chain_separation)

Validation

  • RMSD must start near zero: the frame used as --fit-reference must have RMSD ≈ 0 by construction. If not, the alignment code path is broken.
  • RMSD is bounded by the drift: a trajectory with a global translation of 0.02 Å/frame must show a roughly linear RMSD growth after superposition; a flat curve means the superposition is absorbing the motion.
  • RMSF sanity: for a well-folded globular domain, mean Cα RMSF is typically 0.5-2 Å; values above 5 Å indicate an unstable or badly parameterised simulation. Values below 0.01 Å mean the trajectory is frozen or the frames are identical.
  • Rg vs structure: Rg ≈ 2.2 × N^0.38 Å is a common empirical rule for globular proteins. A sudden jump in Rg usually indicates unfolding.
  • Hydrogen bonds: a stable protein in water shows 50-200 backbone-sidechain and backbone-backbone hydrogen bonds per frame. Zero hydrogen bonds with non-zero donors and acceptors means the topology lacks hydrogen atoms (X-ray structures) — add them before analysis.
  • PCA: the first principal component of a globular protein usually explains 30-60% of the variance. A single component explaining >95% usually means global translation/rotation was not removed before the analysis.
  • Clustering: the number of clusters must be consistent with the RMSD matrix structure. If all frames land in one cluster while the RMSD range is wide, the linkage threshold is too large.
  • Ramachandran: a well-behaved simulation has fewer than 0.5% outliers in the allowed regions. More outliers indicates either force-field problems or an incorrect topology (e.g. broken backbone connectivity).
  • SASA: for a 100-residue globular protein, total SASA is typically 5000-7000 Ų. Much lower values indicate collapsed/over-packed structures.
  • DCD parsing: the parsed n_atoms must match the topology atom count; a mismatch means the DCD and topology do not correspond.
  • Equilibration stages: simulation_report.json → stages must list every stage that was requested. A requested --nvt-steps that does not appear means the stage was silently skipped.
  • Chain separation: when --monitor-chain-separation is on, the chain_separation block must exist and final_check.separated must be false for a stable complex. A true value means the chains drifted apart — check the starting structure (usually a docking pose that was never relaxed) before trusting any downstream analysis.
  • Restraint effect: with --restraints backbone on, the NVT trajectory must show a noticeably smaller backbone RMSD than an unrestrained run. If the numbers are identical, the restraints never took effect — this happens when the force is added to the System after the Context was created.
  • Stability: stability.should_rollback must be false for a healthy run. If it is true, the report's stability.reason explains whether the coordinates went NaN, hit Inf, or blew up numerically — a NaN in the very first frames usually points at a bad force field or missing hydrogens rather than at the dynamics themselves.

References

  • references/methodology.md — algorithms, formulas and parameter rationale
  • references/troubleshooting.md — common failures and how to diagnose them

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Molecular Dynamics AI skill do?

Analyses molecular-dynamics trajectories with a self-contained pure-numpy DCD and PDB trajectory parser plus built-in Kabsch-Sander alignment, SVD-based PCA, hierarchical clustering of RMSD matrices, geometric hydrogen-bond detection, RMSF, radius of gyration, Ramachandran analysis, inter-chain contacts and Shrake-Rupley SASA. This skill should be used when trajectory RMSD or RMSF, PCA, conformational clustering, hydrogen-bond occupancy, Ramachandran plots or solvent-accessible surface analysis is requested.

Why use Molecular Dynamics on TypingMind?

Because you install it once and use it with any model. Molecular Dynamics is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Molecular Dynamics in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ssinder/bioinformatics-agent-skills/tree/main/skills/molecular-dynamics. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Molecular Dynamics?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Molecular Dynamics?

As many as you like. As long as a model supports skills, you can use Molecular Dynamics with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Molecular Dynamics AI skill free?

Yes. It is published on GitHub by ssinder under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇