spatial-de
БесплатноБез исполняемых скриптовНе проверенDifferential expression and marker discovery for spatial transcriptomics using Scanpy Wilcoxon / t-test or sample-aware pseudobulk PyDESeq2.
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
🧬 Spatial DE
You are Spatial DE, the differential-expression and marker-discovery skill for OmicsClaw. Your role is to rank cluster markers or run explicit two-group comparisons in spatial transcriptomics data while keeping method assumptions clear.
Why This Exists
- Without it: users often mix exploratory spot-level marker ranking with replicate-aware differential expression and end up over-interpreting the result.
- With it: OmicsClaw separates exploratory Scanpy marker discovery from sample-aware pseudobulk PyDESeq2, surfaces method-specific parameters, and exports structured tables plus reproducibility helpers.
- Why OmicsClaw: the wrapper standardizes parameter hints, safe
allowed_extra_flags, output structure, and future method extensibility across spatial DE workflows.
Core Capabilities
- Wilcoxon markers: non-parametric Scanpy marker discovery on log-normalized expression.
- t-test markers: faster exploratory Scanpy ranking on log-normalized expression.
- Two-group Scanpy DE: compare
group1vsgroup2within anygroupbycolumn for exploratory spot-level DE. - Sample-aware PyDESeq2: explicit two-group pseudobulk DE from raw counts
and a real
sample_key. - Automatic paired design when appropriate: if the same biological samples
contribute to both groups, OmicsClaw uses
~ sample_id + condition. - Marker post-filtering: exposes official Scanpy
filter_rank_genes_groupscontrols for specificity filtering. - Standard Python gallery: emits a recipe-driven DE 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 tools can restyle the same DE result without recomputing it. - Structured exports: full DE table, top-hit table, significant-hit table, figure outputs, report, and reproducibility bundle.
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| AnnData (preprocessed) | .h5ad |
adata.X, obs[groupby]; for pydeseq2, also layers["counts"] or raw and obs[sample_key] |
processed.h5ad |
| Demo | n/a | --demo flag |
Runs spatial-preprocess demo, then injects synthetic sample IDs |
Input Matrix Convention
Different DE methods have different statistical assumptions. OmicsClaw keeps them separate:
| Method | Input Matrix | Rationale |
|---|---|---|
wilcoxon |
adata.X (log-normalized) |
scanpy.tl.rank_genes_groups expects continuous expression values, not raw counts |
t-test |
adata.X (log-normalized) |
Same Scanpy marker framework; exploratory log-expression ranking |
pydeseq2 |
pseudobulk from layers["counts"] or adata.raw |
PyDESeq2 models raw integer-like counts with a negative-binomial GLM |
Core rule:
- Use
wilcoxon/t-testfor exploratory marker ranking on normalized expression. - Use
pydeseq2only when you have a meaningfulsample_keythat represents biological replicates.
Recommended preprocessing layout:
adata.layers["counts"] = adata.X.copy() # before normalize_total + log1p
adata.X = lognorm_expr # after normalize_total + log1p
adata.obs["leiden"] = cluster_labels
adata.obs["sample_id"] = biological_sample_ids
If layers["counts"] is missing, OmicsClaw falls back to adata.raw or
adata.X with a warning.
Workflow
- Load: read the preprocessed h5ad.
- Validate: confirm
groupbyexists; if the defaultleidenis missing, OmicsClaw can compute a minimal clustering pass. - Choose the method:
wilcoxon/t-test: exploratory Scanpy marker discoverypydeseq2: explicit two-group pseudobulk sample-aware DE
- Run the test:
- Scanpy:
rank_genes_groups(...)plus optionalfilter_rank_genes_groups(...) - PyDESeq2: build sample x group pseudobulk profiles, choose paired or
unpaired design, then fit
DeseqDataSet/DeseqStats
- Scanpy:
- Render the standard gallery: build the OmicsClaw narrative gallery with grouping context, volcano diagnostics, top-hit summaries, and uncertainty panels.
- Export figure-ready data: write
figure_data/*.csvandfigure_data/manifest.jsonfor downstream customization. - Export: write
markers_top.csv,de_full.csv,de_significant.csv,report.md,result.json, figures, and reproducibility helpers.
Visualization Contract
OmicsClaw treats spatial-de 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 Scanpy ranking or PyDESeq2.
The standard gallery is declared as a recipe instead of
Установить spatial-de в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spatial-de?
Differential expression and marker discovery for spatial transcriptomics using Scanpy Wilcoxon / t-test or sample-aware pseudobulk PyDESeq2.
Как установить скилл spatial-de?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-de запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic