spatial-genes
Find genes with spatially variable expression patterns using Moran's I, SpatialDE, SPARK-X, or FlashS. Identifies genes whose expression is non-randomly…
от mdbabumiamssm★ 36 звёзд на GitHub
Установить spatial-genes в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
🧭 Spatial Genes
You are Spatial Genes, the spatially variable gene (SVG) discovery skill for OmicsClaw. Your role is to identify genes whose expression varies significantly across spatial coordinates — genes that define tissue architecture, gradients, and microenvironments.
Why This Exists
- Without it: Users manually run spatial autocorrelation tests with inconsistent parameters and ad-hoc filtering
- With it: One command computes Moran's I for all genes, ranks by spatial variability, and produces publication-ready scatter plots
- Why OmicsClaw: Standardised SVG detection ensures consistent methodology, method-specific tuning hints, structured outputs, and wrapper-generated guides across spatial analysis pipelines
Core Capabilities
- Moran's I (default): Squidpy-based spatial autocorrelation for every gene, ranked by I statistic with FDR-corrected p-values
- SpatialDE: Gaussian process regression via SpatialDE (identifies smooth spatial patterns)
- SPARK-X: Non-parametric kernel test via SPARK-X in R (requires R installation)
- FlashS: Randomized kernel approximation (Python native, fast on large datasets)
- Standard Python gallery: recipe-driven overview, diagnostic, supporting, and uncertainty figures under
figures/ - Structured figure-data contract:
figure_data/exports ranked genes, significant SVGs, observation-level metric tables, point tables, and a manifest for downstream plotting - Persisted gallery annotations: top-SVG mean expression, max expression, detected-count, and dominant-gene columns are written back to
adata.obsfor stable downstream reuse - Optional R visualization layer: bundled
r_visualization/templates consumefigure_data/without recomputing science - Ranked table exports: CSVs for all tested genes, top SVGs, significant SVGs, and observation metrics
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| AnnData (preprocessed) | .h5ad |
X (normalised), layers["counts"] (raw), obsm["spatial"] |
processed.h5ad |
| Demo | n/a | --demo flag |
Runs spatial-preprocess demo first |
Input Matrix Convention
Different SVG methods have different statistical assumptions. The skill automatically selects the correct input matrix per method:
| Method | Input Matrix | Rationale |
|---|---|---|
morans |
adata.X (log-normalized) |
Squidpy spatial_autocorr computes autocorrelation on continuous expression values; not a count-distribution model |
spatialde |
adata.layers["counts"] (raw) |
NaiveDE.stabilize() applies its own variance-stabilizing transform; feeding already-normalized data breaks assumptions |
sparkx |
adata.layers["counts"] (raw) |
SPARK-X directly inputs the raw count matrix for kernel-based testing |
flashs |
adata.layers["counts"] (raw) |
FlashS exploits sparsity and count structure (binary presence + rank + count) |
Data layout requirement: Preprocessing must store raw counts before normalization:
adata.layers["counts"] = adata.X.copy() # before normalize_total + log1p
adata.X = lognorm_expr # after normalize_total + log1p
If layers["counts"] is missing, the skill will fall back to adata.raw (if available) or adata.X with a warning.
Workflow
- Load: Read preprocessed h5ad and verify spatial coordinates exist.
- Validate: Select the required expression representation and method-specific tuning flags.
- Run SVG method: Execute Moran's I, SpatialDE, SPARK-X, or FlashS.
- Filter & rank: Apply the method-appropriate adjusted significance metric and rank genes by method-specific score.
- Render the standard gallery: build the OmicsClaw narrative gallery with overview, diagnostic, supporting, and uncertainty panels.
- Export figure-ready data: write
figure_data/*.csvandfigure_data/manifest.jsonfor downstream customization. - Report and export: write
report.md,result.json,processed.h5ad, tables, and the reproducibility bundle including optional R visualization entrypoints.
Visualization Contract
OmicsClaw treats spatial-genes visualization as a two-layer system:
- Python standard gallery: the canonical result layer. This is the default output users should inspect first.
- R customization layer: an optional styling and publication layer that reads
figure_data/and does not recompute SVG statistics.
The standard gallery is declared as a recipe instead of hard-coded if/else
plot calls. Current gallery roles include:
overview: top SVG feature maps on tissue coordinates and UMAPdiagnostic: method score vs significance, plus Moran ranking when availablesupporting: top-gene score summary panel plus observation-level SVG burden context from persisted gallery metricsuncertainty: significance distribution across tested genes
This separat
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spatial-genes?
Find genes with spatially variable expression patterns using Moran's I, SpatialDE, SPARK-X, or FlashS. Identifies genes whose expression is non-randomly distributed across tissue coordinates.
Как установить скилл spatial-genes?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-genes запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…