Agent skill

Spatial Register

by TianGzlab in TianGzlab/OmicsClaw

Load when aligning multiple spatial slices into a common coordinate frame on a multi-slice spatial AnnData via PASTE optimal transport or STalign image-aware registration.

MITAuto-check passedResearch & Science

Install Spatial Register

skills CLI
$ npx skills add TianGzlab/OmicsClaw --skill spatial-register -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install TianGzlab/OmicsClaw spatial-register --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/TianGzlab/OmicsClaw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/spatial/spatial-register .claude/skills/spatial-register && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
spatial-register
GitHub stars
161
Token cost
~1.7k tokens
SKILL.md length
532 words
Files
9 (incl. references)
Skills in repo
95
Repo updated
First seen
Licence
MIT

At a glance

Load when aligning multiple spatial slices into a common coordinate frame on a multi-slice spatial AnnData via PASTE optimal transport or STalign image-aware registration.

  • Works in 7 steps: Load AnnData (--input) or build a… → parser.error validates numeric flag… → Resolve --slice-key (auto-pick from… → …
  • Tasks that involve Bioinformatics
  • SKILL.md covers When to use, Inputs & Outputs, Flow and Gotchas, plus 2 more sections
  • Runs Python and R scripts from its folder; calls python

What it does

Spatial Register is an agent skill from TianGzlab/OmicsClaw. Load when aligning multiple spatial slices into a common coordinate frame on a multi-slice spatial AnnData via PASTE optimal transport or STalign image-aware registration. Skip when data is single-slice (no registration needed); cross-sample integration in the gene-expression space (use spatial-integrate).

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including reference files (for example `r_visualization/README.md`, `references/methodology.md` and `references/output_contract.md`).

It sits in Research & Science, covering Bioinformatics. It works with AnnData. The repository describes itself as: Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper. The licence is MIT.

When your agent uses it

  • Tasks that involve Bioinformatics

Example prompts

  • “/spatial-register”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Load AnnData (--input) or build a multi-slice demo via the bundled spatial-preprocess runner (chains across slices).
  2. parser.error validates numeric flag ranges (--paste-alpha ∈ [0, 1]; --stalign-niter/-image-size/-a > 0).
  3. Resolve --slice-key (auto-pick from slice / sample / library_id if unset); raise if < 2 slices.
  4. Pick a reference slice (largest by default) and align all others to it.
  5. For PASTE: compute pairwise transport plans using --paste-alpha (gene-vs-spatial weight); apply translations.
  6. For STalign: run iterative image-aware diffeomorphism with --stalign-niter iterations.
  7. Save processed.h5ad (registered coords in obsm["spatial_aligned"]; original obsm["spatial"] preserved unchanged), tables, figures…

What it can do on your machine

Read from SKILL.md and the folder at commit 6fbd79f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python and R), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Spatial Register loads about 1.7k tokens when it runs, and up to ~4.5k if it reads all its reference files. Until then it costs about 81 tokens; SKILL.md has 532 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from TianGzlab/OmicsClaw at commit 6fbd79f, republished under its MIT licence (© TianGzlab). 532 words, ~1,712 tokens.

Download SKILL.mdSave it as .claude/skills/spatial-register/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
spatial-register
description
Load when aligning multiple spatial slices into a common coordinate frame on a multi-slice spatial AnnData via PASTE optimal transport or STalign image-aware registration. Skip when data is single-slice (no registration needed); cross-sample integration in the gene-expression space (use spatial-integrate).
version
0.4.0
author
OmicsClaw
license
MIT
emoji
📐
tags
spatial, registration, alignment, paste, stalign, multi-slice
requires
anndata, matplotlib, numpy, pandas, paste-bio, POT, scanpy, scikit-learn, scipy, seaborn, STalign, torch

spatial-register

When to use

The user has a multi-slice spatial AnnData (slices stacked into one object with a --slice-key column) and wants the slices registered into a shared coordinate frame so a downstream analysis can use the common axes. Two methods:

  • paste (default) — PASTE optimal-transport alignment based on gene expression similarity + spatial proximity (--paste-alpha, --paste-dissimilarity). Requires paste-bio + pot (+ optional torch for GPU).
  • stalign — STalign image-aware diffeomorphic registration; best when histology images are available (--stalign-niter, --stalign-image-size, --stalign-a). Requires STalign + torch.

For expression-space batch correction across slices use spatial-integrate. For aligning a single slice to a reference atlas use the same skill with that atlas as the reference slice.

Inputs & Outputs

<!-- AUTO-GENERATED from skill.yaml (interface) — do not edit by hand. Regenerate: python scripts/generate_skill_md.py <skill_dir> -->

Inputs

  • Modalities: visium, xenium
  • File types: .h5ad
  • Requires a preprocessed AnnData (X normalised, PCA/neighbours present)

Outputs

  • tables/registration_disparities.csv
  • tables/registration_metrics.csv
  • tables/registration_points.csv
  • tables/registration_run_summary.csv
  • tables/registration_shift_by_slice.csv
  • tables/registration_summary.csv
  • figures/registration_disparities.png
  • figures/registration_shift_by_slice.png
  • figures/registration_shift_distribution.png
  • figures/registration_shift_map.png
  • figures/slices_after.png
  • figures/slices_before.png
  • processed.h5ad
  • report.md
  • result.json
  • Processed AnnData (saves_h5ad) — adds obsm: spatial_aligned, spatial, X_spatial

Flow

  1. Load AnnData (--input) or build a multi-slice demo via the bundled spatial-preprocess runner (chains across slices).
  2. parser.error validates numeric flag ranges (--paste-alpha ∈ [0, 1]; --stalign-niter/-image-size/-a > 0).
  3. Resolve --slice-key (auto-pick from slice / sample / library_id if unset); raise if < 2 slices.
  4. Pick a reference slice (largest by default) and align all others to it.
  5. For PASTE: compute pairwise transport plans using --paste-alpha (gene-vs-spatial weight); apply translations.
  6. For STalign: run iterative image-aware diffeomorphism with --stalign-niter iterations.
  7. Save processed.h5ad (registered coords in obsm["spatial_aligned"]; original obsm["spatial"] preserved unchanged), tables, figures, report.md, result.json.
Show full SKILL.md (289 more words)Show less

Gotchas

  • All input + parameter validation goes through parser.error (exit code 2). spatial_register.py:896 for missing --input; :898 for missing path; :901 for --paste-alpha out of [0, 1]; :903-907 for non-positive STalign params. Wrappers expecting ValueError need to catch exit-2 separately.
  • Slice-key validation raises ValueError post-argparse. spatial_register.py:913 raises ValueError(f"Slice key '<requested_key>' not found in adata.obs"); :915 raises ValueError(f"Slice key '<requested_key>' must contain at least 2 slices"). These fire after argparse, so they're real Python ValueErrors — different from the parser.error group above.
  • paste requires paste-bio + pot; stalign requires STalign + torch. spatial_register.py:827-829 lists the optional packages by method; the actual import sites raise ImportError if missing. The skill records what's installed in reproducibility/environment.txt.
  • Registered coordinates land in obsm["spatial_aligned"], NOT in obsm["spatial"]. The original obsm["spatial"] is preserved unchanged; the aligned coords are added as a separate key. Downstream tools that consume obsm["spatial"] will keep using the original coords unless they explicitly switch to obsm["spatial_aligned"]. The legacy duplicate obsm["X_spatial"] also exists (spatial_register.py:80/83) for back-compat.
  • Demo mode chains through spatial-preprocess first. spatial_register.py:988 raises FileNotFoundError(f"spatial-preprocess not found at {preprocess_script}") if the sibling skill is missing from the install; :1005 raises FileNotFoundError(f"Expected {processed}") when the demo preprocess output isn't where expected. Real runs skip this chain.
  • Disparity / shift metrics are best-effort. When paste-bio or STalign doesn't expose disparity scores, the metric columns in tables/registration_metrics.csv will be NaN — :178 documents the column initialisation. Quote the per-slice shifts (mean_shift, median_shift, max_shift) instead.

Key CLI

bash
# Demo (multi-slice synthetic; chains through spatial-preprocess)
python omicsclaw.py run spatial-register --demo --output /tmp/spatial_reg_demo

# PASTE alignment on a multi-slice Visium object
python omicsclaw.py run spatial-register \
  --input multi_slice.h5ad --output results/ \
  --slice-key library_id --method paste --paste-alpha 0.1

# STalign with strong image regularisation
python omicsclaw.py run spatial-register \
  --input multi_slice.h5ad --output results/ \
  --slice-key sample --method stalign \
  --stalign-niter 200 --stalign-image-size 256 --stalign-a 100

# PASTE on GPU
python omicsclaw.py run spatial-register \
  --input multi_slice.h5ad --output results/ \
  --method paste --paste-alpha 0.1 --paste-use-gpu

See also

  • references/parameters.md — every CLI flag, per-method tunables
  • references/methodology.md — when PASTE vs STalign wins; reference-slice heuristic
  • references/output_contract.md — obsm["spatial"] preserved + obsm["spatial_aligned"] registered coords + legacy obsm["X_spatial"]
  • Adjacent skills: spatial-raw-processing / spatial-preprocess (upstream — produce per-slice AnnData), spatial-integrate (parallel — corrects in expression space, NOT spatial coords), spatial-domains (downstream — domain detection works better on registered coords), spatial-condition (downstream — cross-condition comparison after alignment)

© TianGzlab, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files (references) in skills/spatial/spatial-register of TianGzlab/OmicsClaw.

  • SKILL.md
  • r_visualization/README.md
  • r_visualization/register_publication_template.R
  • references/methodology.md
  • references/output_contract.md
  • references/parameters.md
  • skill.yaml
  • spatial_register.py
  • tests/test_spatial_register.py

Open the folder on GitHubat commit 6fbd79f

Compare with similar skills

Spatial Register next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Spatial Register compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spatial Register this skillTianGzlab/OmicsClaw161—~1.7kAutomated safety check: PassMIT
Scanpy Single-Cell Analysisdavila7/claude-code-templates32k16 repos~2.8kAutomated safety check: PassMIT
ScgptJimLiu/science-skills2274 repos~1.3kAutomated safety check: PassApache-2.0
PyDESeq2 Differential Expressiondavila7/claude-code-templates32k12 repos~4kAutomated safety check: PassMIT
Anndatadavila7/claude-code-templates32k12 repos~2.5kAutomated safety check: PassMIT
Single-Cell Initial AnalysisLigphiDonk/Oh-my--paper7381 repos~1.4kAutomated safety check: PassMIT

Similar skills

  • Scanpy Single-Cell Analysis

    davila7/claude-code-templates

    Walks through single-cell RNA-seq analysis with Scanpy: loading .h5ad and 10X data, QC, normalization, PCA and UMAP, Leiden clustering, marker genes and cell type annotation.

    32k GitHub starsUsed in 16 repos~2.8k tokens
    Research & ScienceAuto-check passed
  • Scgpt

    JimLiu/science-skills

    Embed and annotate single-cell expression data with scGPT, a foundation model for single-cell biology.

    227 GitHub starsUsed in 4 repos~1.3k tokens
    Research & ScienceAuto-check passed
  • PyDESeq2 Differential Expression

    davila7/claude-code-templates

    Runs differential gene expression analysis on bulk RNA-seq counts with PyDESeq2: design formulas, Wald tests, FDR correction and volcano or MA plots.

    32k GitHub starsUsed in 12 repos~4k tokens
    Research & ScienceAuto-check passed
  • Anndata

    davila7/claude-code-templates

    This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling…

    32k GitHub starsUsed in 12 repos~2.5k tokens
    Research & ScienceAuto-check passed
  • Single-Cell Initial Analysis

    LigphiDonk/Oh-my--paper

    Runs a seven-step quality-control and exploration pipeline on scRNA-seq, CyTOF or flow cytometry data and writes a plain-language report of what it found.

    738 GitHub starsUsed in 1 repo~1.4k tokens
    Research & ScienceAuto-check passed
  • Single Cell Data Prep Qc

    harrisongzhang/TheVirtualBiotech

    Single-cell RNA-seq data preparation and quality control pipeline.

    118 GitHub stars~2.9k tokensUpdated 20 days ago
    Research & ScienceAuto-check passed

More from TianGzlab/OmicsClaw

All 95 skills in this repo
  • Bulkrna Batch Correction

    TianGzlab/OmicsClaw

    Load when removing batch effects from a multi-cohort bulk RNA-seq dataset using ComBat (R or Python implementation).

    161 GitHub stars~1.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Bulkrna Coexpression

    TianGzlab/OmicsClaw

    Load when discovering gene co-expression modules and hub genes in a bulk RNA-seq cohort via WGCNA-style soft-thresholded networks.

    161 GitHub stars~1.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Bulkrna De

    TianGzlab/OmicsClaw

    Load when comparing gene expression between two conditions in bulk RNA-seq count data.

    161 GitHub stars~976 tokensUpdated 2 mo ago
    Auto-check passed
  • Bulkrna Deconvolution

    TianGzlab/OmicsClaw

    Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or signature-matrix reference.

    161 GitHub stars~984 tokensUpdated 2 mo ago
    Auto-check passed
  • Bulkrna Enrichment

    TianGzlab/OmicsClaw

    Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list.

    161 GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Bulkrna Geneid Mapping

    TianGzlab/OmicsClaw

    Load when converting gene identifiers between Ensembl, Entrez, and HGNC symbol in a bulk RNA-seq count matrix.

    161 GitHub stars~1k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Spatial Register

What does Spatial Register do?

Load when aligning multiple spatial slices into a common coordinate frame on a multi-slice spatial AnnData via PASTE optimal transport or STalign image-aware registration. Spatial Register is an agent skill from TianGzlab/OmicsClaw. Load when aligning multiple spatial slices into a common coordinate frame on a multi-slice spatial AnnData via PASTE optimal transport or STalign image-aware registration.

When should I use Spatial Register?

Spatial Register fits situations like: tasks that involve Bioinformatics.

How do I install Spatial Register in Claude Code?

Run `npx skills add TianGzlab/OmicsClaw --skill spatial-register -a claude-code`. Or copy the skill folder (skills/spatial/spatial-register in TianGzlab/OmicsClaw) into .claude/skills/spatial-register in your project. Claude Code loads it when a task matches its description.

How do I install Spatial Register in Codex?

Run `npx skills add TianGzlab/OmicsClaw --skill spatial-register -a codex`. Or copy the skill folder (skills/spatial/spatial-register in TianGzlab/OmicsClaw) into .agents/skills/spatial-register in your project. Codex loads it when a task matches its description.

Can I use Spatial Register in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add TianGzlab/OmicsClaw --skill spatial-register -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spatial-register, .gemini/skills/spatial-register, .github/skills/spatial-register and .opencode/skills/spatial-register in your project.

What does Spatial Register need to run?

Going by SKILL.md and its folder, Spatial Register needs Python and R for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Spatial Register access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Spatial Register safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Spatial Register use?

Spatial Register is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spatial Register use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.8k tokens, read only when the agent opens those files.

What are the alternatives to Spatial Register?

Skills that share tags, products or a category with Spatial Register: Scanpy Single-Cell Analysis (davila7/claude-code-templates, 32k stars), Scgpt (JimLiu/science-skills, 227 stars), PyDESeq2 Differential Expression (davila7/claude-code-templates, 32k stars) and Anndata (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spatial Register?

TianGzlab (a GitHub organization) maintains it in TianGzlab/OmicsClaw, which has 161 GitHub stars. The repository holds 95 skills in this directory. The repository was last updated on July 28, 2026.

Source: TianGzlab/OmicsClaw on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.