Skip to content

Ling-MD/md-agent-skills / pymol-interface-hbond-figures

pymol-interface-hbond-figures

Verified

Use when creating reusable PyMOL figures for protein-protein or chain-chain interfaces from PDB/MD snapshot files, especially when the user wants only protein kept, water/ions/ligands removed, inter-chain hydrogen-bonding residues shown as sticks, green dashed hydrogen bonds, chain-colored cartoons and labels, MM/PBSA-style blue/orange chain coloring, or a reproducible PML plus rendered PNG for other systems.

FileKindSize
SKILL.mdskill md3.9 KB
agents/openai.yamlconfig328 B
references/interface-hbond-style.mdmarkdown2.4 KB
scripts/render_interface_hbonds.pyscript14.2 KB
---
name: pymol-interface-hbond-figures
description: Use when creating reusable PyMOL figures for protein-protein or chain-chain interfaces from PDB/MD snapshot files, especially when the user wants only protein kept, water/ions/ligands removed, inter-chain hydrogen-bonding residues shown as sticks, green dashed hydrogen bonds, chain-colored cartoons and labels, MM/PBSA-style blue/orange chain coloring, or a reproducible PML plus rendered PNG for other systems.
---

# PyMOL Interface H-Bond Figures

Create publication-style interface hydrogen-bond figures from local PDB snapshots. This skill captures the workflow used for the Fang_Guobing MD snapshots: protein only, chain-colored transparent cartoon, only hydrogen-bonding interface residues as sticks, green dashed H-bonds, readable residue labels, and reproducible output files.

## Quick Start

Use PyMOL's bundled Python interpreter on this machine:

```powershell
& 'C:\Users\dell\Downloads\PyMOL-3.1.6.1_appveyor2641-Win64-portable-py310\PyMOL\python.exe' `
  'C:\Users\dell\.codex\skills\pymol-interface-hbond-figures\scripts\render_interface_hbonds.py' `
  --pdb 'E:\path\to\snapshot_100ns.pdb' `
  --chain-a A `
  --chain-b B
```

The script writes, by default, next to the input PDB:

- `<prefix>_interface_hbonds.png`
- `<prefix>_interface_hbonds.pml`
- `<prefix>_interface_hbond_pairs.tsv`
- `<prefix>_interface_hbond_residues.tsv`

## Workflow

1. Confirm the interface chains. Default is `A` and `B`; override with `--chain-a` and `--chain-b` for other systems.
2. Run `scripts/render_interface_hbonds.py` with the PDB path and optional output prefix.
3. Inspect the PNG. If labels are crowded, regenerate with a larger image size, smaller labels, or use the generated PML as the refinement starting point.
4. Report the PNG/PML/TSV output paths and summarize detected hydrogen-bonding residues.

## Style Defaults

Use these defaults unless the user asks otherwise:

- Remove everything except `polymer.protein`.
- Cartoon all protein chains with transparency `0.35`.
- Chain A color: blue `#0B7DB3`, matching the prior MM/PBSA bar plot style.
- Chain B color: orange-yellow `#E69F00`, matching the prior MM/PBSA bar plot style.
- Hydrogen bonds: green `#00C71F`, dashed.
- Show only hydrogen-bond-forming residues as sticks.
- Carbon atoms in sticks match their chain cartoon color; hetero atoms keep atomic colors.
- Labels show residue name and number, for example `ARG142`; label color matches the chain.
- No explanatory caption or small text in the upper-left corner.

## Useful Options

```powershell
--out-dir 'E:\path\to\figures'
--prefix site1_site2_100ns
--chain-a C --chain-b D
--chain-a-color '#0B7DB3'
--chain-b-color '#E69F00'
--hbond-color '#00C71F'
--cutoff 3.6
--width 3000 --height 2400
--label-size 24
--cartoon-transparency 0.45
--no-ray
```

Use a larger `--width/--height` and smaller `--label-size` when many residues form H-bonds. Use `--cutoff` cautiously; the default `3.6 Å` is intended for donor/acceptor heavy-atom contacts in MD snapshots where hydrogens may be absent.
Use `--no-ray` for a fast preview, then remove it for the final publication-style render.

## Refinement Rules

If the first render is not figure-ready:

- Rotate or zoom in the generated PML first; keep the residue/hbond selections unchanged unless the user asks for a different scientific definition.
- Keep labels close to residues. It is acceptable for labels to cover cartoon, but avoid covering sticks and avoid label-label overlap.
- If a user identifies a specific bad label position, edit the generated PML or rerun with a larger canvas before changing the H-bond detection.
- If PyMOL finds too few H-bonds, inspect `<prefix>_interface_hbond_pairs.tsv`; then consider a slightly larger `--cutoff` only if chemically reasonable.

## Reference

Read `references/interface-hbond-style.md` for the exact visual contract, troubleshooting notes, and the command pattern used in the earlier successful figures.
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall