Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

spatial-condition

БесплатноБез исполняемых скриптовНе проверен

Compare experimental conditions in spatial transcriptomics data using pseudobulk differential expression with method-aware PyDESeq2 or Wilcoxon testing and…

mdbabumiamssmот 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

  1. Pseudobulk aggregation: sums raw counts per sample x cluster.
  2. PyDESeq2 (default): negative-binomial GLM on pseudobulk counts using official PyDESeq2 controls.
  3. Wilcoxon fallback: pseudobulk rank-sum testing on log-CPM transformed profiles for lower-replicate or fallback scenarios.
  4. Per-cluster contrasts: runs condition comparisons within each cluster to find context-specific responses.
  5. Replicate-aware filtering: skips contrasts that do not satisfy the configured sample-count threshold.
  6. Standard Python gallery: emits a recipe-driven condition-comparison gallery with overview, diagnostic, supporting, and uncertainty panels backed by the shared skills/spatial/_lib/viz layer.
  7. Figure-ready exports: writes figure_data/ CSVs plus a gallery manifest so downstream tools can restyle the same analysis without recomputing DE.
  8. 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

  1. Validate: check condition / sample columns and verify each sample maps to exactly one condition.
  2. Aggregate: create pseudobulk matrices per sample x cluster from raw counts.
  3. Filter: drop low-count genes and skip contrasts with too few biological replicates.
  4. Test:
    • pydeseq2: fit NB GLM per cluster/contrast
    • wilcoxon: run rank-sum test on transformed pseudobulk profiles
  5. Render the standard gallery: build the OmicsClaw narrative gallery with design-context, diagnostic burden, supporting summaries, and uncertainty panels.
  6. Export figure-ready data: write figure_data/*.csv and figure_data/manifest.json for downstream customization.
  7. 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:

  1. Python standard gallery: the canonical result layer. This is the default output users should inspect first.
  2. 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 volcano
  • diagnostic: cluster-level DE burden projected onto spatial and UMAP views
  • supporting: per-contrast significan
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить spatial-condition с