spatial-transcriptomics
БесплатноЗапускает вложенные скриптыНе проверенAnalyse 10x Visium spatial transcriptomics: SpaceRanger outs or spatial h5ad in, then QC, Leiden clustering, Wilcoxon markers, Moran's I, neighbourhood…
от ClawBio★ 1 197 звёзд на GitHubОб этом скилле
🧬 Spatial Transcriptomics (Visium)
You are spatial-transcriptomics, a ClawBio agent that analyses measured 10x Visium data. You load SpaceRanger outs/ or a spatial h5ad, then write QC, clustering, markers and spatial statistics as a local report.
Trigger
Fire this skill when the user says any of:
- "analyse my Visium data"
- "spatial transcriptomics QC and clustering"
- "SpaceRanger outs"
- "spatially variable genes"
- "Moran's I on visium"
- "neighbourhood enrichment"
- "spot co-occurrence"
Do NOT fire when:
- The user has an H&E tile and wants predicted expression. That is
deepspot-m. - The user has dissociated scRNA-seq (h5ad/mtx with no
obsm['spatial']). That isscrna-orchestrator. - The user has a marker-by-spot table and wants region labels. That is
marker-dominance-mapper.
Why This Exists
- Without it: Visium analysis is a Scanpy plus Squidpy notebook stitched by hand, with no
--demoand no reproducibility bundle. - With it: One command turns SpaceRanger
outs/into a report with Leiden, Wilcoxon markers, Moran's I, neighbourhood enrichment and co-occurrence. - Why ClawBio: Local-first, synthetic demo, shared reproducibility helpers. Complementary to
deepspot-m, which predicts expression from histology; this skill analyses expression that was measured.
Core Capabilities
- Load Visium: SpaceRanger
outs/(filtered_feature_bc_matrix/+spatial/) or h5ad withobsm['spatial']. - QC and clustering: Scanpy filter, normalise, HVG, PCA, UMAP, Leiden.
- Markers: Wilcoxon cluster-vs-rest on log-normalised expression.
- Spatial statistics: kNN Moran's I, permutation neighbourhood enrichment, distance-binned co-occurrence.
- Report: Markdown, JSON, figures, tables, reproducibility bundle.
Scope
One skill, one task. Measured Visium-like spot data in, one analysis report out. It does not predict expression from H&E, call cells on a WSI, or run Visium HD / Xenium.
Input Formats
| Format | Extension | Required Fields | Example |
|---|---|---|---|
| SpaceRanger outs | directory | filtered_feature_bc_matrix/ mtx + spatial/tissue_positions.csv |
sample/outs |
| Spatial AnnData | .h5ad |
raw counts in X or an explicit --counts-layer; finite obsm['spatial'] x,y per spot |
visium.h5ad |
| Demo | n/a | none | --demo |
HDF5 filtered_feature_bc_matrix.h5 is not read in v0.1; pass the mtx folder. Tissue images are not required.
Counts must be finite, nonnegative integers. A processed h5ad must supply an
explicit raw-count layer (for example --counts-layer counts); .raw is not
assumed to contain counts. Normalised/log-transformed X is rejected. Analyse one
slide at a time; this workflow does not model multiple libraries or donors.
Workflow
- Validate (prescriptive): Accept
outs/, raw-count spatial h5ad, or--demo. Validate counts and finite two-dimensional coordinates. Abstain below 10 spots or two retained genes; require--overwritefor a nonempty output directory. - Process (prescriptive): Export per-spot counts, detected genes and mitochondrial percentages before QC; filter with
min_genes,min_cellsand optionalmax_pct_mt; normalise to 1e4, log1p, HVGs, PCA, expression neighbours, UMAP and Leiden. - Markers (prescriptive): Wilcoxon cluster-vs-rest on the tested gene universe; omit groups without enough observations, export a marker heatmap and report the limitation.
- Spatial graph: k=6 nearest spots on
obsm['spatial'](not the PCA graph). - Moran's I: row-standardised kNN I per gene (Moran 1950; Squidpy
spatial_autocorr). - Neighbourhood enrichment: observed cluster–cluster neighbour counts vs shuffled labels (Squidpy
nhood_enrichment). - Co-occurrence (prescriptive): For each cumulative radius r, compute P(target | source, 0 < distance ≤ r) / P(target | eligible pair, r), using the Squidpy 1.6.0 estimator and six positive-distance quantile radii. Export all scores, cluster axes and radii.
- Generate (prescriptive outputs, flexible narrative): Write
report.md, strict JSON, figures, tables andreproducibility/with actual parameters, software versions, source/input hashes and a replay command that verifies the input and writes a new directory.
Steps 1–7 are prescriptive. Report narrative is flexible.
CLI Reference
python skills/spatial-transcriptomics/spatial_transcriptomics.py \
--input sample/outs --output /tmp/visium_out
python skills/spatial-transcriptomics/spatial_transcriptomics.py \
--input visium.h5ad --output /tmp/visium_out
python skills/spatial-transcriptomics/spatial_transcriptomics.py \
--demo --output /tmp/spatial_demo
python clawbio.py run spatial --input sample/outs --output /tmp/visium_out
python clawbio.py run spatial --demo
# A processed h5ad with a preserved raw-count layer:
python clawbio.py run spatial --input processed.h5ad --counts-layer counts \
Установить spatial-transcriptomics в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл spatial-transcriptomics?
Analyse 10x Visium spatial transcriptomics: SpaceRanger outs or spatial h5ad in, then QC, Leiden clustering, Wilcoxon markers, Moran's I, neighbourhood enrichment and co-occurrence in one local report.
Как установить скилл spatial-transcriptomics?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-transcriptomics запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic