spatial-preprocess

spatial-preprocess is a skill for Claude Code, Codex from TianGzlab/OmicsClaw. It costs 73 tokens per session (2,267 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

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

Good fit Use it with Visium, Xenium, Space Ranger, or generic spatial AnnData files to create a processed dataset with PCA, neighbours, UMAP, and Leiden clusters.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tiangzlab/omicsclaw/spatial-preprocess
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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for spatial-preprocess

Your own site · 80×15
<a href="https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-preprocess"><img src="https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-preprocess.svg" alt="Reviewed on agentmods" width="80" 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 2,267 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Rogue Agent · line 3
    Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
    Fix: Prevent the skill from modifying its own code, SKILL.md, or configuration files. Treat skill files as read-only at runtime.
How audits are shown
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.00073 $0.02267
Opus 5.5 $0.00029 $0.00907
Sonnet 5.5 $0.00015 $0.00453
Haiku 4.5 $0.00007 $0.00227

Measured 14d ago against content hash e671f9e863d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 14d ago.

The scan reads SKILL.md. This mod also ships 6 executable files (_api.py, examples/example_step.py, 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 · 199 lines

How it starts

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

spatial-preprocess

When to use

Use on raw-count spatial AnnData for QC, filtering, normalization, HVGs, PCA, neighbors, UMAP and Leiden. The expression graph does not use spatial coordinates. Use spatial-raw-processing for FASTQs and spatial-domains for spatially informed domain detection on preprocessed data.

Use from a step

from skills._sdk.notebook import load_demo, load_skill, write_output

library = load_skill("spatial-preprocess")
adata = library.preprocess(load_demo("spatial_synthetic"), n_top_hvg=150, n_pcs=15)
write_output(adata, "intermediate/processed.h5ad")
write_output(library.cluster_summary(adata), "tables/clusters.csv")

The demo is synthetic, with three known spatial stripes. See examples/example_step.py for count-preservation and domain-recovery checks. For real H5AD input use read_input("data/slide.h5ad") instead of load_demo.

API

preprocess(adata, *, min_genes: int=0, min_cells: int=0, max_mt_pct: float=20.0, max_genes: int=0, n_top_hvg: int=2000, n_pcs: int=30, n_neighbors: int=15, leiden_resolution: float=0.5, resolutions: list[float] | None=None, tissue: str | None=None, species: str='human', random_state: int=0)

Filter raw spatial counts and return a processed copy without changing the input.

Reads raw counts from X. The returned X is total-normalized to 10,000 and log1p-transformed; layers['counts'] and raw retain the filtered counts. Adds QC metrics, HVGs, PCA, neighbors, UMAP and Leiden. Coordinates are preserved but do not enter the expression neighbor graph.

:param adata: AnnData with raw counts in X and optional spatial coordinates. :param min_genes: Minimum detected genes per spot; 0 disables this filter. :param min_cells: Minimum spots per gene; 0 disables this filter. :param max_mt_pct: Keep spots strictly below this percentage; 20 by default, 100 disables the filter. Adjust for tissue and assay quality. :param max_genes: Keep spots strictly below this detected-gene count; 0 disables the upper bound. :param n_top_hvg: Select up to 2000 HVGs from counts with Seurat v3 by default. :param n_pcs: Request 30 PCs by default; clipped below both dimensions. Neighbors use at most 30 of the computed PCs. :param n_neighbors: Graph neighborhood size, 15 by default. :param leiden_resolution: Primary Leiden resolution, 0.5 by default. :param resolutions: Optional positive resolutions for extra obs['leiden_res_<value>'] columns; None skips the sweep. :param tissue: Optional QC preset such as brain or pbmc. Values equal to the defaults (0, 20, 0) for min_genes, max_mt_pct and max_genes are replaced by the preset, even when passed explicitly. None uses no preset. :param species: Human (default, MT-) or mouse (mt-) mitochondrial prefix. :param random_state: Seed for PCA, neighbors, UMAP and Leiden; default 0 matches the original CLI. Change it to assess seed sensitivity. :returns: A new AnnData with counts, embeddings, labels and JSON diagnostics. :raises ValueError: Invalid thresholds or too few spots, genes or HVGs remain. :raises ImportError: A backend is missing; use install_skill_deps for scikit-misc (HVGs), igraph (Leiden) or umap-learn (embedding).

Read the full file on GitHub · 199 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. 14d ago Changed · +63 lines e671f9e863d3
  2. 1mo ago 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 (161 stars, last pushed 14d ago), licensed Apache-2.0. It adds 73 tokens to every session and 2,267 once invoked, about $0.0003 per session on Opus 5.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-omics

Spatial transcriptomics and spatial proteomics analysis covering technology-specific workflows, spatial statistics, deconvolution, and niche analysis.

inflexa-ai/inflexa · 28 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