hinna0818/ukbanalytica_v2/ukbsci-plot
Claude Code and agent skill by hinna0818/ukbanalytica_v2
- community
Checking that the SKILL.md file is still in the repository.
Publication-grade figure production for UK Biobank Research Analysis Platform (RAP) analyses built with UKBAnalytica. Wraps the package's built-in plotters — plot_forest (subgroup / regression forest), plot_calibration (clinical-model calibration), plot_regression_volcano (multi-exposure / multi-protein volcano), plot_heatmap, plot_stacked_bar, plot_violin, and plot_scatter for lightweight exploratory/manuscript panels, plus the family of survival, ML, SHAP, mediation, propensity, imputation, correlation, and enrichment plots from sibling skills — and adds a shared neutral theme (ukbsci_clinical / ukbsci_diverging / ukbsci_sequential palettes), a dual-format save helper, and a figure-contract checklist. Use this skill when the user asks for any manuscript figure derived from UKBAnalytica outputs: forest plots, volcano plots, KM curves, calibration plots, Love plots, SHAP summaries, multi-panel composites, or PDF / SVG high-resolution export. Triggers: UKB plotting, forest plot, volcano, calibration, manuscript figure, ggplot helper, ukbsci 画图, 论文级图, /ukbsci-plot. Hard rule: local agents must not read or inspect real UKB RAP participant-level data; generate scripts for RAP execution and interpret aggregate outputs only.
Install
npx vskill@latest install hinna0818/ukbanalytica_v2/ukbsci-plotSKILL.md
ukbsci-plot — Manuscript figure production for UKBAnalytica
0. RAP guardrails
Core rule: do not export UK Biobank participant-level raw data, direct identifiers (eid, exact dates, raw RAP fields), or row-level source tables that can be linked back to participants.
Strict local-agent boundary: this skill is for script generation, workflow planning, package guidance, and interpretation of aggregate outputs. The agent must not read, inspect, summarize, or process real UK Biobank RAP participant-level data, including de-identified row-level tables, raw RAP fields, exact dates, per-row predictions, row-level SHAP matrices, screenshots, tracebacks, or logs containing row-level values. Generate scripts for the user to run inside RAP; only aggregate results or rendered figures may be shared back with the agent. See ../references/agent-privacy-boundary.md.
| Output | Sharing rule | |
|---|---|---|
| Rendered PDF / SVG / PNG figure | Shareable if it does not expose identifiers, exact dates, raw RAP fields, row labels, or data previews. | |
05-figs/data/Fig*.csv source CSV | Shareable only if aggregate (per-bin, per-strata, per-feature means/CIs). Never share a source CSV that contains raw per-participant values or identifiers. | |
Coefficient / metric table from 04-results/*.csv | Shareable — aggregate only. | |
| Per-participant raw values used to build a figure | Do not export. Keep intermediate data on RAP. | |
| Individual-level interpretation figure (e.g. SHAP force plot) | Do not use a real participant row with the local agent. Generate synthetic or representative prototype-row figures inside RAP if needed. |
1. When to load
- Build the manuscript-ready forest plot of the main Cox / subgroup result.
- Produce calibration / DCA / ROC for a clinical model (paired with
ukbsci-ml).
- Volcano of a protein / metabolite / batch regression screen.
- Polished multi-panel figures combining outputs from multiple skills.
- Standardized save (
.pdf + .png + .svg) at 300 dpi.
2. When NOT to load
- The user wants a KM curve only →
ukbsci-survival::plot_km_curve(this
skill defers to it).
- The user wants Love / PS distribution →
ukbsci-propensityplots. - The user wants mediation / MI / SHAP plots → use the originating skill's
plotter; this skill provides the shared theme and save helper.
3. Figure contract (always run first)
For any figure the user asks for, restate three things before plotting:
- Claim — the one-sentence conclusion the figure must support.
- Evidence panel(s) — which underlying CSV(s) from
04-results/feed
the figure.
- Export contract — final size (mm), single-column / double-column,
font family, palette family.
A figure that cannot be re-rendered from 05-figs/data/Fig*.csv is not acceptable.
4. Shared theme & palettes (define once, reuse everywhere)
UKBAnalytica does not ship custom themes. This skill defines the following neutral helpers — copy verbatim into each plotting script:
These names are intentionally generic — they do not reference any specific journal brand.
5. Standardized save helper
Manuscript single-column ≈ width_mm = 89; double-column ≈ 180. Use a height that yields golden-ratio-ish aspect unless the figure dictates otherwise.
6. UKBAnalytica plot families (where each one lives)
| Plot | Provided by | Notes | |
|---|---|---|---|
| Forest (subgroup / batch reg) | UKBAnalytica::plot_forest | This skill — see §7 | |
| Calibration | UKBAnalytica::plot_calibration | This skill — see §8 | |
| Volcano | UKBAnalytica::plot_regression_volcano | This skill — see §9 | |
| Heatmap | UKBAnalytica::plot_heatmap | Long-format matrix-style data | |
| Stacked bar | UKBAnalytica::plot_stacked_bar | Categorical composition | |
| Violin | UKBAnalytica::plot_violin | Grouped continuous distributions | |
| Scatter | UKBAnalytica::plot_scatter | Exposure-response or feature-feature trends | |
| KM survival | plot_km_curve | ukbsci-survival | |
| Love / PS distribution | plot_balance, plot_ps_distribution | ukbsci-propensity | |
| Mediation effects | plot_mediation, plot_mediation_forest | ukbsci-mediation | |
| MI diagnostics | plot_mi_pooled, plot_mi_diagnostics | ukbsci-imputation | |
| GO bar / lollipop | plot_go_ora_bar, plot_enrichment_lollipop | ukbsci-proteomics | |
| Correlation heatmap | plot_correlation | this skill (re-export-friendly) | |
| ML evaluation | plot_ml_roc, plot_ml_calibration, plot_ml_dca, … | ukbsci-ml | |
| SHAP | plot_shap_summary, plot_shap_beeswarm, plot_shap_dependence, plot_shap_force | ukbsci-ml |
When mixing plots from sibling skills, apply the same theme via theme_set(ukbsci_theme()) at the top of the orchestrating script and override colors using the ukbsci_* palettes.
7. Forest plot — plot_forest()
Input: any data.frame with at least estimate, lower95, upper95, label. Naturally consumes outputs of runmulti_cox / run_subgroup_analysis / run_multi_subgroup / runmulti_competing / pool_mi_models$pooled / tidy().
8. Calibration — plot_calibration()
Input: per-prediction rows with predicted probabilities and binary outcome. Note: this is participant-level so the data argument should come from flow$final_test_predictions (which stays on RAP); the figure itself summarises into n_bins bins, so the rendered output is aggregate.
9. Volcano — plot_regression_volcano()
Auto-detects effect_col (HR → OR → estimate) and label_col (gene_symbol → protein_clean → variable). The output's attr(., "plot_data") and attr(., "label_data") give the aggregate underlying tables — write those to 05-figs/data/.
10. Lightweight plot helpers
Use these for compact exploratory or supplementary panels when the user has an aggregate or de-identified plotting table.
Inputs must use column names as strings. Do not pass eid, exact dates, or row-level raw RAP fields into local-agent-visible source CSVs.
11. Multi-panel composition
patchwork is the recommended layout engine:
plot_annotation(tag_levels = "a") gives lowercase a, b, c, … panel labels — common across observational epidemiology.
12. Common pitfalls
This is the start of the file. Read the full SKILL.md on GitHub.
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 repositoryCheckinginst/skills/UKBAnalytica_skills/ukbsci-plot/SKILL.md
Popularity
- Repository stars
- 35
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 2 Sep 2026, 2 months ago.
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/hinna0818/ukbanalytica_v2/ukbsci-plot)