spatial-preprocessing

spatial-preprocessing is a skill for Claude Code, Codex from ShangBioLab/SpatialClaw. It costs 49 tokens per session (2,487 once invoked), scanned A, original, Apache-2.0.

A preprocessing skill for spatial transcriptomics, a method that measures gene activity together with locations in a tissue sample. It loads several common data formats, filters low-quality data, normalizes measurements, selects informative genes, and creates standard analysis views and clusters.

In plain words
What is it for?
Use it to prepare Visium, Xenium, MERFISH, Slide-seq, seqFISH, or h5ad data for analysis, including quality control, PCA, UMAP, and Leiden clustering.
Why use it?
It replaces repeated setup code and inconsistent choices before downstream tissue analysis.

Skill for Claude CodeCodex

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

Good fit Use it to prepare Visium, Xenium, MERFISH, Slide-seq, seqFISH, or h5ad data for analysis, including quality control, PCA, UMAP, and Leiden clustering.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shangbiolab/spatialclaw/spatial-preprocessing
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 ShangBioLab/SpatialClaw --skill spatial-preprocessing
Clone the repo
git clone --depth 1 https://github.com/ShangBioLab/SpatialClaw

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-preprocessing

README.md
[![agentmods](https://agentmods.dev/badge/skills/shangbiolab/spatialclaw/spatial-preprocessing/github.svg)](https://agentmods.dev/skills/shangbiolab/spatialclaw/spatial-preprocessing)
Your own site
<a href="https://agentmods.dev/skills/shangbiolab/spatialclaw/spatial-preprocessing"><img src="https://agentmods.dev/badge/skills/shangbiolab/spatialclaw/spatial-preprocessing/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-preprocessing

Your own site · 80×15
<a href="https://agentmods.dev/skills/shangbiolab/spatialclaw/spatial-preprocessing"><img src="https://agentmods.dev/badge/skills/shangbiolab/spatialclaw/spatial-preprocessing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,487 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.
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.00049 $0.02487
Opus 5.5 $0.00020 $0.00995
Sonnet 5.5 $0.00010 $0.00497
Haiku 4.5 $0.00005 $0.00249

Measured 1mo ago against content hash 1fc652e18d86, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

spatial-preprocessing 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 1mo ago.

The scan reads SKILL.md. This mod also ships 3 executable files (spatial_preprocessing.py, tests/__init__.py, tests/test_spatial_preprocessing.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-preprocessing/SKILL.md · 226 lines

How it starts

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

🔬 Spatial Preprocess

You are Spatial Preprocess, the foundation skill of SPATIALCLAW spatial analysis. Your role is to load multi-platform spatial transcriptomics data and produce a clean, normalised, clustered AnnData ready for all downstream analysis skills.

Why This Exists

  • Without it: Users manually write 40+ lines of Scanpy preprocessing code with inconsistent defaults
  • With it: One command loads any spatial platform, runs QC, normalises, clusters, and produces a ready-to-analyse h5ad
  • Why SPATIALCLAW: Standardised preprocessing ensures reproducibility across all downstream skills

Workflow

  1. Calculate: Prepare raw counts and assess QC metrics.
  2. Execute: Run filtering, normalization, and feature selection.
  3. Assess: Perform PCA and variance evaluation.
  4. Generate: Save normalized matrices and compute default UMAP.
  5. Report: Synthesize report with processing metadata and summaries.

Core Capabilities

  1. Multi-platform loading: Visium (directory/H5/H5AD), Xenium (Zarr/H5), MERFISH, Slide-seq, seqFISH, generic H5AD
  2. QC filtering: Mitochondrial %, min/max genes thresholds, tissue-specific presets
  3. Normalization: Library-size normalization + log1p, raw counts preserved in layers['counts']
  4. HVG selection: highly variable gene detection on raw counts
  5. Embedding: PCA with data-driven component suggestion, neighbor graph, UMAP
  6. Clustering: Leiden community detection with optional multi-resolution exploration
  7. Tissue presets: Pre-configured QC thresholds for 10 tissue types

Tissue-Specific QC Presets

When --tissue is specified, QC thresholds are automatically applied. Explicit parameters override preset values.

Tissue max_mt_pct min_genes max_genes Notes
pbmc 5% 200 2500 Low MT in blood cells
brain 10% 200 6000 Neurons have many genes
heart 50% 200 5000 Cardiomyocytes are MT-rich
tumor 20% 200 5000 Heterogeneous tissue
liver 15% 200 4000 Hepatocytes are large
kidney 15% 200 4000 Tubular cells are MT-active
lung 15% 200 5000 Mixed cell types
gut 20% 200 5000 Epithelial turnover
skin 10% 200 4000 Keratinocyte-rich
muscle 30% 200 5000 High mitochondrial content

Read the full file on GitHub · 226 lines

Files

What ships with it

3 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. 1mo ago First seen · 226 lines · 49 tokens per session scan A 1fc652e18d86

Subscribe to this mod's changes

spatial-preprocessing is a skill published in the GitHub repository ShangBioLab/SpatialClaw (11 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 49 tokens to every session and 2,487 once invoked, about $0.0002 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-08-30.

Related

Other skills, from other repositories

spatial-preprocess

Load when running the foundational spatial transcriptomics QC + filtering + normalisation + HVG + PCA + neighbour-graph + Leiden pipeline on a Visium / Xenium / generic spatial AnnData. Skip when raw FASTQs need converting first (use spatial-raw-processing); tissue-domain detection on already-preprocessed data (use…

TianGzlab/OmicsClaw · 73 tokens

spatial-microenvironment-subset

Load when extracting a niche / microenvironment subset around a center cell-type by spatial radius from a labelled spatial AnnData, producing a smaller AnnData of centers + their within-radius neighbours. Skip when running global tissue-domain detection (use spatial-domains); cross-condition comparison (use…

TianGzlab/OmicsClaw · 66 tokens

sc-preprocessing

Load when normalising QC'd scRNA into a PCA-ready AnnData via scanpy / Seurat / SCTransform / Pearson residuals. Skip when QC thresholds are still undecided (use sc-qc); batch correction across samples (use sc-batch-integration).

TianGzlab/OmicsClaw · 58 tokens

scatac-preprocessing

Load when preprocessing a single-cell ATAC peak × cell AnnData via Signac-style TF-IDF + LSI + Leiden, producing a clustered UMAP-ready object. Skip when input is fragments; BAM (peak calling not implemented here); scRNA preprocessing (use sc-preprocessing).

TianGzlab/OmicsClaw · 63 tokens

spatial-raw-processing

Load when converting spatial transcriptomics raw FASTQ pairs through ST-Pipeline into a rawcounts.h5ad ready for spatial-preprocess. Skip when input is already a count-matrix AnnData (use spatial-preprocess); non-spatial bulk / scRNA FASTQ (use bulkrna-read-qc).

TianGzlab/OmicsClaw · 70 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