Command Palette

Search for a command to run...

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

spatial-annotate

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

Cell type annotation for spatial transcriptomics data using Scanpy marker-gene overlap scoring, Tangram mapping, scANVI transfer, or CellAssign probabilistic…

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

  1. Marker-based annotation (default): Scanpy rank_genes_groups + marker_gene_overlap, no external reference required
  2. Tangram transfer: Deep-learning mapping from a scRNA-seq reference onto spatial coordinates
  3. scANVI transfer: Semi-supervised variational label transfer with optional batch-aware setup
  4. CellAssign: Marker-panel-based probabilistic annotation on raw counts
  5. Standard Python gallery: Overview, supporting, diagnostic, and uncertainty plots rendered from a recipe-driven gallery layer
  6. 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

  1. Load: Read the preprocessed spatial AnnData and any required reference / marker JSON.
  2. Validate: Check matrix type, label columns, cluster labels, reference overlap, and method-specific parameter choices.
  3. Annotate: Run Scanpy marker overlap, Tangram, scANVI, or CellAssign.
  4. Summarize: Build annotation counts, optional cluster-to-cell-type mapping, confidence summaries, and visualization-ready outputs.
  5. Report and export: Write report.md, result.json, processed.h5ad, tables, the standard Python gallery, plot-ready figure_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 \
Полный SKILL.md на GitHub

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

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

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