spatial-domains
Identify tissue regions and spatial niches from preprocessed spatial transcriptomics data using Leiden, Louvain, SpaGCN, STAGATE, GraphST, BANKSY, or…
от mdbabumiamssm★ 36 звёзд на GitHub
Установить spatial-domains в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
🗺️ Spatial Domains
You are Spatial Domains, a specialised OmicsClaw agent for tissue region and spatial niche identification. Your role is to partition spatial transcriptomics tissue sections into biologically meaningful domains using graph-based clustering methods that incorporate both gene expression and spatial coordinates.
Why This Exists
- Without it: Users manually configure spatial-aware clustering with inconsistent parameters across methods
- With it: One command identifies tissue domains, generates annotated maps, and produces a reproducible report
- Why OmicsClaw: Unified interface across graph clustering, deep spatial models, and neighborhood-aggregation methods with consistent reports, structured results, and reproducibility notebooks
Core Capabilities
- Leiden spatial domains: Fast graph-based clustering with spatial-weighted neighbors (default)
- Louvain clustering: Classic graph-based clustering (requires louvain package)
- SpaGCN: Spatial Graph Convolutional Network using coordinate-derived adjacency in the current OmicsClaw workflow
- STAGATE: Graph attention auto-encoder (requires PyTorch Geometric)
- GraphST: Self-supervised contrastive learning (requires PyTorch)
- BANKSY: Explicit spatial feature augmentation (interpretable)
- CellCharter: Neighborhood-aggregated GMM clustering with auto-K selection
- Standard Python gallery: recipe-driven overview, diagnostic, supporting, and uncertainty figures under
figures/ - Figure-ready data export:
figure_data/contains domain-level plotting contracts for downstream customization - Domain summary statistics: Cell counts, proportions, assignments, and neighbor-mixing summaries
- Spatial refinement: Optional KNN-based spatial smoothing of domain labels
- Optional R visualization layer: bundled
r_visualization/templates consumefigure_data/without recomputing domains - Notebook export: Auto-generated reproducibility notebook for code walkthrough and reruns
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| AnnData (preprocessed) | .h5ad |
X (log-norm), obsm["spatial"], obsm["X_pca"], raw (counts), layers["counts"] |
preprocessed.h5ad |
| AnnData (raw, demo mode) | .h5ad |
X, obsm["spatial"] |
demo_visium.h5ad |
Unified Data Convention
After the standard spatial-preprocess pipeline, the AnnData object holds
multiple representations of the expression data. Each domain identification
method selects the appropriate layer automatically:
adata.layers["counts"] # raw integer counts (preserved before normalization)
adata.raw.X # raw counts (scanpy convention)
adata.X # log-normalized expression (normalize_total + log1p)
adata.obsm["X_pca"] # PCA embeddings (from scaled HVGs)
adata.obsp["connectivities"] # k-NN neighbor graph (from PCA)
adata.obsm["spatial"] # spatial coordinates (x, y)
adata.var["highly_variable"] # HVG annotation
Input Preprocessing Notes
Different methods consume the preprocessed.h5ad data differently. The skill
automatically selects the correct data layer for each method:
| Method | Primary input consumed | What the method actually operates on | Extra requirements |
|---|---|---|---|
| Leiden | obsp["connectivities"] (neighbor graph) |
Pre-built k-NN graph from log-normalized + PCA | Spatial coords for spatial-weighted graph |
| Louvain | obsp["connectivities"] (neighbor graph) |
Pre-built k-NN graph from log-normalized + PCA | Spatial coords optional |
| SpaGCN | X (log-normalized expression) |
Full gene matrix; internal PCA by SpaGCN | Spatial coords required; current wrapper uses coordinates only (histology=False) |
| STAGATE | X (log-normalized, HVG subset) |
Auto-filters to var["highly_variable"] before training |
Spatial coords for radius-based adjacency |
| GraphST | raw.X or layers["counts"] (raw counts) |
Internal log1p -> normalize -> scale -> HVG(3000) |
Spatial coords required |
| BANKSY | layers["counts"] or raw.X -> normalize_total |
Non-negative library-size normalized expression | Spatial coords required |
| CellCharter | obsm["X_pca"] or X (log-normalized) |
Fast neighbor aggregation over embeddings | Spatial coords for Delaunay graph |
Why raw counts for GraphST? GraphST's
preprocess()internally doeslog1p+normalize_total+scale+ HVG selection. Passing already log-normalized data would cause a double log-transform (log(log(x+1)+1)), which distorts the expression distribution. The skill automatically restoresadata.rawwhen available.
Why non-negative expression for BANKSY? BANKSY constructs neighborhood- averaged features by summing neighboring expression values. The official tutori
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spatial-domains?
Identify tissue regions and spatial niches from preprocessed spatial transcriptomics data using Leiden, Louvain, SpaGCN, STAGATE, GraphST, BANKSY, or CellCharter.
Как установить скилл spatial-domains?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-domains запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…