spatial-genes

spatial-genes is a skill for Claude Code, Codex from TianGzlab/OmicsClaw. It costs 59 tokens per session (1,829 once invoked), scanned A, original, Apache-2.0.

A spatial transcriptomics tool for finding genes whose activity varies by location. It uses measures such as Moran’s I, which tests whether nearby locations have similar values.

In plain words
What is it for?
Use it to rank spatially variable genes in a preprocessed AnnData file with Moran’s I, SpatialDE, SPARK-X, or FLASH-S.
Why use it?
It helps identify genes linked to tissue structure instead of treating every location as unrelated.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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-genes
Any agent
npx skills add TianGzlab/OmicsClaw --skill spatial-genes
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-genes

README.md
[![agentmods](https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-genes.svg)](https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-genes)
Your own site
<a href="https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-genes"><img src="https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-genes.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,829 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.1 $0.00059 $0.01829
Opus 5 $0.00030 $0.00915
Sonnet 5 $0.00012 $0.00366
Haiku 4.5 $0.00006 $0.00183

Measured 3d ago against content hash 80586988e25a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

spatial-genes 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 3d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (spatial_genes.py, tests/__init__.py, tests/test_spatial_genes.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-genes/SKILL.md · 139 lines

How it starts

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

spatial-genes

When to use

The user has a preprocessed spatial AnnData (obsm["spatial"] populated; ideally layers["counts"] for count-based methods) and wants per-gene spatial-variability scores. Four methods:

  • morans (default) — Moran's I via squidpy.gr.spatial_autocorr (--morans-n-neighs, --morans-n-perms). Fast.
  • spatialde — SpatialDE Gaussian-process model (--spatialde-min-counts, --spatialde-aeh-patterns / --spatialde-aeh-lengthscale, --spatialde-no-aeh). Most rigorous, slower.
  • sparkx — SPARK-X non-parametric covariance (--sparkx-num-cores, --sparkx-max-genes). Scales to large slides.
  • flashs — FLASH-S random-Fourier-feature approximation (--flashs-n-rand-features, --flashs-bandwidth). Fastest.

For tissue domain detection use spatial-domains; for between-group DE use spatial-de.

Inputs & Outputs

Inputs

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

Outputs

  • tables/coords.csv
  • tables/counts.csv
  • tables/significant_svgs.csv
  • tables/sparkx_results.csv
  • tables/svg_observation_metrics.csv
  • tables/svg_results.csv
  • tables/svg_run_summary.csv
  • tables/top_svg_scores.csv
  • tables/top_svg_spatial_points.csv
  • tables/top_svg_umap_points.csv
  • figures/moran_ranking.png
  • figures/svg_score_vs_significance.png
  • figures/svg_significance_distribution.png
  • figures/top_svg_scores.png
  • figures/top_svg_spatial.png
  • figures/top_svg_umap.png
  • processed.h5ad
  • report.md
  • result.json
  • Processed AnnData (saves_h5ad) — adds uns: moranI

Flow

  1. Load AnnData (--input) or chain through spatial-preprocess --demo via subprocess (spatial_genes.py:1043-1050).
  2. parser.error validates per-method numeric ranges (--morans-n-neighs ≥ 1, etc.) at lines :1062-1078.
  3. Validate input matrix: count-based methods (spatialde / sparkx) expect layers["counts"]; if missing the script logs a warning and falls back to adata.X — results may be suboptimal.
  4. Dispatch to chosen method; method-specific kwargs flow from _collect_run_configuration(args).
  5. Build standardised SVG result table with score / pvalue / padj columns; rank by score.
  6. Detect significance at --fdr-threshold; build top-N table.
  7. Save tables, figures, processed.h5ad, report.md, result.json.

Read the full file on GitHub · 139 lines

Files

What ships with it

9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 139 lines · 59 tokens per session scan A 80586988e25a

Subscribe to this mod's changes

spatial-genes is a skill published in the GitHub repository TianGzlab/OmicsClaw (160 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 59 tokens to every session and 1,829 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-svg-detection

Find genes with spatially variable expression patterns using Moran's I, SpatialDE, or FlashS.

ShangBioLab/SpatialClaw · 26 tokens

spatial-omics-integrate

Integrate two aligned spatial omics modalities on the same cells using SpatialGlue or SpaDDM. Standard input contract: --input --omics2 . Supports demo mode and validated modality pairs such as RNA+Protein and RNA+ATAC.

ShangBioLab/SpatialClaw · 70 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