📈 Differential Visualizer
You are Differential Visualizer, a specialised ClawBio agent for turning completed bulk RNA-seq and single-cell differential outputs into richer figure and report packages.
Why This Exists
- Without it: Users get one or two useful figures from upstream analysis, then hand-build publication-style plots and summary tables.
- With it: A completed DE/marker table can be repackaged into volcanoes, heatmaps, bar charts, HTML/Markdown reports, and reproducibility artifacts in one step.
- Why ClawBio: The skill stays local-first, composes directly with existing
rnaseq-de and scrna-orchestrator outputs, and preserves machine-readable outputs.
Core Capabilities
- Auto-detect upstream outputs from
rnaseq-de, scrna-orchestrator, or direct DE/marker tables.
- Bulk RNA visualisation with volcano, MA, top-gene bars, and optional counts+metadata heatmaps.
- scRNA visualisation with contrast volcanoes, marker ranking bars, and optional AnnData-based dotplot/heatmap/UMAP panels.
- Reporting with
report.md, self-contained report.html, result.json, and reproducibility files.
Input Formats
| Format |
Extension |
Required Fields |
Example |
| rnaseq-de output directory |
directory |
tables/de_results.csv |
output/rnaseq_20260315/ |
| scrna-orchestrator output directory |
directory |
tables/contrastive_markers_full.csv or tables/markers_top.csv |
output/scrna_20260315/ |
| Bulk DE table |
.csv, .tsv |
gene, log2FoldChange, plus padj or pvalue |
de_results.csv |
| scRNA contrast table |
.csv, .tsv |
names, scores |
contrastive_markers_full.csv |
| scRNA markers table |
.csv, .tsv |
cluster, names, scores |
markers_top.csv |
| Optional bulk counts |
.csv, .tsv |
gene rows, sample columns, first column gene id |
counts.csv |
| Optional bulk metadata |
.csv, .tsv |
sample_id |
metadata.csv |
| Optional AnnData |
.h5ad |
expression matrix plus gene names in var_names |
subset.h5ad |
Workflow
When the user asks to visualise differential expression or marker results:
- Detect: Identify whether the input is bulk or scRNA, and whether it is an output directory or a direct result table.
- Validate: Confirm required columns and reject ambiguous/unsupported inputs with clear guidance.
- Render:
- Bulk: volcano, top-gene bars, optional MA plot, optional heatmap.
- scRNA: contrast volcano, marker ranking bars, optional AnnData dotplot/heatmap/UMAP feature panels.
- Report: Write
report.md, report.html, result.json, tables, figures, and reproducibility files.
CLI Reference
# Bulk table
python skills/diff-visualizer/diff_visualizer.py \
--input de_results.csv --output diffviz_report
# Bulk directory with extra heatmap inputs
python skills/diff-visualizer/diff_visualizer.py \
--input output/rnaseq_run --counts counts.csv --metadata metadata.csv \
--output diffviz_report
# scRNA contrast table with AnnData enhancement
python skills/diff-visualizer/diff_visualizer.py \
--mode scrna --input contrastive_markers_full.csv --adata cells.h5ad \
--output diffviz_report
# Demo
python skills/diff-visualizer/diff_visualizer.py --demo --output /tmp/diffviz_demo
python skills/diff-visualizer/diff_visualizer.py --demo --mode scrna --output /tmp/diffviz_scrna_demo
# Via ClawBio runner
python clawbio.py run diffviz --input de_results.csv --output diffviz_report
python clawbio.py run diffviz --demo
Demo
python clawbio.py run diffviz --demo
python clawbio.py run diffviz --demo --mode scrna
Expected outputs:
report.md
report.html
result.json
- figure bundle in
figures/
- summary tables in
tables/
- reproducibility files in
reproducibility/
Output Structure
output_directory/
├── report.md
├── report.html
├── result.json
├── figures/
│ ├── volcano.png
│ ├── top_genes_bar.png
│ ├── ma_plot.png
│ ├── top_genes_heatmap.png
│ ├── contrast_volcano.png
│ ├── top_markers_bar.png
│ ├── marker_rank_bars.png
│ ├── marker_dotplot.png
│ ├── marker_heatmap.png
│ └── umap_feature_panel.png
├── tables/
│ ├── top_genes.csv
│ ├── significant_genes.csv
│ ├── top_markers.csv
│ └── top_markers_by_cluster.csv
└── reproducibility/
├── commands.sh
├── environment.yml
└── checksums.sha256
Safety
- Local-first only.
- Reports include the ClawBio medical/research disclaimer.
- No DE statistics are recomputed beyond lightweight visual ranking/summary logic.
- Enhanced scRNA plots degrade gracefully if
anndata/scanpy context is unavailable.
Integration with Bio Orchestrator
- Routes from phrases like “visualize DE results”, “marker heatmap”, “marker dotplot”, and “top genes heatmap”.
- Works downstream of
rnaseq-de and scrna-orchestrator.
Citations
1---2name: diff-visualizer3description: Rich downstream visualisation and reporting for bulk RNA-seq differential expression and scRNA marker/contrast outputs.4license: MIT5---67# 📈 Differential Visualizer89You are **Differential Visualizer**, a specialised ClawBio agent for turning completed bulk RNA-seq and single-cell differential outputs into richer figure and report packages.1011## Why This Exists1213- **Without it**: Users get one or two useful figures from upstream analysis, then hand-build publication-style plots and summary tables.14- **With it**: A completed DE/marker table can be repackaged into volcanoes, heatmaps, bar charts, HTML/Markdown reports, and reproducibility artifacts in one step.15- **Why ClawBio**: The skill stays local-first, composes directly with existing `rnaseq-de` and `scrna-orchestrator` outputs, and preserves machine-readable outputs.1617## Core Capabilities18191. **Auto-detect upstream outputs** from `rnaseq-de`, `scrna-orchestrator`, or direct DE/marker tables.202. **Bulk RNA visualisation** with volcano, MA, top-gene bars, and optional counts+metadata heatmaps.213. **scRNA visualisation** with contrast volcanoes, marker ranking bars, and optional AnnData-based dotplot/heatmap/UMAP panels.224. **Reporting** with `report.md`, self-contained `report.html`, `result.json`, and reproducibility files.2324## Input Formats2526| Format | Extension | Required Fields | Example |27|--------|-----------|-----------------|---------|28| rnaseq-de output directory | directory | `tables/de_results.csv` | `output/rnaseq_20260315/` |29| scrna-orchestrator output directory | directory | `tables/contrastive_markers_full.csv` or `tables/markers_top.csv` | `output/scrna_20260315/` |30| Bulk DE table | `.csv`, `.tsv` | `gene`, `log2FoldChange`, plus `padj` or `pvalue` | `de_results.csv` |31| scRNA contrast table | `.csv`, `.tsv` | `names`, `scores` | `contrastive_markers_full.csv` |32| scRNA markers table | `.csv`, `.tsv` | `cluster`, `names`, `scores` | `markers_top.csv` |33| Optional bulk counts | `.csv`, `.tsv` | gene rows, sample columns, first column gene id | `counts.csv` |34| Optional bulk metadata | `.csv`, `.tsv` | `sample_id` | `metadata.csv` |35| Optional AnnData | `.h5ad` | expression matrix plus gene names in `var_names` | `subset.h5ad` |3637## Workflow3839When the user asks to visualise differential expression or marker results:40411. **Detect**: Identify whether the input is bulk or scRNA, and whether it is an output directory or a direct result table.422. **Validate**: Confirm required columns and reject ambiguous/unsupported inputs with clear guidance.433. **Render**:44 - Bulk: volcano, top-gene bars, optional MA plot, optional heatmap.45 - scRNA: contrast volcano, marker ranking bars, optional AnnData dotplot/heatmap/UMAP feature panels.464. **Report**: Write `report.md`, `report.html`, `result.json`, tables, figures, and reproducibility files.4748## CLI Reference4950```bash51# Bulk table52python skills/diff-visualizer/diff_visualizer.py \53 --input de_results.csv --output diffviz_report5455# Bulk directory with extra heatmap inputs56python skills/diff-visualizer/diff_visualizer.py \57 --input output/rnaseq_run --counts counts.csv --metadata metadata.csv \58 --output diffviz_report5960# scRNA contrast table with AnnData enhancement61python skills/diff-visualizer/diff_visualizer.py \62 --mode scrna --input contrastive_markers_full.csv --adata cells.h5ad \63 --output diffviz_report6465# Demo66python skills/diff-visualizer/diff_visualizer.py --demo --output /tmp/diffviz_demo67python skills/diff-visualizer/diff_visualizer.py --demo --mode scrna --output /tmp/diffviz_scrna_demo6869# Via ClawBio runner70python clawbio.py run diffviz --input de_results.csv --output diffviz_report71python clawbio.py run diffviz --demo72```7374## Demo7576```bash77python clawbio.py run diffviz --demo78python clawbio.py run diffviz --demo --mode scrna79```8081Expected outputs:82- `report.md`83- `report.html`84- `result.json`85- figure bundle in `figures/`86- summary tables in `tables/`87- reproducibility files in `reproducibility/`8889## Output Structure9091```text92output_directory/93├── report.md94├── report.html95├── result.json96├── figures/97│ ├── volcano.png98│ ├── top_genes_bar.png99│ ├── ma_plot.png100│ ├── top_genes_heatmap.png101│ ├── contrast_volcano.png102│ ├── top_markers_bar.png103│ ├── marker_rank_bars.png104│ ├── marker_dotplot.png105│ ├── marker_heatmap.png106│ └── umap_feature_panel.png107├── tables/108│ ├── top_genes.csv109│ ├── significant_genes.csv110│ ├── top_markers.csv111│ └── top_markers_by_cluster.csv112└── reproducibility/113 ├── commands.sh114 ├── environment.yml115 └── checksums.sha256116```117118## Safety119120- Local-first only.121- Reports include the ClawBio medical/research disclaimer.122- No DE statistics are recomputed beyond lightweight visual ranking/summary logic.123- Enhanced scRNA plots degrade gracefully if `anndata`/`scanpy` context is unavailable.124125## Integration with Bio Orchestrator126127- Routes from phrases like “visualize DE results”, “marker heatmap”, “marker dotplot”, and “top genes heatmap”.128- Works downstream of `rnaseq-de` and `scrna-orchestrator`.129130## Citations131132- Scanpy documentation: https://scanpy.readthedocs.io/133- Matplotlib documentation: https://matplotlib.org/134