spatial-integrate

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

A tool for reducing batch effects between spatial transcriptomics samples. Batch effects are unwanted differences caused by separate experiments, samples, or processing runs rather than biology.

In plain words
What is it for?
Use it on multi-sample AnnData data with Harmony, BBKNN, or Scanorama to create a corrected expression space or neighbour graph.
Why use it?
It makes expression-based comparisons across samples more reliable before clustering, domain detection, or differential-expression analysis.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-integrate.svg)](https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-integrate)
Your own site
<a href="https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-integrate"><img src="https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-integrate.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,847 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00062 $0.01847
Opus 5 $0.00031 $0.00924
Sonnet 5 $0.00012 $0.00369
Haiku 4.5 $0.00006 $0.00185

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

Security

Grade A, and why

spatial-integrate 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 today.

The scan reads SKILL.md. This mod also ships 2 executable files (spatial_integrate.py, tests/test_spatial_integrate.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-integrate/SKILL.md · 138 lines

How it starts

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

spatial-integrate

When to use

The user has a multi-sample spatial AnnData (sample / donor labels in obs["batch"] or another --batch-key) and wants batch effects in the gene-expression embedding removed before downstream domain / cluster / DE analysis. Three methods:

  • harmony (default) — soft k-means in PCA space; produces obsm["X_pca_harmony"]. Tunable via --harmony-theta / --harmony-lambda / --harmony-max-iter. Requires harmonypy.
  • bbknn — batch-balanced neighbour graph; produces a fused obsp["distances"] ready for UMAP / clustering. Tunable via --bbknn-neighbors-within-batch / --bbknn-n-pcs / --bbknn-trim. Requires bbknn.
  • scanorama — corrected expression matrix in obsm["X_scanorama"]. Tunable via --scanorama-knn / --scanorama-sigma / --scanorama-alpha / --scanorama-batch-size. Requires scanorama.

For physical slice-coordinate alignment use spatial-register. For single-batch data skip this skill and go to spatial-domains / spatial-de directly.

Inputs & Outputs

Inputs

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

Outputs

  • tables/batch_sizes.csv
  • tables/corrected_embedding_points.csv
  • tables/integration_metrics.csv
  • tables/integration_observations.csv
  • tables/umap_after_points.csv
  • tables/umap_before_points.csv
  • figures/batch_entropy_after_umap.png
  • figures/batch_entropy_distribution.png
  • figures/batch_highlight.png
  • figures/batch_mixing.png
  • figures/batch_sizes.png
  • figures/umap_before_by_batch.png
  • figures/umap_by_batch.png
  • figures/umap_by_cluster.png
  • processed.h5ad
  • report.md
  • result.json
  • Processed AnnData (saves_h5ad) — adds obsm: X_pca_harmony, X_scanorama

Flow

  1. Load AnnData (--input) or build a 3-batch demo via the bundled spatial-preprocess --demo (spatial_integrate.py:803-815 chains via subprocess).
  2. parser.error validates per-method numeric ranges (--harmony-theta ≥ 0; --harmony-lambda > 0 or -1; --harmony-max-iter ≥ 1; --bbknn-* ≥ 1; --scanorama-* per-flag bounds).
  3. Dispatch to method:
    • harmony → write obsm["X_pca_harmony"].
    • bbknn → rebuild obsp["distances"] + obsp["connectivities"].
    • scanorama → write obsm["X_scanorama"].
  4. Compute integration metrics (e.g., LISI / silhouette scores when supported).
  5. Save processed.h5ad, tables, figures, report.md, result.json.

Read the full file on GitHub · 138 lines

Files

What ships with it

8 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. today First seen · 138 lines · 62 tokens per session scan A 178c01bb5412

Subscribe to this mod's changes

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