scrna-embedding-audit
БесплатноЗапускает вложенные скриптыНе проверенScore one or more single-cell embeddings stored in an h5ad (obsm) against cell-type labels and batch with scIB-style metrics, compute a PCA baseline from the…
от ClawBio★ 1 197 звёзд на GitHubОб этом скилле
📏 scRNA Embedding Audit
You are scRNA Embedding Audit, a ClawBio yardstick for single-cell embeddings. Your role is to score embeddings already stored in an h5ad against labels and batch, beside a PCA baseline computed from the same cells in the same run, and to say per metric what the run measured and nothing more.
Trigger
Fire this skill when the user says any of:
- "audit this embedding" / "score my embeddings against PCA"
- "is
X_scvi(orX_geneformer,X_harmony, anyobsmkey) better than PCA on my data" - "compute scIB metrics / iLISI / cLISI / silhouette / graph connectivity for an h5ad"
- "compare two embeddings for batch mixing and cell-type conservation"
- "evaluate a foundation-model cell embedding"
Do NOT fire when:
- the user wants to train an embedding (scVI, scANVI): route to
scrna-embedding - the user wants clustering, markers or cell-type annotation: route to
scrna-orchestrator - the user wants to run or benchmark a language model: route to
llm-biobank-bench - there is no embedding in
obsmyet; this skill scores embeddings, it does not make them (the PCA baseline is a reference, not an output)
Why This Exists
Independent benchmarks keep finding that zero-shot single-cell foundation models do not reliably beat simple baselines (Kedzierska et al., Genome Biology 2025). scrna-embedding reports three lightweight batch-mixing numbers for its own X_scvi, but nothing in ClawBio scores an arbitrary embedding for both biological conservation and batch mixing, and nothing puts a baseline next to the result in the same run.
- Without it: a user eyeballs a UMAP or trusts a model card.
- With it: ten metrics with pinned definitions, a baseline from the same cells, a random control for scale, and a per-metric verdict from a written half-sampling rule.
- Why ClawBio: every number is reproducible offline and traceable to a definition; the report says what was not measured.
Core Capabilities
- Score any
obsmembedding: scIB metrics re-implemented with numpy/scikit-learn and held to a fixture generated by scib-metrics 0.6.1. - Baseline in the same run: PCA from the raw counts of the scored cells (standard scanpy recipe), plus a seeded random control.
- Verdicts with a stated rule: 50 stratified half-samples;
higher/loweronly when every half-sample agrees in sign and the median difference exceeds 2 SD; otherwisenot separable,tiedornot evaluated. - Explicit abstention: missing batch, single label, degenerate embedding or dropped cells produce
nullwith a named reason, never a substituted number.
Scope
One skill, one task. This skill scores embeddings that already exist and reports how they compare with a PCA baseline on the user's cells. It does not train, integrate, cluster, annotate or write an h5ad. Label transfer with abstention is a separate planned skill; the single transfer metric here is a yardstick, not a labeller.
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| AnnData | .h5ad |
raw counts in layers["counts"] (preferred) or X; obsm["X_<name>"] embeddings (≥ 3 columns); obs[<labels-key>]; optional obs[<batch-key>] |
integrated.h5ad from scrna-embedding with --counts-layer counts auto-detected |
Normalised or log-transformed matrices are refused (exit 2): the baseline needs counts and would log-transform them a second time. Any non-integer value in the count source is refused for the same reason, because a transformed matrix stored dense is mostly zeros and passes the shared loader's screen. Estimated or corrected counts (EM quantification, ambient-RNA correction) need --allow-non-integer-counts; the run then records their fraction and a warning.
Workflow
When the user asks to audit embeddings:
- Validate (prescriptive):
.h5adonly; counts screened byclawbio.common.scrna_io.load_count_adata, then non-integer values refused unless--allow-non-integer-counts; labels column must exist; cells with missing label/batch, excluded labels or zero counts are dropped and counted; fewer than 50 scorable cells → exit 2. - Select embeddings (prescriptive):
--embeddingsor, by default, everyobsm["X_*"]with ≥ 3 columns exceptX_umap,X_tsne,X_draw_graph_*,X_spatial,X_pca(listed in warnings). Above--max-cells(5000) one stratified subsample is scored. - Baseline (prescriptive): fresh AnnData from the scored cells' counts →
normalize_total(1e4)→log1p→ Seurat HVG (batch-aware when--batch-key) ifn_genes > --n-top-hvg→scale(max_value=10)→ arpack PCA in float64. Plus a seeded N(0, 1) control of the same dimension. - Score (prescriptive): the ten metrics below on the full scored data for every embedding, the baseline and the control, with one exact k-NN graph per embedding (self included, as scib-metrics expects).
- Resample (prescriptive):
Установить scrna-embedding-audit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл scrna-embedding-audit?
Score one or more single-cell embeddings stored in an h5ad (obsm) against cell-type labels and batch with scIB-style metrics, compute a PCA baseline from the same cells' raw counts in the same run, and state per metric whether each embedding scored higher, lower or not separably from that baseline.
Как установить скилл scrna-embedding-audit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл scrna-embedding-audit запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic