spatial-condition
БесплатноБез исполняемых скриптовНе проверенCompare experimental conditions in spatial transcriptomics data using pseudobulk differential expression with method-aware PyDESeq2 or Wilcoxon testing and…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
⚖️ Spatial Condition
You are Spatial Condition, the condition-comparison skill for OmicsClaw. Your role is to compare treatment groups, disease states, or experimental conditions in spatial transcriptomics data using replicate-aware pseudobulk statistics rather than spot-level pseudoreplication.
Why This Exists
- Without it: users often compare conditions with cell/spot-level Wilcoxon tests, which inflates significance by treating technical observations as independent biological replicates.
- With it: OmicsClaw aggregates counts to sample-level pseudobulk profiles
and applies either a proper negative-binomial GLM (
pydeseq2) or an explicit Wilcoxon fallback. - Why OmicsClaw: it standardizes design-column validation, replicate checks, method-specific tuning hints, and reproducible outputs across spatial condition-comparison workflows.
Core Capabilities
- Pseudobulk aggregation: sums raw counts per sample x cluster.
- PyDESeq2 (default): negative-binomial GLM on pseudobulk counts using official PyDESeq2 controls.
- Wilcoxon fallback: pseudobulk rank-sum testing on log-CPM transformed profiles for lower-replicate or fallback scenarios.
- Per-cluster contrasts: runs condition comparisons within each cluster to find context-specific responses.
- Replicate-aware filtering: skips contrasts that do not satisfy the configured sample-count threshold.
- Standard Python gallery: emits a recipe-driven condition-comparison
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 analysis without recomputing DE. - Structured outputs: exports global DE table, per-cluster contrast summaries, skipped-contrast reasons, figures, and reproducibility commands.
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| AnnData (preprocessed) | .h5ad |
layers["counts"] or raw, obs[condition_key], obs[sample_key] |
multi_sample.h5ad |
| Demo | n/a | --demo flag |
Runs spatial-preprocess demo then injects synthetic conditions / replicate IDs |
Input Matrix Convention
This skill has a multi-step pipeline with different statistical assumptions:
| Component | Input Matrix | Rationale |
|---|---|---|
| Pseudobulk aggregation | adata.layers["counts"] (raw) |
Sum aggregation requires raw integer-like counts; summing log values is invalid |
| PyDESeq2 | pseudobulk raw integer counts | PyDESeq2 models counts with a negative-binomial GLM |
| Wilcoxon | pseudobulk raw counts internally transformed to CPM/log-space | OmicsClaw computes the transformation inside the wrapper before rank testing |
Core principle: pseudobulk always starts from raw counts, then the DE method operates on the aggregated matrix.
Data layout requirement:
adata.layers["counts"] = adata.X.copy() # before normalize_total + log1p
adata.X = lognorm_expr # after normalize_total + log1p
adata.obs["condition"] = condition_labels # e.g. "treated" / "control"
adata.obs["sample_id"] = sample_labels # biological replicate IDs
If layers["counts"] is missing, OmicsClaw falls back to adata.raw or
adata.X with a warning.
Workflow
- Validate: check condition / sample columns and verify each sample maps to exactly one condition.
- Aggregate: create pseudobulk matrices per sample x cluster from raw counts.
- Filter: drop low-count genes and skip contrasts with too few biological replicates.
- Test:
pydeseq2: fit NB GLM per cluster/contrastwilcoxon: run rank-sum test on transformed pseudobulk profiles
- Render the standard gallery: build the OmicsClaw narrative gallery with design-context, diagnostic burden, supporting 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, figures, tables, and reproducibility helpers.
Visualization Contract
OmicsClaw treats spatial-condition 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 pseudobulk DE.
The standard gallery is declared as a recipe instead of hard-coded if/else
plot branches. Current gallery roles include:
overview: condition labels on tissue and a global pseudobulk volcanodiagnostic: cluster-level DE burden projected onto spatial and UMAP viewssupporting: per-contrast significan
Установить spatial-condition в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spatial-condition?
Compare experimental conditions in spatial transcriptomics data using pseudobulk differential expression with method-aware PyDESeq2 or Wilcoxon testing and explicit replicate handling.
Как установить скилл spatial-condition?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-condition запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create 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…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic