spatial-deconv
Cell type deconvolution for spatial transcriptomics using FlashDeconv, Cell2location, RCTD, DestVI, Stereoscope, Tangram, SPOTlight, or CARD, with…
от mdbabumiamssm★ 36 звёзд на GitHub
Установить spatial-deconv в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
🧩 Spatial Deconv
You are Spatial Deconv, the OmicsClaw skill for estimating per-spot cell type composition from a spatial transcriptomics dataset plus a single-cell reference. The wrapper keeps output structure standardized, but the parameter surface is now method-specific instead of pretending that all deconvolution methods have the same scientific knobs.
Why This Exists
- Without it: users have to remember eight different APIs, matrix assumptions, R/Python runtime differences, and incompatible output formats.
- With it: one command runs a method-correct deconvolution workflow and exports consistent proportion tables, figures, and reproducibility metadata.
- Why OmicsClaw: the wrapper exposes real method-specific controls, preserves a stable output contract, and adds guardrail documents for parameter explanation before execution.
Core Capabilities
- FlashDeconv: ultra-fast sketching-based deconvolution with public sketch and spatial-regularization controls.
- Cell2location: Bayesian spatial mapping with
N_cells_per_locationanddetection_alpha. - RCTD: R / spacexr count-based decomposition with public
doublet_mode. - DestVI: scvi-tools VAE-based deconvolution with exposed CondSCVI architecture controls.
- Stereoscope: scvi-tools two-stage probabilistic deconvolution with separate RNA and spatial training budgets.
- Tangram: non-negative expression mapping with public
mode,num_epochs, andlearning_rate. - SPOTlight: R-based NMF deconvolution with public
weight_id,n_top,model,min_prop, andscale. - CARD: spatial-correlation-aware R method with optional imputation and refined proportion export.
- Standard Python gallery: emits a recipe-driven deconvolution gallery with
overview, diagnostic, supporting, and uncertainty panels backed by the
shared
skills/spatial/_lib/vizlayer. - Figure-ready exports: writes
figure_data/CSVs plus a gallery manifest so downstream Python or R plotting code can restyle the same run without recomputing deconvolution. - Structured exports: report, result JSON, processed h5ad, tables, gallery figures, figure data, and reproducibility helpers.
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| Spatial AnnData | .h5ad |
X, obsm["spatial"] |
processed.h5ad |
| Reference AnnData | .h5ad |
X, obs["cell_type"] or other label column |
reference_sc.h5ad |
Input Matrix Convention
Different deconvolution methods assume different matrix representations:
| Method | Main Expression Input | Notes |
|---|---|---|
cell2location |
raw counts (layers["counts"], raw, or counts in X) |
Count model; current wrapper restores counts when possible |
rctd |
raw counts | Requires spatial coordinates and enough reference cells per type |
destvi |
raw counts | Count-based scvi model on shared genes |
stereoscope |
raw counts | Count-based scvi model on shared genes |
card |
raw counts | Requires spatial coordinates; optional imputation step |
tangram |
normalized, non-negative expression in adata.X |
Do not pass scaled / z-scored matrices with negative values |
spotlight |
normalized, non-negative expression | Current wrapper builds marker weights and forwards SPOTlight args |
flashdeconv |
flexible in current wrapper | Keep gene identifiers aligned and spatial coordinates present |
Important:
- Count-based methods should not be described as valid on scaled or centered matrices.
- Tangram and SPOTlight should not be run on matrices containing negative values.
- All methods require enough shared genes between spatial and reference datasets.
Workflow
- Load: read the spatial h5ad plus the single-cell reference.
- Validate: check cell type labels, shared genes, matrix assumptions, and method-specific CLI parameters.
- Run the selected backend.
- Standardize outputs: store the method-specific proportion matrix and
metadata into
processed.h5ad. - Derive summaries: export dominant-cell-type, diversity, assignment-margin, and mean-proportion tables.
- Render the standard gallery: build the OmicsClaw narrative gallery with spatial proportion overviews, diversity diagnostics, supporting composition summaries, 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, gallery figures, and reproducibility helpers.
Visualization Contract
OmicsClaw treats spatial-deconv visualization as a two-layer system:
- Python standard gallery: the canonical result layer users should inspect first.
- R customization layer: an optional styling and publication layer that
reads
figure_data/a
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spatial-deconv?
Cell type deconvolution for spatial transcriptomics using FlashDeconv, Cell2location, RCTD, DestVI, Stereoscope, Tangram, SPOTlight, or CARD, with method-specific parameter hints and standardized proportion outputs.
Как установить скилл spatial-deconv?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-deconv запускает скрипты?
Нет, скилл состоит только из инструкций (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…