No slash command · from lab-skills
Generate single-cell gene expression report scripts (.qmd) with barplots, heatmaps, and cross-analysis. Use when creating expression reports for gene sets across cell types, visualizing gene expression patterns in single-cell data, or when the user says "expression report", "gene expression barplots", "expression heatmap", or wants to visualize how a gene list is expressed across cell types. Covers both categorical gene groupings (pathway components, functional categories) and data-driven groupings (taxonomy, coexpression modules). Currently Python/scanpy/matplotlib only. Do NOT load for differential expression testing, marker gene discovery, or clustering — those are upstream analyses that produce gene lists this skill consumes.
Ships in lab-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Generate reproducible .qmd scripts for single-cell gene expression reports. The skill
discusses setup with the user, then writes a complete Python/scanpy/matplotlib .qmd
template encoding all decisions as configuration variables.
Reference implementations:
exploration/scripts/scmicrobiome/spongilla/02_nonmetazoan_expression.qmdTiHKAL/scripts/signaling_pathway_reports/generate_pathway_reports.qmdBundled resources:
templates/report_template.py — script body chunks (config, normalization, gene matching,
expression computation, combined heatmap, report loop, cross-analysis, archive)templates/helpers.py — reusable plotting functions (two-panel heatmap, barplot Style A)references/species_notes.md — species-specific cell type configurations and quirks.qmd script following quarto-docs and
script-organization conventionsquarto render, producing all outputs in
outs/<subdirectory>/XX_script_name/Resolve these questions before generating the script. Present recommendations where possible; don't just list options.
| Input | What to ask | Notes |
|---|---|---|
| Single-cell object | File path (.h5ad) | Check it exists; report shape |
| Gene list | File path (TSV with gene_id + grouping columns) | Read and show column names, row count |
| Primary group column | Which column defines the main grouping | e.g., "kingdom", "pathway", "module" |
Validation steps:
n_obs x n_vars, check if counts are raw (max > 20) or
log-normalized (max < 20)Default: use the full gene name from the single-cell object's var_names. Do not parse or abbreviate — show what's in the object. This ensures labels match the authoritative gene naming in the dataset.
h5ad_name column (populated during gene ID matching) contains the full
var_name from the object. Use this directly as the plot label.#2, #3 for duplicate display names if needed.Check references/species_notes.md for known species-specific quirks before proposing
defaults. If the species has an entry, pre-populate family assignments, ordering, and
colors from it.
Default: named cell types only. Numbered/transitional clusters are excluded unless the user specifically requests them.
Read cell type info directly from the h5ad .obs:
.obs for likely cell type columns (look for "cell_type",
"cluster", "annotation", "celltype" in column names). Show the user what you find.Ordering is family-grouped, user-confirmed. The skill proposes an order, the user adjusts if needed. The final order must be explicitly confirmed by the user. Store it as a list in the configuration chunk so it can be edited later.
All barplots use linear scale (mean CPT). Present the two styles:
Style A: Cell type family coloring (recommended for exploratory / large gene sets)
Style B: Gene category coloring (recommended for curated functional categories)
facet_wrap style with 4 columnsRecommendation logic: If the gene list has a functional category column with <=8 categories, recommend Style B. Otherwise recommend Style A.
Ask if other datasets should be intersected with the gene list to add markers (e.g.,
* for phosphoproteomics hits). This is optional and project-specific.
Once all decisions are resolved, generate a .qmd script.
Follow the script-organization skill:
scripts/<subdirectory>/XX_name.qmd (next available number — always ls first)outs/<subdirectory>/XX_name/Generate a Python .qmd with these sections in order. Read templates/report_template.py
and templates/helpers.py for the code patterns to insert into each chunk:
templates/helpers.py)NATURE_PALETTE = [
"#BC3C29", # Brick red
"#0072B5", # Steel blue
"#20854E", # Forest green
"#E18727", # Amber
"#7876B1", # Muted purple
"#6F99AD", # Slate blue
"#EE4C97", # Rose
"#868686", # Gray
]
White -> steel blue -> navy (#FFFFFF -> #3182BD -> #08306B)
Diverging RdBu_r with TwoSlopeNorm centered at 0.
These were learned through iterative development. Do not repeat them.
expm1() without checking — if X.max() > 20, it's raw countsouts/<subdirectory>/XX_name/
all_genes_heatmap.pdf/.png # Combined heatmap if <=100 genes
expression_summary.pdf/.png # Genes per group, fraction expressed
group_celltype_heatmap.pdf/.png # Group x cell type (linear + z-score)
gene_summary.tsv # All genes with expression info
BUILD_INFO.txt # Provenance
_archive/ # Previous runs
group_slug_1/ # Per-group subdirectory
gene_list.tsv
heatmap.pdf/.png
barplots.pdf/.png
group_slug_2/
...
When <=100 expressed genes, the combined heatmap uses:
Not yet implemented. When added, the R template will use:
DotPlot for dotplotspheatmap with category row annotations for heatmapsggplot2 + facet_wrap for Style B barplotsWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
34 skills in this plugin
/audit-projectPeriodic project health check - cross-check docs, prune conventions, find drift. Use when project documentation feels stale, before milestones, or when CLAUDE.md is getting long. Do NOT load for auditing skills (use /audit-skills) or data analysis scripts (use /audit-script).
/audit-scriptSystematic audit of data analysis scripts for bugs, analytical reasoning, data handling, style, and reproducibility. Includes domain verification phase that researches tools, file formats, and methods to catch domain-specific errors (not just code bugs). Use when auditing a script, reviewing code for correctness, checking for bugs, preparing a script for publication, or when the user says "audit this script", "review this code", "check this for bugs", or "is this script correct". Three modes: thorough (collaborative section-by-section), fast (Claude-driven with discussion), and report-only. Do NOT load for quick one-off questions about a single line or function.
/audit-skillsAudit Claude Code skills for bloat, trigger accuracy, structural quality, redundancy, and pruning opportunities. Use when skills feel bloated, before publishing to lab repo, after building several new skills, when reviewing a single newly-created skill before publishing, or when the user says "audit my skills", "review skills", "check skill quality", "audit this skill", or invokes /audit-skills. Covers both user-level (~/.claude/skills/) and project-level (.claude/skills/) skills, and supports both full-library scans and single-skill reviews. Do NOT load for auditing data analysis scripts (use /audit-script) or project documentation (use /audit-project).
/cleanup-scriptsSession-scoped script cleanup for data science projects. Checks scripts/scratch/ for working files that need consolidation into .qmd scripts, flags numbered non-.qmd files in scripts/, and verifies script-output directory correspondence. Use when finishing a coding session, when scripts/scratch/ has accumulated files, or when the user says "clean up scripts", "consolidate scratch", or "check script conventions". Lightweight and fast — reads files, no expensive computation.
/conda-envConda environment activation for Python commands. Use when running Python scripts, pip, or conda-dependent tools./data-handlingData handling best practices for R and Python data science analysis scripts. Use when writing data manipulation code, analysis pipelines, or .qmd scripts that process scientific/analytical data (e.g., filtering, joining, normalizing datasets). Do NOT load for general Python scripting, infrastructure code, or configuration management.
npx claudepluginhub musserlab/lab-claude-skills --plugin lab-skills