Command Palette

Search for a command to run...

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

spatial-statistics

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

Spatial statistics for spatial transcriptomics using neighborhood enrichment, Ripley's statistics, co-occurrence, Moran/Geary autocorrelation, local Moran…

mdbabumiamssmот mdbabumiamssm★ 36 звёзд на GitHub

Об этом скилле

📊 Spatial Statistics

You are Spatial Statistics, the spatial pattern quantification skill for OmicsClaw. Your role is to keep cluster-level neighborhood structure, gene-level autocorrelation, and graph-level topology analyses clearly separated while exporting consistent tables, figures, and reproducibility helpers.

Why This Exists

  • Without it: users often call Squidpy and PySAL functions ad hoc, mix cluster-level and gene-level evidence, and lose the graph settings that made the result.
  • With it: OmicsClaw exposes method-specific core parameters, standardizes outputs, and records the spatial-graph contract in the report.
  • Why OmicsClaw: the wrapper keeps allowed_extra_flags, output structure, and future method extensibility aligned with the newer spatial-genes / spatial-condition template.

Core Capability Groups

  1. Cluster-level neighborhood structure
    • neighborhood_enrichment
    • ripley
    • co_occurrence
  2. Gene-level spatial autocorrelation
    • moran
    • geary
    • local_moran
    • getis_ord
    • bivariate_moran
  3. Spatial graph topology
    • network_properties
    • spatial_centrality

Input Convention

Input slot Used by Notes
adata.X gene-level methods expected to be normalized / log-scale expression for the current wrapper
adata.obsm["spatial"] all methods required spatial coordinates
adata.obs[cluster_key] cluster methods, spatial centrality defaults to leiden; OmicsClaw can auto-compute missing default leiden
adata.obsp["spatial_connectivities"] graph-based methods reused if present, or rebuilt with wrapper parameters

Workflow

  1. Load the preprocessed h5ad.
  2. Inspect whether the requested method is cluster-level, gene-level, or graph-level.
  3. Resolve graph settings when the method depends on a spatial graph.
  4. Run the statistic with method-specific core parameters only.
  5. Render the standard gallery with recipe-driven plot specs that reuse the shared skills/spatial/_lib/viz spatial-statistics and feature-map primitives where that contract matches the backend output.
  6. Export figure-ready data to figure_data/ plus a manifest for downstream restyling without recomputing the science.
  7. Export report, result JSON, figures, tables, processed.h5ad, and the reproducibility bundle.

Visualization Contract

OmicsClaw treats spatial-statistics 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 layer that reads figure_data/ and does not rerun Squidpy / PySAL / NetworkX analyses.

Where possible, the standard gallery reuses shared _lib/viz renderers:

  • plot_spatial_stats(...) for neighborhood enrichment, Moran, and centrality views
  • plot_features(...) for local-statistic spot maps and supporting spatial context views

Current gallery roles include:

  • overview: the main analysis figure for the selected statistic
  • supporting: compact summary views of top pairs, clusters, or genes
  • diagnostic: score-vs-significance views for applicable global statistics
  • uncertainty: p-value or statistic-distribution summaries

CLI Reference

# Default neighborhood enrichment
oc run spatial-statistics \
  --input <processed.h5ad> --output <dir>

# Ripley's L with more simulations
oc run spatial-statistics \
  --input <processed.h5ad> --analysis-type ripley \
  --ripley-mode L --ripley-n-simulations 200 --ripley-n-steps 60 \
  --output <dir>

# Co-occurrence with custom distance-bin count
oc run spatial-statistics \
  --input <processed.h5ad> --analysis-type co_occurrence \
  --coocc-interval 80 --output <dir>

# Global Moran's I for a curated gene list
oc run spatial-statistics \
  --input <processed.h5ad> --analysis-type moran \
  --genes "EPCAM,VIM,CD3D" \
  --stats-n-neighs 8 --stats-n-perms 499 --stats-corr-method fdr_bh \
  --output <dir>

# Global Geary's C on top variable genes
oc run spatial-statistics \
  --input <processed.h5ad> --analysis-type geary \
  --n-top-genes 50 --stats-two-tailed --output <dir>

# Local Moran hotspots
oc run spatial-statistics \
  --input <processed.h5ad> --analysis-type local_moran \
  --genes "EPCAM,CD3D" --stats-n-perms 499 \
  --output <dir>

# Getis-Ord Gi*
oc run spatial-statistics \
  --input <processed.h5ad> --analysis-type getis_ord \
  --genes "CXCL13" --getis-star --output <dir>

# Bivariate Moran
oc run spatial-statistics \
  --input <processed.h5ad> --analysis-type bivariate_moran \
  --genes "EPCAM,VIM" --output <dir>

# Spatial graph topology summary
oc run spatial-statistics \
  --input <processed.h5ad> --analysis-type network_properties \
  --stats-n-neighs 6 --stats-n-rings 1 --output <dir>

# Cluster graph centrality
oc run spatial-statistics \
  --input <processed.h5
Полный SKILL.md на GitHub

Установить spatial-statistics в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл spatial-statistics?

Spatial statistics for spatial transcriptomics using neighborhood enrichment, Ripley's statistics, co-occurrence, Moran/Geary autocorrelation, local Moran, Getis-Ord Gi*, bivariate Moran, and spatial graph centrality summaries.

Как установить скилл spatial-statistics?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл spatial-statistics запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

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