drug-complex-system-builder
Build a solvated, charge-neutralized protein-ligand complex for OpenMM molecular dynamics simulation.
Skill by learningmatter-mit
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/learningmatter-mit-drug-complex-system-builder
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/drug-complex-system-builder
What's inside
- Skill name
drug-complex-system-builder- Description
- Build a solvated, charge-neutralized protein-ligand complex for OpenMM molecular dynamics simulation. Combines a prepared receptor PDB and ligand SDF, parameterizes the ligand with OpenFF Sage or GAFF (AM1-BCC charges), applies Amber ff14SB to the protein, solvates with explicit water, and adds counterions. Use this skill when the user wants to solvate a complex, set up a system for MD, prepare for simulation, add water and ions, or build a simulation box from a protein-ligand structure.
- License
- MIT
- Instructions
- 100 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (6)
- SKILL.md
- 1HSG_prepared.pdb · examples/hiv1-protease/
- README.md · examples/hiv1-protease/
- ligand.sdf · examples/hiv1-protease/
- build_provenance.json · examples/hiv1-protease/system/
- build_complex.py · scripts/
SKILL.md (first lines)
# drug-complex-system-builder
## Goal
To take a prepared protein (PDB) and a validated ligand pose (SDF) and produce a fully parameterized, solvated, ion-neutralized OpenMM simulation bundle ready for [drug-protein-ligand-md](../drug-protein-ligand-md/SKILL.md).
The output bundle includes:
- Serialized OpenMM System XML (force field parameters, constraints)
- Full-precision initial state XML (positions + box vectors for exact restart)
- Solvated PDB with protein + ligand + water + ions (for visualization)
- Provenance JSON recording all build parameters
## Instructions
### 1. Prepare inputs
Required inputs:
- **Receptor PDB**: from [drug-protein-prep](../drug-protein-prep/SKILL.md) (protonated, missing residues resolved).
- **Ligand SDF**: from [drug-pose-validation](../drug-pose-validation/SKILL.md) or [drug-docking-vina](../drug-docking-vina/SKILL.md). Must have 3D coordinates in the receptor frame and explicit hydrogens.
### 2. Build the solvated complex
```bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu+openmm python ${CLAUDE_SKILL_DIR}/scripts/build_complex.py \
--receptor docking/inputs/protein_prepared.pdb \
--ligand docking/validation/valid_poses.sdf \
--ligand_ff openff-2.2.0 \
--protein_ff amber/ff14SB \
--water_model tip3p \
--box_padding 12.0 \
--ionic_strength 0.15 \
--output_dir md/system/
```
Key parameters:
- `--ligand_ff`: Force field for the ligand. Options: `openff-2.2.0` (Sage, recommended), `gaff-2.11`. OpenFF Sage is generally preferred for drug-like molecules.
- `--protein_ff`: Protein force field. Default: `amber/ff14SB`.
- `--water_model`: Water model. Default: `tip3p`. Options: `tip3p`, `tip3pfb`, `tip4pew`, `opc`, `spce`. Use `tip3pfb` or `opc` for better accuracy at higher cost.
- `--box_padding`: Minimum distance from solute to box edge in Angstroms (default: 12.0). Use 10-12 A for production; smaller values risk periodic image artifacts.
- `--ionic_strength`: Target NaCl concentration in mol/L (default: 0.15, physiological). The system is always charge-neutralized first; additional ion pairs are added to reach the target ionic strength. The ionic strength calculation does not count the neutralization ions (they are treated as bound to the solute).
- `--pose_index`: Which pose from the SDF to use (default: 0, the top-ranked pose).
- `--box_shape`: Simulation box geometry (default: `cube`). Options: `cube`, `dodecahedron`, `octahedron`. Dodecahedron and octahedron use ~30% less water for the same minimum solute-edge distance.
- `--hydrogen_mass`: Hydrogen mass in amu for hydrogen mass repartitioning (default: 4.0). With HMR (3-4 amu), the script uses `AllBonds` constraints, enabling 4-5 fs timesteps (OpenMM recommends 5 fs with `LangevinMiddleIntegrator`). Set to 1.008 to disable HMR (uses `HBonds` constraints, requires 2 fs timestep). Note: at 4 amu, methyl carbons become lighter than their bonded hydrogens, which can affect dynamics in some systems (particularly membranes). Use 3 amu if this is a concern. The downstream MD skill **must** use a matching timestep (check `hmr_enabled` and `constraints` in the provenance JSON).
### 3. Inspect outputs
The script produces:
- `md/system/complex_solvated.pdb`: solvated system for visualization (PDB precision: 0.001 A)
- `md/system/system.xml`: serialized OpenMM System (force field parameters, constraints)
- `md/system/state_initial.xml`: full-precision positions and box vectors for simulation restart
- `md/system/build_provenance.json`: records all build parameters, atom counts, box dimensions, HMR status, constraint type
Visually inspect `complex_solvated.pdb` to verify:
- The ligand is in the expected binding pocket
- No steric clashes between protein and ligand
- Water fills the box uniformly
- Ions are distributed (not clustered)
### 4. Troubleshooting
Common issues:
- **Ligand parameterization fails**: ensure the ligand SDF has explicit hydrogens and correct bond orders. Re-run [drug-ligand-prep](../drug-ligand-prep/SKILL.md) if needed. The script assigns partial charges itself (`--charge_method`, default `am1bcc`); any pre-existing charges in the SDF are overwritten to ensure deterministic behavior.
- **AM1-BCC charges or GAFF**: both need AmberTools (`sqm`, `antechamber`) on `PATH`, and AmberTools has no PyPI distribution, so it is not in any uv environment: install it separately (conda-forge `ambertools`, or a source build). Without it, use OpenFF Sage (`--ligand_ff openff-2.2.0`, the default) with `--charge_method mmff94` or `gasteiger` (RDKit charges): cruder than AM1-BCC, fine for screening and smoke tests, not for production free energies.
- **Steric clash warning**: the script checks minimum protein-ligand interatomic distances before solvation. If you see a clash warning, the docking pose may need refinement. Mild clashes (1.0-1.5 A) can often be resolved by energy minimization, but severe clashes (<1.0 A) usually indicate a bad pose.
- **Missing residues in protein**: the builder does not fix gaps. Use [drug-protein-prep](../drug-protein-prep/SKILL.md) first.
- **Box too small**: increase `--box_padding` if you see solute atoms near box edges.
- **Simulation blowup after building**: check the provenance JSON for `hmr_enabled`. If HMR is on (default), the downstream MD should use a 4-5 fs timestep (OpenMM recommends 5 fs with `LangevinMiddleIntegrator`). If HMR is off, use 2 fs. Mismatched timestep/HMR settings are a common cause of NaN energies at startup.
## Examples
### Example: build TYK2 inhibitor complex
```bash
${CLAUDE_SKILL_DIR}/../../venv/run cpu+openmm python ${CLAUDE_SKILL_DIR}/scripts/build_complex.py \
--receptor tyk2/inputs/4GIH_prepared.pdb \
--ligand tyk2/validation/valid_poses.sdf \
--ligand_ff openff-2.2.0 \
--box_padding 12.0 \
--ionic_strength 0.15 \
--output_dir tyk2/md/system/
```
## Constraints
- **Environment**: Requires `cpu+openmm`.
- **Ligand size**: OpenFF Sage handles typical drug-like molecules well. For very large ligands (>100 heavy atoms) or metal-containing compounds, parameterization may require manual intervention.
- **Protein force field**: Only Amber-family force fields (ff14SB, ff19SB) are supported through openmmforcefields. CHARMM support would require a different builder.
- **Box shape**: Defaults to cubic. Dodecahedron and truncated octahedron are supported via `--box_shape` (requires OpenMM 8.0+).
## References
- Maier, J. A.; Martinez, C.; Kasavajhala, K.; Wickstrom, L.; Hauser, K. E.; Simmerling, C. ff14SB: Improving the Accuracy of Protein Side Chain and Backbone Parameters from ff99SB. *J. Chem. Theory Comput.* **2015**, *11*, 3696-3713. https://doi.org/10.1021/acs.jctc.5b00255
- Boothroyd, S.; Behara, P. K.; Madin, O. C.; et al. Development and Benchmarking of Open Force Field 2.0.0: The Sage Small Molecule Force Field. *J. Chem. Theory Comput.* **2023**, *19*, 3251-3275. https://doi.org/10.1021/acs.jctc.3c00039
- Eastman, P.; Swails, J.; Chodera, J. D.; et al. OpenMM 7: Rapid Development of High Performance Algorithms for Molecular Dynamics. *PLoS Comput. Biol.* **2017**, *13*, e1005659. https://doi.org/10.1371/journal.pcbi.1005659
---
**Author:** Matthew Cox
**Contact:** [GitHub @mcox3406](https://github.com/mcox3406)From learningmatter-mit/AtomisticSkills, MIT.
More from learningmatter-mit/AtomisticSkills
- 0.681score
drug-binding-site-definition
learningmatter-mit
Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-mmpbsa-gbsa
learningmatter-mit
Compute single-trajectory MM-GBSA and / or MM-PBSA binding free energy estimates from a protein-ligand MD trajectory.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-pocket-detection
learningmatter-mit
Identify and rank ligandable pockets on a protein structure or model using geometry (fpocket) or an ML predictor (P2Rank).
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-db-qmof
learningmatter-mit
Query the Quantum MOF (QMOF) database via Materials Project's MPContribs platform for DFT-computed properties (bandgap) and optimized crystal structures of…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-sorption-relax
learningmatter-mit
Prepares supercells for porous frameworks based on minimum interplanar distance and relaxes them using standard MLIP relaxation tools.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-protein-ligand-md
learningmatter-mit
Run a protein-ligand MD simulation in OpenMM with energy minimization, restrained equilibration, and production NPT, producing trajectory and checkpoint files…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-bond-dissociation
learningmatter-mit
Calculate homolytic and heterolytic bond dissociation energies (BDEs) for all single bonds in a molecule using MLIPs with RDKit fragmentation.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-hazard-toxicity
learningmatter-mit
Extract explicit safety warnings, GHS classifications, LD50 toxicity profiles, and acute oral toxicity triage from PubChem PUG VIEW.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-redocking-rmsd
learningmatter-mit
Compute symmetry-corrected heavy-atom RMSD between docked poses and a reference crystal ligand to validate docking protocols.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-dft-orca-optimization
learningmatter-mit
Run DFT geometry optimization (minimization or TS search) on a molecular structure using ORCA via SCINE/ReaDuct wrapper.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-pose-validation
learningmatter-mit
Validate docked or generated ligand poses for physical plausibility using PoseBusters, filtering out chemically invalid or clashing poses before downstream…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-db-mof
learningmatter-mit
Query multiple MOF databases (QMOF via MPContribs; ARC-MOF DB7/Majumdar et al.
SkillAFreshness: A★ 183Claude Code +9
Signals
- Stars
- 183
- Forks
- 31
- Open issues
- 0
- Last commit (this folder)
- Oct 6, 2026 (22 days ago)
- Last release
- Oct 6, 2026 (21 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Website
- arxiv.org/abs/2605.24002
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from learningmatter-mit
- 0.681score
drug-binding-site-definition
learningmatter-mit
Define a docking search box (center coordinates + box dimensions in Angstroms) from a co-crystal ligand, binding-site residues, or a saved JSON specification.
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-pocket-detection
learningmatter-mit
Identify and rank ligandable pockets on a protein structure or model using geometry (fpocket) or an ML predictor (P2Rank).
SkillAFreshness: A★ 183Claude Code +9 - 0.681score
drug-mmpbsa-gbsa
learningmatter-mit
Compute single-trajectory MM-GBSA and / or MM-PBSA binding free energy estimates from a protein-ligand MD trajectory.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-sorption-relax
learningmatter-mit
Prepares supercells for porous frameworks based on minimum interplanar distance and relaxes them using standard MLIP relaxation tools.
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
drug-pose-validation
learningmatter-mit
Validate docked or generated ligand poses for physical plausibility using PoseBusters, filtering out chemically invalid or clashing poses before downstream…
SkillAFreshness: A★ 183Claude Code +9 - 0.678score
chem-hazard-toxicity
learningmatter-mit
Extract explicit safety warnings, GHS classifications, LD50 toxicity profiles, and acute oral toxicity triage from PubChem PUG VIEW.
SkillAFreshness: A★ 183Claude Code +9
Cite this page
drug-complex-system-builder skill. Agent Mart. https://agentmart.dev/skills/learningmatter-mit-drug-complex-system-builder (last updated 2026-10-24)