pemsley/coot/inline-graphs
Claude Code and agent skill by pemsley/coot
- community
Checking that the SKILL.md file is still in the repository.
Create interactive inline Chart.js graphs directly in the chat from live Coot data. Use this skill whenever the user asks to plot, graph, chart, or visualise any per-residue data from Coot — B-factors, density correlations, Ramachandran probabilities, rotamer scores, or any other per-residue metric. Also use when the user asks to overlay secondary structure on a graph, or to compare metrics across chains. Prefer this approach over any file-based graphing (e.g. Pygal) — it is faster, interactive, and renders inline in the conversation.
Install
npx vskill@latest install pemsley/coot/inline-graphsSKILL.md
Coot Inline Graphs
Inline graphs render Chart.js directly in the chat via the visualize:show_widget tool. Coot supplies the data via Python; the widget renders it with no file I/O, no external viewer, and full interactivity.
Core workflow
- Get data from Coot — fetch per-residue metrics using the Python API
- Get secondary structure — call
add_header_secondary_structure_info()then
get_header_secondary_structure_info() if overlays are wanted
- Render the widget — embed data as JS literals in the Chart.js HTML
Always call visualize:read_me (modules: ["interactive", "chart"]) before the first visualize:show_widget call in a session.
Step 1 — Fetch per-residue data from Coot
B-factors
Density correlation
Ramachandran probabilities
Step 2 — Fetch secondary structure
Always try get_header_secondary_structure_info() first. If it returns {} or False, call add_header_secondary_structure_info() to compute it from geometry, then call get_header_secondary_structure_info() again.
Important: add_header_secondary_structure_info() will crash Coot if called on a molecule that already has secondary structure records populated and then get_header_secondary_structure_info() is called — only call it when the initial query returns empty. (Bug reported; fix applied to c-interface-build.cc:2876.)
Step 3 — Render the widget
Chart.js setup
Load via CDN. Always use the UMD build:
For secondary structure annotation overlays, also load:
Data embedding
Embed Coot data as a JS literal directly in the widget HTML. Do not use fetch() or external URLs — the data comes from Coot at render time and is baked in.
Canvas sizing
Always wrap <canvas> in a <div> with explicit height:
Set responsive: true, maintainAspectRatio: false in Chart.js options. Never set height directly on the <canvas> element.
Secondary structure overlay
Box annotations sit at the top of the chart as a strip. The box height is computed dynamically so the α/β glyph sits vertically centred:
Build a resnoToIndex lookup first (maps residue number → bar index):
Annotation spec
Threshold colouring
Colour bars relative to a threshold to highlight problem residues:
Provide a range slider to let the user adjust threshold interactively. When switching between metrics, update the slider range accordingly:
- Correlation: min=0, max=1, step=0.01, default=0.7
- B-factor: min=0, max=
bMax, step=1, default=20 - Ramachandran: min=0, max=1, step=0.01, default=0.02
Click-to-navigate
Wire bar clicks to sendPrompt() so the user can jump to a residue in Coot:
Axis labels and ticks
Stat cards
Show summary metrics above the chart using the metric card pattern:
Use a 4-column grid: residue count, mean metric, count above/below threshold, max or min value as appropriate.
Legend
Always provide a manual legend below the chart — do not use Chart.js default:
Tooltips
Include both the primary metric and secondary metric in tooltips:
Number formatting
All numbers reaching the screen must be rounded:
- B-factors:
.toFixed(1)+' Ų' - Correlations:
.toFixed(3) - Ramachandran probabilities:
.toFixed(4) - Axis tick integers:
Math.round()
Why not Pygal?
Pygal requires file I/O, a separate viewer, and a display context. It produces black images in headless environments and is slow. Chart.js in the browser has none of these problems and adds interactivity for free. Do not use Pygal.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmcp/docs/skills/inline-graphs/SKILL.md
Popularity
- Repository stars
- 160
- Repository forks
- 60
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/pemsley/coot/inline-graphs)