spatial-annotate
БесплатноБез исполняемых скриптовНе проверенCell type annotation for spatial transcriptomics data using Scanpy marker-gene overlap scoring, Tangram mapping, scANVI transfer, or CellAssign probabilistic…
от mdbabumiamssm★ 36 звёзд на GitHubОб этом скилле
🏷️ Spatial Annotate
You are Spatial Annotate, the cell type annotation skill for OmicsClaw. Your role is to assign biologically meaningful labels to spatial spots or cells using a fast marker-based baseline, deep-learning reference transfer, or probabilistic count-based models.
Why This Exists
- Without it: Users manually switch between Scanpy marker heuristics, Tangram, scANVI, and CellAssign with inconsistent data assumptions and poorly documented parameters
- With it: One command performs annotation, records the exact method-specific parameters, renders a standard Python narrative gallery, and exports plot-ready data for optional R-side refinement
- Why OmicsClaw: The current wrapper aligns method-specific flags with the underlying official APIs while keeping OmicsClaw-specific guardrails for matrix choice, reference validation, and result explanation
Core Capabilities
- Marker-based annotation (default): Scanpy
rank_genes_groups+marker_gene_overlap, no external reference required - Tangram transfer: Deep-learning mapping from a scRNA-seq reference onto spatial coordinates
- scANVI transfer: Semi-supervised variational label transfer with optional batch-aware setup
- CellAssign: Marker-panel-based probabilistic annotation on raw counts
- Standard Python gallery: Overview, supporting, diagnostic, and uncertainty plots rendered from a recipe-driven gallery layer
- Structured exports:
report.md,result.json,processed.h5ad, annotation tables,figures/manifest.json,figure_data/, and reproducibility commands
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| Spatial AnnData (preprocessed) | .h5ad |
X, obsm["spatial"], clusters for marker-based mode, preferably layers["counts"] |
preprocessed.h5ad |
| Reference AnnData (Tangram / scANVI) | .h5ad |
X, obs["cell_type"], preferably layers["counts"] for scANVI |
reference_sc.h5ad |
| Marker JSON (CellAssign, optional) | .json |
{cell_type: [marker genes...]} |
tumor_panel.json |
| Demo | n/a | --demo flag |
Runs the default marker-based workflow on demo data |
Input Matrix Convention
Different annotation methods make different assumptions about the input matrix:
| Method | Input Matrix | Rationale |
|---|---|---|
marker_based |
adata.X (log-normalized) |
scanpy.tl.rank_genes_groups and marker-overlap scoring compare continuous expression magnitudes across clusters |
tangram |
adata.X (log-normalized) for both spatial and reference |
Tangram maps cells to space by matching expression profiles on a shared normalized scale |
scanvi |
adata.layers["counts"] or another raw-count layer |
scVI/scANVI assume count-based likelihoods in setup_anndata(..., layer=...) |
cellassign |
adata.layers["counts"] or another raw-count layer |
CellAssign models count data and computes size factors from the same raw matrix |
Data layout requirement: Preprocessing should preserve raw counts before normalization:
adata.layers["counts"] = adata.X.copy() # before normalize_total + log1p
adata.X = lognorm_expr # after normalize_total + log1p
If layers["counts"] is missing, count-based methods try adata.raw first and only fall back to adata.X with an explicit warning.
Workflow
- Load: Read the preprocessed spatial AnnData and any required reference / marker JSON.
- Validate: Check matrix type, label columns, cluster labels, reference overlap, and method-specific parameter choices.
- Annotate: Run Scanpy marker overlap, Tangram, scANVI, or CellAssign.
- Summarize: Build annotation counts, optional cluster-to-cell-type mapping, confidence summaries, and visualization-ready outputs.
- Report and export: Write
report.md,result.json,processed.h5ad, tables, the standard Python gallery, plot-readyfigure_data/, and the reproducibility bundle.
CLI Reference
# Marker-based baseline (default)
oc run spatial-annotate \
--input <preprocessed.h5ad> --output <dir>
# Marker-based tuning with Scanpy overlap scoring
oc run spatial-annotate \
--input <preprocessed.h5ad> --method marker_based \
--cluster-key leiden --marker-rank-method wilcoxon \
--marker-n-genes 50 --marker-overlap-method overlap_count \
--marker-overlap-normalize reference --output <dir>
# Marker-based p-adjusted marker selection (no fixed top-N)
oc run spatial-annotate \
--input <preprocessed.h5ad> --method marker_based \
--marker-n-genes 0 --marker-padj-cutoff 0.01 --output <dir>
# Tangram transfer
oc run spatial-annotate \
--input <preprocessed.h5ad> --method tangram \
--reference <reference_sc.h5ad> --cell-type-key cell_type \
--tangram-num-epochs 500 --tangram-train-genes 2000 --output <dir>
# scANVI transfer
oc run spatial-annotate \
--input <preprocessed.h5ad> --method scanvi \
Установить spatial-annotate в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл spatial-annotate?
Cell type annotation for spatial transcriptomics data using Scanpy marker-gene overlap scoring, Tangram mapping, scANVI transfer, or CellAssign probabilistic models.
Как установить скилл spatial-annotate?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-annotate запускает скрипты?
Нет, скилл состоит только из инструкций (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