spatial-preprocess

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

A foundational processing pipeline for spatial transcriptomics data. It performs quality checks, filtering, normalisation, selection of highly variable genes, and preparation for clustering and visualisation.

In plain words
What is it for?
Use it with Visium, Xenium, Space Ranger, or generic spatial AnnData files to create a processed dataset with PCA, neighbours, UMAP, and Leiden clusters.
Why use it?
It converts a newly loaded spatial dataset into a standard form that downstream analyses can use.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-preprocess.svg)](https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-preprocess)
Your own site
<a href="https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-preprocess"><img src="https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-preprocess.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,843 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.00073 $0.01843
Opus 5 $0.00036 $0.00922
Sonnet 5 $0.00015 $0.00369
Haiku 4.5 $0.00007 $0.00184

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

Security

Grade A, and why

spatial-preprocess 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_preprocess.py, tests/__init__.py, tests/test_spatial_preprocess.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-preprocess/SKILL.md · 136 lines

How it starts

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

spatial-preprocess

When to use

The user has a spatial AnnData (Visium / Xenium / SpaceRanger output / generic) — either freshly loaded or coming out of spatial-raw-processing — and wants the canonical "QC → filter → normalise → HVG → PCA → neighbours → Leiden" path producing a downstream-ready processed.h5ad. This is the foundation skill — most other spatial analyses (spatial-domains, spatial-de, spatial-genes, spatial-deconv, spatial-communication, ...) consume its output. Single backend: scanpy_standard.

For raw FASTQ → matrix conversion use spatial-raw-processing. For explicit tissue-domain detection (SpaGCN / STAGATE) on top of this output use spatial-domains.

Inputs & Outputs

Inputs

  • Input kinds: file, directory
  • Modalities: visium, xenium
  • File types: .h5ad, .h5, .hdf5, .zarr
  • Expects obsm: spatial

Outputs

  • tables/cluster_summary.csv
  • tables/multi_resolution_summary.csv
  • tables/pca_variance_ratio.csv
  • tables/preprocess_run_summary.csv
  • tables/preprocess_spatial_points.csv
  • tables/preprocess_umap_points.csv
  • tables/qc_metric_distributions.csv
  • tables/qc_summary.csv
  • figures/cluster_size_barplot.png
  • figures/leiden_resolution_sweep.png
  • figures/pca_variance_curve.png
  • figures/qc_metric_distributions.png
  • figures/qc_metrics_spatial.png
  • figures/spatial_leiden.png
  • figures/umap_leiden.png
  • processed.h5ad
  • report.md
  • result.json
  • Processed AnnData (saves_h5ad) — adds obs: leiden; obsm: spatial, X_pca, X_umap; var: highly_variable; layers: counts
  • AnnData processing state after success: preprocessed

Flow

  1. Load AnnData (--input) or build a synthetic spatial demo.
  2. Apply tissue preset if --tissue <preset> is given (overrides default --min-genes / --min-cells / --max-mt-pct / --max-genes).
  3. QC + filter spots / genes; mitochondrial-percentage filter uses --species for gene prefix (MT- for human, mt- for mouse).
  4. Normalise (CP10k log) → HVG (--n-top-hvg) → PCA (--n-pcs).
  5. Build neighbour graph (--n-neighbors) → Leiden at --leiden-resolution.
  6. If --resolutions a,b,c,... is set, sweep additional Leiden resolutions and write the multi-resolution table.
  7. Save processed.h5ad, tables, figures, report.md, result.json.

Read the full file on GitHub · 136 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 · 136 lines · 73 tokens per session scan A ef5f2e8a53a8

Subscribe to this mod's changes

spatial-preprocess is a skill published in the GitHub repository TianGzlab/OmicsClaw (160 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 73 tokens to every session and 1,843 once invoked, about $0.0004 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-preprocessing

Load spatial transcriptomics data (Visium, Xenium, MERFISH, Slide-seq, generic h5ad), perform QC filtering, normalization, HVG selection, PCA, UMAP, and Leiden clustering.

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

spatial-domain-identification

Identify tissue regions and spatial niches from preprocessed spatial transcriptomics data using Leiden, Louvain, SpaGCN, STAGATE, GraphST, or BANKSY.

ShangBioLab/SpatialClaw · 40 tokens

protein-design-qc

Protein design quality control, filtering thresholds, and ranking guidance. Use this skill when: (1) Evaluating design quality for binding, expression, or structure, (2) Setting filtering thresholds for pLDDT, ipTM, PAE, (3) Checking sequence liabilities (cysteines, deamidation, polybasic clusters), (4) Creating…

zongtingwei/Bioclaw_Skills_Hub · 143 tokens

protein-design-qc

Protein design quality control, filtering thresholds, and ranking guidance. Use this skill when: (1) Evaluating design quality for binding, expression, or structure, (2) Setting filtering thresholds for pLDDT, ipTM, PAE, (3) Checking sequence liabilities (cysteines, deamidation, polybasic clusters), (4) Creating…

BioTender-max/awesome-bio-agent-skills · 143 tokens

protein-qc

Quality control metrics and filtering thresholds for protein design. Use this skill when: (1) Evaluating design quality for binding, expression, or structure, (2) Setting filtering thresholds for pLDDT, ipTM, PAE, (3) Checking sequence liabilities (cysteines, deamidation, polybasic clusters), (4) Creating multi-stage…

BioTender-max/awesome-bio-agent-skills · 140 tokens