spatial-enrichment

spatial-enrichment is a skill for Claude Code, Codex from ShangBioLab/SpatialClaw. It costs 18 tokens per session (2,075 once invoked), scanned A, original, Apache-2.0.

A tool for finding biological pathways and gene sets that are over-represented in spatial transcriptomics results. A pathway is a group of genes involved in a shared biological process.

In plain words
What is it for?
Use it for per-cluster over-representation analysis or optional GSEA, using built-in Hallmark, cell-cycle, and immune gene sets, with pathway scores and dot plots.
Why use it?
It helps turn long lists of marker genes into interpretable biological functions and applies corrections intended to reduce false discoveries.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is --input ./data/clustered.h5ad \.

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/ShangBioLab/SpatialClaw
agentmods
npx agentmods add skills/shangbiolab/spatialclaw/spatial-enrichment

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spatial-enrichment

README.md
[![agentmods](https://agentmods.dev/badge/skills/shangbiolab/spatialclaw/spatial-enrichment.svg)](https://agentmods.dev/skills/shangbiolab/spatialclaw/spatial-enrichment)
Your own site
<a href="https://agentmods.dev/skills/shangbiolab/spatialclaw/spatial-enrichment"><img src="https://agentmods.dev/badge/skills/shangbiolab/spatialclaw/spatial-enrichment.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,075 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.02075
Opus 5 $0.00009 $0.01038
Sonnet 5 $0.00004 $0.00415
Haiku 4.5 $0.00002 $0.00208

Measured 6d ago against content hash d6b6e70ac952, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

spatial-enrichment scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (spatial_enrichment.py, tests/test_spatial_enrichment.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/spatial/spatial-enrichment/SKILL.md · 201 lines

How it starts

The opening of the file, as written. The whole thing — 201 lines — stays where its author put it; the contents beside it link to each section on GitHub.

🧬 Spatial Enrichment

You are Spatial Enrichment, a specialised SPATIALCLAW agent for pathway and gene set enrichment analysis. Your role is to identify over-represented biological pathways in spatially resolved gene expression data.

Why This Exists

  • Without it: Users must extract marker genes, format gene lists, and run external enrichment tools manually
  • With it: Automated per-cluster enrichment analysis with built-in gene sets and optional GSEA
  • Why SPATIALCLAW: Integrates directly with spatial DE results and produces publication-ready enrichment figures

Workflow

  1. Calculate: Map marker genes against biological networks and knowledge bases.
  2. Execute: Run over-representation analysis (ORA) or GSEA dynamically.
  3. Assess: Perform multiple hypothesis testing corrections.
  4. Generate: Output structured pathway scores and dot plots.
  5. Report: Tabulate top significantly enriched functions.

Core Capabilities

  1. Over-representation analysis (ORA): Hypergeometric test on marker genes per cluster
  2. Built-in gene sets: Curated Hallmark, cell cycle, and immune signature sets — no downloads needed
  3. Optional gseapy: When available, run full GSEA/Enrichr against MSigDB, GO, KEGG, Reactome
  4. Per-cluster enrichment: Run enrichment on each cluster's marker genes
  5. Ranking metric selection: Choose from scores, logfoldchanges, or test statistic for GSEA
  6. Leading edge extraction: Identify core genes driving enrichment in top pathways
  7. Multiple databases: GO BP/MF/CC, KEGG, Reactome, MSigDB Hallmark/Oncogenic/Immunologic

GSEA Ranking Metrics

When running GSEA, the ranking metric determines how genes are ordered. Preference order:

Metric Column When to use
Test statistic stat Best: accounts for both effect size and significance
Wilcoxon scores scores Good default: from scanpy's rank_genes_groups
Log fold change logfoldchanges Avoid if possible: ignores significance

Read the full file on GitHub · 201 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 201 lines · 18 tokens per session scan A d6b6e70ac952

Subscribe to this mod's changes

spatial-enrichment is a skill published in the GitHub repository ShangBioLab/SpatialClaw (11 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 18 tokens to every session and 2,075 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

bulkrna-enrichment

Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list. Skip when the input is single-cell (use sc-enrichment); the input is spatial (use spatial-enrichment); metabolite pathways (use metabolomics-pathway-enrichment).

TianGzlab/OmicsClaw · 59 tokens

spatial-enrichment

Load when running pathway / gene-set enrichment per cluster on a preprocessed spatial AnnData via Enrichr (over-representation), GSEA (preranked), or ssGSEA (per-cell scores). Skip when ranking spatially variable genes (use spatial-genes); comparing pathways across conditions (use spatial-condition).

TianGzlab/OmicsClaw · 69 tokens

sc-enrichment

Load when running bulk-style pathway enrichment (ORA / GSEA / GSEA-R / GSVA-R) on a per-group ranked DE / marker list against a gene-set library. Skip when computing per-cell pathway scores in-place (use sc-pathway-scoring); de-novo gene-program discovery (use sc-gene-programs).

TianGzlab/OmicsClaw · 71 tokens

metabolomics-pathway-enrichment

Load when running over-representation analysis (ORA) on a metabolite list via Fisher's exact test against a built-in 9-pathway DEMO dictionary, BH-FDR adjusted. Skip when needing real KEGG / Reactome (this skill is demo-only); mummichog / fella topology methods (CLI accepts them but only ORA runs).

TianGzlab/OmicsClaw · 84 tokens

proteomics-enrichment

Load when running over-representation analysis (ORA) on a list of proteins via Fisher's exact test against a built-in 8-pathway DEMO dictionary, with BH-FDR correction. Skip when needing a real pathway database (this skill is demo-only) (use bulkrna-enrichment); rank-based GSEA.

TianGzlab/OmicsClaw · 70 tokens

kegg-query

Query KEGG database for drug information, pathway analysis, and disease-drug-target discovery. Use this skill when: (1) Looking up drug information including efficacy, targets, metabolism, and interactions, (2) Analyzing metabolic or signaling pathways to retrieve genes, compounds, and modules, (3) Discovering…

PharMolix/OpenBioMed · 82 tokens