drug-complex-system-builder
Skill174 starsChanged 6 months agoMITView on GitHub
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.
In this repository133 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/atomisticskills.mdcCursor rule
- .cursor/rules/use-agent-skills.mdcCursor rule
- chem-bond-dissociationSkill
- chem-conformer-searchSkill
- chem-db-mofSkill
- chem-db-qmofSkill
- chem-db-spectraSkill
- chem-dft-orca-advanced-calculationSkill
- chem-dft-orca-optimizationSkill
- chem-dft-orca-singlepointSkill
- chem-docking-voidSkill
- chem-hazard-toxicitySkill
- chem-irc-verificationSkill
- chem-msms-predictSkill
- chem-neb-barrierSkill
- chem-nmr-analysisSkill
- chem-nmr-predictSkill
- chem-react-otSkill
- chem-similarity-searchSkill
- chem-solution-mdSkill
- chem-sorption-gcmcSkill
- chem-sorption-relaxSkill
- chem-sorption-widomSkill
- chem-spectrum-matcherSkill
- chem-thermochemistrySkill
- chem-ts-optimizationSkill
- chem-vibrationSkill
- drug-admet-predictionSkill
- drug-binding-site-definitionSkill
- drug-bioactivity-assaySkill
- drug-db-chemblSkill
- drug-db-pdbSkill
- drug-db-pubchemSkill
- drug-docking-analysisSkill
- drug-docking-vinaSkill
- drug-ligand-prepSkill
- drug-mmpbsa-gbsaSkill
- drug-molecular-fingerprintsSkill
- drug-pocket-detectionSkill
- drug-pose-validationSkill
- drug-protein-ligand-mdSkill
- drug-protein-prepSkill
- drug-redocking-rmsdSkill
- drug-retrosynthesisSkill
- drug-trajectory-analysisSkill
- general-arxiv-searchSkill
- general-biorxiv-searchSkill
- general-chemical-literatureSkill
- general-chemical-pricingSkill
- general-deep-researchSkill
- general-fair-data-reviewSkill
- general-patent-searchSkill
- general-peer-reviewSkill
- general-plot-digitizerSkill
- general-presentationSkill
- general-property-unitsSkill
- general-publisher-access-guardSkill
- general-query-literature-databaseSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
No steric clashes between protein and ligand
- Distinctive: line 74
Ligand parameterization fails: ensure the ligand SDF has explicit hydrogens and correct bond orders.
- Distinctive: line 99
Protein force field: Only Amber-family force fields (ff14SB, ff19SB) are supported through openmmforcefields.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
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 (protonated, missing residues resolved).
- Ligand SDF: from drug-pose-validation or drug-docking-vina. Must have 3D coordinates in the receptor frame and explicit hydrogens.
2. Build the solvated complex
# Env: drugmd-agent
python .agents/skills/drug-complex-system-builder/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. Usetip3pfboropcfor 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 usesAllBondsconstraints, enabling 4-5 fs timesteps (OpenMM recommends 5 fs withLangevinMiddleIntegrator). Set to 1.008 to disable HMR (usesHBondsconstraints, 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 (checkhmr_enabledandconstraintsin 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 restartmd/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 if needed. The script assigns AM1-BCC partial charges automatically; any pre-existing charges in the SDF are overwritten to ensure deterministic behavior.
- 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 first.
- Box too small: increase
--box_paddingif 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 withLangevinMiddleIntegrator). 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
# Env: drugmd-agent
python .agents/skills/drug-complex-system-builder/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
drugmd-agent. - 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

