omics-plotting
omics-plotting: publication-style figure authoring for omics / bioinformatics results with matplotlib / seaborn. Read this before writing any plotting or figure code in any omics analysis — RNA-seq, proteomics, single-cell, variant, or database results — not only when a plot is explicitly requested: whenever an analysis will produce a figure, load this first and follow its recipes. Covers volcano, MA, expression / correlation heatmap, GSEA bar / dot plot, box / violin / bar / ridgeline, PCA / UMAP / t-SNE scatter, Kaplan–Meier, Manhattan / QQ / forest. Supplies a shared journal-ready style and copy-paste recipes so every figure looks like one consistent system. To combine several plots into ONE multi-panel composite figure, use the sibling `multipanel` skill.
jaechang-hits · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add jaechang-hits/SciAgent-Skills --skill omics-plotting技能说明
name: omics-plotting
description: >
omics-plotting: publication-style figure authoring for omics / bioinformatics
results with matplotlib / seaborn. Read this before writing any plotting or
figure code in any omics analysis — RNA-seq, proteomics, single-cell, variant,
or database results — not only when a plot is explicitly requested: whenever an
analysis will produce a figure, load this first and follow its recipes. Covers
volcano, MA, expression / correlation heatmap, GSEA bar / dot plot,
box / violin / bar / ridgeline, PCA / UMAP / t-SNE scatter, Kaplan–Meier,
Manhattan / QQ / forest. Supplies a shared journal-ready style and copy-paste
recipes so every figure looks like one consistent system. To combine several
plots into ONE multi-panel composite figure, use the sibling multipanel skill.
license: Proprietary (HITS Inc.)
omics-plotting
Overview
When the user wants a figure, generate it with matplotlib / seaborn, applying the shared style block below. The user can hand-tune colors, fonts, or spines per plot, but unless they ask for something specific, paste the style block and reuse the palette so a whole analysis reads as one figure system at a glance.
This skill is self-contained: everything you need (style, palette, recipes) is in this document.
When to use
- The user asks for a plot / figure / chart / visualization from a results table or an in-memory DataFrame (DEG table, enrichment result, expression matrix, long-form measurements, survival table…).
- You are preparing figures for a report, a paper submission or presentation and want a consistent publication style.
Combining several plots into one multi-panel composite, or assembling user-supplied PNG/PDF panels, is handled by the sibling
multipanelskill — use this skill to draw each individual panel.
Do NOT use for
- Interactive dashboards or web charts (this is static matplotlib output).
- 3D molecular structure rendering (that is the structure viewer, not a plot).
Key Concepts
One consistent figure system
The core idea is that every figure from a single analysis should look like it
came from the same publication. That is enforced by two shared objects: the
PUB_STYLE rcParams block (fonts, spines, DPI, editable vector text) and a fixed
PALETTE / directional color set (UP, DOWN, NS). Paste both at the top of
every plot script and map the same group or direction to the same color
across panels, so a reader can carry meaning from one figure to the next.
Diverging vs sequential colormaps
Color encoding is not free choice. Use the diverging colormap
(DIVERGING_CMAP = "RdBu_r", always center=0, vmin=-vmax) for signed
quantities where zero is meaningful — z-scores, log2 fold changes, correlations.
Use the sequential colormap (SEQUENTIAL_CMAP = "viridis") for unsigned
magnitudes — densities, -log10 p, counts. Mixing these (a sequential map on
signed data) hides the sign and misleads the reader.
Data shape drives figure type
Each recipe expects a specific table shape: a per-gene DEG table (volcano, MA), a genes × samples matrix (heatmap), a samples × features matrix (PCA/UMAP), or long-form tidy rows (box/violin/bar, ridgeline, Kaplan–Meier). Identifying the shape first — then reading the header to confirm the real column names — is what selects the recipe. The column names in each recipe are defaults to override, not fixed requirements.
Decision Framework
Pick the figure type from what the data represents and what question it answers:
What does the table hold?
├─ Per-gene stats (log2FC, padj)
│ ├─ emphasize significance ......... Volcano
│ └─ emphasize expression level ..... MA plot
├─ genes × samples matrix
│ ├─ show patterns/clusters ......... Clustered expression heatmap (z-score)
│ └─ show sample-sample QC .......... Correlation heatmap
├─ Enrichment / gene-set result
│ ├─ signed effect (NES) ............ GSEA bar
│ └─ ratio + size + significance .... GSEA dot plot
├─ Long-form measurements (x, y)
│ ├─ compare distributions .......... Box / Violin
│ ├─ compare means .................. Bar (with error bars)
│ └─ many groups, shape matters ..... Ridgeline
├─ samples × features (high-dim) ...... PCA / UMAP / t-SNE
└─ time-to-event + group ............. Kaplan–Meier
| Data you have | Question | Figure | Colormap / palette |
|---|---|---|---|
| DEG table | Which genes change, how significantly? | Volcano | UP/DOWN/NS |
| DEG table | Effect vs abundance | MA plot | UP/DOWN/NS |
| Expression matrix | Cluster structure | Clustered heatmap | diverging, center 0 |
| Expression matrix | Sample QC | Correlation heatmap | diverging, [-1, 1] |
| Enrichment result | Top pathways, direction | GSEA bar | UP/DOWN |
| Enrichment result | Ratio + significance + size | GSEA dot plot | sequential |
| Long-form | Group distributions | Box / Violin | categorical PALETTE |
| High-dim matrix | Global sample layout | PCA / UMAP / t-SNE | categorical PALETTE |
| Survival table | Group survival over time | Kaplan–Meier | categorical PALETTE |
Workflow
- Identify the data source — a workspace-relative CSV/TSV path or a DataFrame already in memory — and the figure type (pick from the table below). If the required columns are unclear, inspect the table's header first.
- Write one python script: paste the style block, load the data,
draw the plot with the matching recipe, and save to a workspace-relative
path under
figures/. - Report the saved path back to the user (and reference it in any report /
deck by that relative path, e.g.
).
Shared style — paste at the top of every plot script
import matplotlib.pyplot as plt
# Publication style (colorblind-friendly, editable vector text, no top/right spines)
PUB_STYLE = {
"figure.dpi": 110, "savefig.dpi": 300, "savefig.bbox": "tight",
"font.famil
阅读完整来源 ↗