/mdclaw:md-fepfrom mdclaw
Estimates folding stability change (ddG) for single point mutations using hybrid-topology free energy perturbation with MDClaw and OpenMM. Runs both folded and unfolded legs in one job.
Ships in mdclaw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a computational biophysics expert estimating how one amino-acid substitution changes folding stability, using alchemical free energy perturbation on a hybrid topology.
Follow skills/common/preamble.md, skills/common/run-loop.md (the canonical
node loop), skills/common/solvent-regimes.md, and
skills/common/tool-output.md for error handling.
Before every state-changing command in this skill:
[CHAIN:]<wt><resseq><mut>
(A:L99A). Multi-site, insertion, deletion, or non-protein mutations are out
of scope: say so and stop.prep
child of the protein's prep node (extract_tripeptide), so source,
preparation and protonation are shared by construction; estimate_ddg
refuses legs whose remaining settings differ (fep_legs_incompatible).topo node is built by build_hybrid_system, not build_amber_system.
min, eq, and fep descend from that hybrid topo.run_fep runs on a GPU (--platform CUDA); one window is a full MD run.
Never start the 21-window default on CPU.estimate_ddg node, whose two
analyze_fep parents each completed with min_neighbour_overlap >= 0.03.| Parameter | Value |
|---|---|
| Target structure | PDB id / file (folded state) |
| Mutation | [CHAIN:]<wt><resseq><mut> |
| Execution mode | autonomous / human_in_the_loop |
| Solvent regime | explicit (implicit is not supported for FEP) |
| Windows | 21 (default) or an explicit --lambda-schedule |
| Sampling per window | user-specified; autonomous default 1 ns (sanity) |
| Unfolded model | capped tripeptide (default) or --flank N |
Autonomous default: proceed without asking when the mutation string is unambiguous against the structure.
comparison analyze node over the two legs'
analyze_fep nodes. Its lineage holds both legs, next leads to it, and
md-report reads it like any other analysis.Charge-changing mutations (e.g. K→A, D→N) are handled by
build_hybrid_system itself: one bulk water far from the site turns into a
counter-ion along the same λ path (co-alchemical ion), so the box charge is
the same at both end states. Nothing to pass; the result's
charge_correction block names the water, the ion and where along λ it
appears (lambda_range = the steric-swap phase, window_indices; compare these
with a dip in the overlap matrix), and both legs get it
automatically. It needs salt ions in the box (keep solvate_structure's
default --salt). Do not pass --charge-correction none unless the user asks
for the uncorrected number; if you do, report the warning verbatim with the
ddG. Give the decharge phase more room for these mutations: --phase-bounds 0.35,0.75 (default
0.25,0.75: old charges off by the first bound, steric swap done by the
second, new charges on after it), identically on both legs.
Options that change the physics, all to be used identically on both legs unless stated:
| Option | Tool | When |
|---|---|---|
--phase-bounds p1,p2 | build_hybrid_system | charge-changing or bulky mutations whose decharge / swap phase shows low overlap |
--charge-correction none | build_hybrid_system | only on request: run a charge-changing mutation without the co-alchemical ion (the ddG then carries an uncancelled finite-size error) |
--endstate-builder openmm --forcefield-xml ... | build_hybrid_system | force fields outside the Amber catalog (no prepared ligands on this path) |
--restraint-atoms backbone (--restraint-force-constant, kJ/mol/nm²) | run_fep | the folded leg loosens during the transformation (destabilising core mutations); the tripeptide leg normally runs without it — a restraint is part of one leg's Hamiltonian at every λ, so the legs may differ here |
--cycle binding | estimate_ddg | complex / apo legs instead of folded / unfolded (name the legs with analysis_subjects in --parent-node-ids order; no extract_tripeptide marker applies) |
One job (jobs/main). The folded leg runs first; the unfolded leg branches
from the folded leg's prep node. After every completed node read next: it
names the next command for this shape (including the unfolded branch and the
ddG node).
source ─ prep_001 ─ solv ─ topo(hybrid) ─ min ─ eq ─ fep ─ analyze_001 (analyze_fep) ─┐
└─ prep_002 (extract_tripeptide) ─ solv ─ topo(hybrid) ─ ... ─ analyze_002 ─┴─ analyze_003 (estimate_ddg)
Bootstrap one job and prepare the protein:
mdclaw bootstrap_md_workflow --study-dir <study> --pdb-id <id> \
--question "<ddG question>" --sampling-stage fep
(--sampling-stage fep makes the plan's workflow_steps say fep, not
prod, after eq.) Follow skills/md-prepare/SKILL.md through solv
(prepare_complex → solvate_structure).
Hybrid topology (folded).
mdclaw create_node --job-dir <job> --node-type topo --label "hybrid_A_L99A"
mdclaw explain_node --job-dir <job> --node-id <topo_id>
mdclaw --job-dir <job> --node-id <topo_id> build_hybrid_system \
--mutation A:L99A --forcefield ff19SB --water-model opc --n-windows 21
build_hybrid_system models the mutant side chain (HPacker, PDBFixer
fallback), builds WT and mutant end states with build_amber_system,
fuses them, relaxes the appearing atoms, and validates that the hybrid
reproduces both end-state energies at λ=0/1. Read
endpoint_validation.passed in the result; if false, stop and report.
The relaxation and end-point energies use the fastest OpenMM platform,
i.e. a GPU when the host has one; on a shared login node pass
--platform CPU (or --device-index N) like the run tools.
Minimise and equilibrate from the hybrid topo exactly as in
skills/md-equilibration/SKILL.md (run_minimization → run_equilibration,
NPT). The hybrid System at λ=0 is the wild type; nothing FEP-specific is
needed here.
Sample windows.
mdclaw create_node --job-dir <job> --node-type fep --label "fep_folded"
mdclaw --job-dir <job> --node-id <fep_id> run_fep \
--sampling-time-ns 1 --equilibration-time-ns 0.1 --platform CUDA
One fep node may sample all windows serially (default) or a subset with
--lambda-indices 0-6. Over ~1 ns per window, or on HPC, create one fep
node per subset under the same eq parent and submit them with
submit_array_job (skills/md-fep/windows.md): a killed node then loses
one subset, and its finished windows are recoverable from the partial
fep_windows.json. Extend converged-but-noisy windows with a child fep
node (--parent-node-ids <fep_id> ... --equilibration-time-ns 0); samples
are chained. Each window starting from the eq state is minimised at its own
λ first, so small→large mutations do not start from solvent overlapping the
appearing side chain; keep --equilibration-time-ns 0.1 (or more) for such
windows so the box re-heats before sampling.
Estimate the leg.
mdclaw create_node --job-dir <job> --node-type analyze \
--parent-node-ids <fep_id> [<fep_id2> ...] \
--conditions '{"analysis_data_scope": "alchemical"}'
mdclaw --job-dir <job> --node-id <analyze_id> analyze_fep
Parent the analyze node to every fep node needed to cover all windows.
Check min_neighbour_overlap (≥ 0.03) and warnings; act per
skills/md-fep/convergence.md. The result's next now points at the
unfolded leg (step 6), or at the ddG node once both legs are analysed.
Unfolded leg. A prep node under the protein's prep node; the
tool cuts the tripeptide from that node's merged_pdb, caps it, and keeps
the parent's protonation states, chain id and numbering:
mdclaw create_node --job-dir <job> --node-type prep --parent-node-ids <prep_001> --label "tripeptide"
mdclaw --job-dir <job> --node-id <prep_002> extract_tripeptide --mutation A:L99A
Then, each with --parent-node-ids naming this branch: solvate_structure --dist 10 --water-model <folded leg's> (a tripeptide needs no 15 Å buffer;
keep the image gap above the 10 Å cutoff), build_hybrid_system with the same --mutation,
--forcefield, --water-model, --n-windows/--lambda-schedule, then
min → eq → run_fep → analyze_fep as in steps 2–5. create_node without
--parent-node-ids refuses (parent_required) while both branches are
open: always name the parent on this leg.
ddG node. A comparison analyze node over the two legs' analyze_fep
nodes (either order; the leg whose prep ancestor is extract_tripeptide
is the unfolded one):
mdclaw create_node --job-dir <job> --node-type analyze \
--parent-node-ids <analyze_folded> <analyze_unfolded> \
--conditions '{"analysis_data_scope": "comparison"}'
mdclaw --job-dir <job> --node-id <analyze_ddg> estimate_ddg
estimate_ddg first checks that both legs share the mutation, lambda
protocol, force field, water model, HMR, temperature and pressure
(fep_legs_incompatible otherwise, node stays pending), then writes
artifacts/ddg.json and records ddG on the node. Report
ddG_kcal_mol ± ddG_error_kcal_mol, the two leg dG values, sampling per
window, any run_fep restraint per leg, and every warning carried from
the legs. md-report on the ddG node then finds both legs in its lineage
(an alchemical block per subject, MBAR / hybrid-topology / soft-core /
folding-cycle citations from the recorded metadata).
| Code | Action |
|---|---|
fep_mutation_spec_invalid, fep_mutation_residue_not_found, fep_mutation_residue_ambiguous | Fix the mutation string against the prep PDB residue numbering; add the chain id. |
fep_mutant_model_failed | Retry with --mutant-backend pdbfixer; report if that also fails. |
fep_environment_mismatch | WT/mutant end states differ outside the residue; rebuild from the same solv node with identical options. |
fep_coion_parameters_unavailable | Charge-changing mutation but the box has no ion of the needed sign; branch a new solv node with --salt --saltcon 0.15 and rebuild below it. |
fep_coion_box_too_small | No bulk water ≥ 1.5 nm from the site; branch a new solv node with a larger --dist and rebuild below it. |
fep_coion_unsupported | Net charge changes by more than 2 e or by a non-integer amount; report it, do not work around it. |
fep_dummy_misplaced | Do not sample. The mutant's side chain is on the other side of CB; rebuild with --mutant-backend pdbfixer or rotate the WT side chain onto the mutant's CB substituent, then rebuild. |
fep_endpoint_validation_failed | Do not sample. Report the energy table from the failure manifest. |
fep_hybrid_topology_required | The topo ancestor is not a hybrid; create a topo node with build_hybrid_system and re-branch min/eq. |
fep_windows_incomplete | Create fep nodes for the listed indices (same eq parent), parent the analyze node to all of them. |
fep_sampling_failed | Read artifacts/failure/latest; recover the finished windows with a new fep node under the eq parent and --restart-windows-file (skills/md-fep/windows.md). |
fep_windows_incompatible, fep_parent_ambiguous, fep_lambda_index_invalid on extension | One fep parent per child, same --pressure-bar, only the parent's windows. |
fep_fragment_prep_required | extract_tripeptide ran under a source node; create its prep node with --parent-node-ids <prep_001>. The mis-parented node cannot be re-parented: retire it with update_workflow_state --node-id <it> --abandon --reason "wrong parent" so it stops appearing as a parent candidate. |
fep_tripeptide_cap_failed | clean_protein could not cap the fragment; read the nested errors, fix the parent preparation, branch a new prep node. |
fep_ddg_scope_invalid, fep_ddg_parents_invalid | The ddG node is comparison over exactly two completed analyze_fep nodes; recreate it that way. |
fep_leg_role_ambiguous | Neither leg descends from extract_tripeptide; derive the unfolded leg with it, or declare analysis_subjects [{"label": "folded"}, {"label": "unfolded"}] in --parent-node-ids order. |
fep_legs_incompatible | The message names the differing setting; rebuild that leg's build_hybrid_system / run_fep with the other leg's options. |
hybrid_topology_production_blocked | A prod node was created under the hybrid eq; it is still pending — create a fep node there instead (or a plain topo for wild-type MD). |
restraint_selection_empty | --restraint-atoms matched nothing in the hybrid topology; use backbone / CA / heavy. |
invalid_parameter_value | The node is still pending: fix the argument and run the same node again. |
low neighbour_overlap warning | Densify lambdas there (skills/md-fep/convergence.md). |
Report ddG only from the completed estimate_ddg node. Then follow the
stopping rule in skills/common/run-loop.md; if the request asks for a
Methods section or deposit bundle, continue with skills/md-report/SKILL.md
with the ddG node as the target (its lineage holds both legs).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub matsunagalab/mdclaw --plugin mdclaw14 skills in this plugin
/bioemu-sampleGenerate monomer conformational source candidates with BioEmu, then hand them to MDClaw preparation./boltz-predictAI-driven protein structure prediction using Boltz-2 for single proteins, multimers, and protein-ligand complexes./commonDisplay existing molecular structures, MD trajectories, or the progress of a running job: route prepared full-system views, playback and interactive rotation to Molstar (MCP viewer in Codex, an Artifact page in Claude Code, or a local browser), still images to PyMOL, and troubleshoot remote Molstar display. Also supplies shared MDClaw job-loop, output, solvent, chemistry, and handoff conventions for md-* skills./hpc-runSLURM-based HPC submission for MDClaw workflow nodes. Handles cluster inspection, single-node and job-array submission, status sync to the DAG, and production restart extensions./md-abfeAbsolute binding free energy of one neutral, non-covalent ligand to a protein by double decoupling with MDClaw CLI tools and OpenMM. One job holds both legs: the complex (build_decoupled_system -> min -> eq -> add_boresch_restraint -> run_fep -> analyze_fep) and, as a prep child of its prep node, the ligand alone (extract_ligand -> ... -> analyze_fep); a comparison analyze node (estimate_binding_dg) closes the cycle. Before any state-changing command, follow the pre-command gate in this skill./md-analyzeMolecular dynamics trajectory analysis using MDClaw CLI tools. Routes concat, metric, and troubleshooting workflows through focused guidance pages.Other plugins' skills for the same job