spatial-statistics

spatial-statistics is a skill for Claude Code, Codex from TianGzlab/OmicsClaw. It costs 58 tokens per session (2,229 once invoked), scanned A, original, Apache-2.0.

A workflow for measuring spatial patterns in clustered spatial single-cell data, such as hotspots, neighbourhood relationships, and gene co-occurrence.

In plain words
What is it for?
Useful for calculating spatial autocorrelation, hotspot scores, neighbourhood enrichment, Ripley statistics, co-occurrence, and graph centrality from AnnData files.
Why use it?
It helps quantify whether observations are arranged together or separately instead of relying only on visual inspection of tissue maps.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tiangzlab/omicsclaw/spatial-statistics
Any agent
npx skills add TianGzlab/OmicsClaw --skill spatial-statistics
Clone the repo
git clone --depth 1 https://github.com/TianGzlab/OmicsClaw

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spatial-statistics

README.md
[![agentmods](https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-statistics.svg)](https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-statistics)
Your own site
<a href="https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-statistics"><img src="https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-statistics.svg" alt="Measured on agentmods" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,229 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00058 $0.02229
Opus 5 $0.00029 $0.01115
Sonnet 5 $0.00012 $0.00446
Haiku 4.5 $0.00006 $0.00223

Measured yesterday against content hash 30844a65159c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spatial-statistics scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 3 executable files (spatial_statistics.py, tests/__init__.py, tests/test_spatial_statistics.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/spatial/spatial-statistics/SKILL.md · 176 lines

How it starts

The opening of the file, as written. The whole thing — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.

spatial-statistics

When to use

The user has a clustered spatial AnnData (obs[--cluster-key] for cluster-aware analyses; obsm["spatial"] populated) and wants a specific spatial-statistics analysis. Pick --analysis-type from VALID_ANALYSIS_TYPES:

  • moran / geary — global spatial autocorrelation per gene.
  • local_moran — per-spot LISA + GeoDa quadrants (--local-moran-geoda-quads).
  • getis_ord — per-spot hotspot Z-scores.
  • bivariate_moran — exactly two genes (--genes geneA,geneB).
  • neighborhood_enrichment — squidpy NES between cluster pairs.
  • ripley — Ripley K / L / G / F (--ripley-mode, --ripley-metric).
  • co_occurrence — pairwise label co-occurrence at distance bins (--coocc-interval, --coocc-n-splits).
  • spatial_centrality — graph-centrality per spot.

For per-gene SVG ranking use spatial-genes; for tissue-domain detection use spatial-domains.

Inputs & Outputs

Inputs

  • File types: .h5ad
  • Requires a preprocessed AnnData (X normalised, PCA/neighbours present)
  • Expects obsm: spatial

Outputs

  • tables/analysis_results.csv
  • tables/analysis_summary.csv
  • tables/bivariate_moran_summary.csv
  • tables/centrality_scores.csv
  • tables/cluster_summary.csv
  • tables/cooccurrence_curves.csv
  • tables/cooccurrence_pairs.csv
  • tables/neighborhood_counts.csv
  • tables/neighborhood_pairs.csv
  • tables/neighborhood_zscore.csv
  • tables/network_per_cluster.csv
  • tables/network_summary.csv
  • tables/pair_summary.csv
  • tables/per_cluster_metrics.csv
  • tables/ripley_cluster_summary.csv
  • tables/ripley_curves.csv
  • tables/spot_statistics.csv
  • tables/top_results.csv
  • figures/bivariate_moran_scatter.png
  • figures/bivariate_moran_spatial.png
  • figures/centrality_scores.png
  • figures/centrality_scores_barplot.png
  • figures/co_occurrence_curves.png
  • figures/co_occurrence_distribution.png
  • figures/co_occurrence_top_pairs.png
  • figures/geary_pvalue_distribution.png
  • figures/geary_ranking.png
  • figures/geary_score_vs_significance.png
  • figures/moran_pvalue_distribution.png
  • figures/moran_ranking.png
  • figures/moran_score_vs_significance.png
  • figures/neighborhood_enrichment_heatmap.png
  • figures/neighborhood_top_pairs.png
  • figures/neighborhood_zscore_distribution.png
  • figures/network_degree_histogram.png
  • figures/network_per_cluster_degree.png
  • figures/ripley_cluster_max_stat.png
  • figures/ripley_curves.png
  • figures/ripley_stat_distribution.png
  • processed.h5ad
  • report.md
  • result.json
  • Processed AnnData (saves_h5ad) — adds obs: local_moran_<gene>, local_moran_pval_<gene>, local_moran_q_<gene>, getis_ord_<gene>, getis_ord_pval_<gene>

Read the full file on GitHub · 176 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 176 lines · 58 tokens per session scan A 30844a65159c

Subscribe to this mod's changes

spatial-statistics is a skill published in the GitHub repository TianGzlab/OmicsClaw (160 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 58 tokens to every session and 2,229 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

spatial-statistics

Comprehensive spatial statistics toolkit — cluster-level (neighborhood enrichment, Ripley, co-occurrence), gene-level (Moran's I, Geary's C, local Moran, Getis-Ord), and network-level analysis.

ShangBioLab/SpatialClaw · 51 tokens

spatial-transcriptomics-spatial-data-io

Load spatial transcriptomics data from Visium, Xenium, MERFISH, Slide-seq, and other platforms using Squidpy and SpatialData. Use this skill when: (1) Loading Visium spatial transcriptomics data from Space Ranger output, (2) Loading Xenium single-cell resolution spatial data, (3) Loading MERFISH, CosMx, or other…

PharMolix/OpenBioMed · 103 tokens

pkpd-modeling

Pharmacokinetic and pharmacodynamic modelling and simulation - non-compartmental analysis, compartmental and population PK, PK/PD and exposure-response, TMDD, PBPK orientation, bioequivalence, allometric scaling and first-in-human dose, drug interaction prediction, and Bayesian therapeutic drug monitoring. Use when…

K-Dense-AI/scientific-agent-skills · 273 tokens

neuropixels-analysis

Analyze Neuropixels extracellular recordings end-to-end with SpikeInterface. Covers loading SpikeGLX/Open Ephys/NWB data, preprocessing, drift/motion correction, Kilosort4 (and CPU) spike sorting, quality metrics, and unit curation (threshold-based, model-based UnitRefine, and AI-assisted visual review). Use when…

K-Dense-AI/scientific-agent-skills · 98 tokens

onekgpd

Query the 1000 Genomes Project dataset (3,202 whole-genome-sequenced individuals, GRCh38) at the level of individual participants. Use when a question is about individuals or variants in the 1000 Genomes Project cohort: which individuals carry variants matching specific criteria in a gene or region, which individuals…

K-Dense-AI/scientific-agent-skills · 143 tokens

pydicom

Use pydicom to read, inspect, write, transform, and safely preflight local DICOM datasets and pixel data. Applies to DICOM metadata, transfer syntaxes, compression plugins, frames, private elements, JSON, and bounded de-identification review.

K-Dense-AI/scientific-agent-skills · 56 tokens