Agent skill

Spatial Integrate

by TianGzlab in TianGzlab/OmicsClaw

Load when removing batch effects from multi-batch spatial AnnData with PCA using Harmony, BBKNN, or Scanorama.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Spatial Integrate

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

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

GitHub CLI
$ gh skill install TianGzlab/OmicsClaw spatial-integrate --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-integrate .claude/skills/spatial-integrate && 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-integrate
GitHub stars
161
Token cost
~1.3k tokens
SKILL.md length
464 words
Files
11 (incl. references)
Skills in repo
88
Repo updated
First seen
Licence
Apache-2.0

At a glance

Load when removing batch effects from multi-batch spatial AnnData with PCA using Harmony, BBKNN, or Scanorama.

  • AI & LLM Engineering work in your project
  • SKILL.md covers Use from a step, When to use, Inputs & Outputs and Key CLI, plus 3 more sections
  • Runs Python and R scripts from its folder; calls python

What it does

Spatial Integrate is an agent skill from TianGzlab/OmicsClaw. Load when removing batch effects from multi-batch spatial AnnData with PCA using Harmony, BBKNN, or Scanorama. Skip physical coordinate alignment (use spatial-register) and single-batch data (use spatial-domains).

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including reference files (for example `_api.py`, `examples/example_step.py` and `r_visualization/README.md`).

It sits in AI & LLM Engineering. It works with AnnData and UMAP. 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 Apache-2.0.

When your agent uses it

  • AI & LLM Engineering work in your project

Example prompts

  • “/spatial-integrate”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 90a3bec. 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 Integrate loads about 1.3k tokens when it runs, and up to ~4.5k if it reads all its reference files. Until then it costs about 58 tokens; SKILL.md has 464 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
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 90a3bec, republished under its Apache-2.0 licence (© TianGzlab). 464 words, ~1,277 tokens.

Download SKILL.mdSave it as .claude/skills/spatial-integrate/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
spatial-integrate
description
Load when removing batch effects from multi-batch spatial AnnData with PCA using Harmony, BBKNN, or Scanorama. Skip physical coordinate alignment (use spatial-register) and single-batch data (use spatial-domains).
trigger
multi-sample integration, batch correction, Harmony, BBKNN, Scanorama
tags
spatial, integration, batch-correction

spatial-integrate

Use from a step

python
from skills._sdk.notebook import load_skill, read_input, write_output
library = load_skill("spatial-integrate")
adata = read_input("data/multi_sample.h5ad")
adata = library.integrate(adata, batch_key="sample")
write_output(adata, "intermediate/integrated.h5ad")

When to use

Correct expression-space batch effects after spatial-preprocess. Harmony and Scanorama add corrected PCA-based embeddings; BBKNN replaces the neighbor graph. None aligns tissue coordinates or changes the expression matrix.

Inputs & Outputs

Input: preprocessed AnnData with obsm["X_pca"] and at least two labels in obs["batch"] (or the chosen batch_key). Functions return AnnData, tables and figures without writing files; see API below.

CLI writes processed.h5ad, report.md, result.json, batch-size and integration tables, and the comparison gallery. The complete file inventory and generation conditions are in references/output_contract.md. Harmony adds X_pca_harmony; Scanorama adds X_scanorama; BBKNN changes obsp["distances"] and obsp["connectivities"].

Key CLI

bash
python skills/spatial/spatial-integrate/spatial_integrate.py \
  --input multi_sample.h5ad --output results/integration --method harmony --batch-key sample
python skills/spatial/spatial-integrate/spatial_integrate.py --demo --output /tmp/spatial_integrate

Use examples/example_step.py for load_skill, saved objects and replay. references/parameters.md lists the CLI method flags.

Gotchas

  • X_pca must exist before integration; no normalization is performed here.
  • X_scanorama is a corrected PCA-based embedding, not corrected gene expression.
  • batch_entropy_after measures local mixing, not biological preservation; inspect condition and cell-type structure before choosing a correction.
  • The function's seed controls Harmony, neighbors, UMAP and Leiden. BBKNN's default Annoy matching and Scanorama's wrapper expose no seed here; cross-version matching can vary. The installed versions passed repeat CLI checks.
  • run_info(adata, keep=False) removes only library diagnostics. The CLI keeps its existing uns["spatial_integration"] summary.
  • X_umap_before_integration and X_umap_after_integration preserve both views.

API

<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
integrate(adata, *, method: str='harmony', batch_key: str='batch', random_state: int=0, **parameters)

Integrate a multi-batch PCA representation in place, preserving expression.

:param adata: Preprocessed AnnData with X_pca and batch labels. :param method: harmony (default), bbknn (graph only), or scanorama. :param batch_key: Batch column in obs, default batch. :param random_state: Seed for Harmony, neighbors, UMAP and Leiden, default 0. BBKNN's default Annoy backend and Scanorama expose no seed here; their matching can vary across backend versions. :param parameters: Method keywords with original CLI defaults: Harmony theta=2, lamb=1, max_iter_harmony=10; BBKNN neighbors_within_batch=3, n_pcs=50, trim=None; Scanorama knn=20, sigma=15, alpha=0.1, batch_size=5000. :returns: The same AnnData with corrected embedding or graph, UMAP snapshots, per-spot batch entropy, and JSON run diagnostics. X is unchanged. :raises ValueError: Unknown method, missing batches/PCA, or invalid parameters. :raises ImportError: Missing backend; use install_skill_deps for that method.

Show full SKILL.md (131 more words)Show less
run_info(adata, *, keep: bool=True) -> dict

Read the last integration summary.

:param adata: AnnData returned by integrate. :param keep: True retains diagnostics; False removes them for CLI serialization. :returns: Summary including seed and effective method parameters, or an empty dict.

mixing_table(adata) -> pd.DataFrame

Return per-spot entropy before and after correction.

:param adata: Integrated AnnData. :returns: observation, batch_entropy_before, batch_entropy_after and batch_entropy_delta. :raises KeyError: Integration entropy columns are absent.

embedding_figure(adata, *, batch_key: str='batch')

Compare the pre- and post-integration UMAP coordinates.

:param adata: Integrated AnnData with both UMAP snapshots. :param batch_key: Batch labels used for color, default batch. :returns: A matplotlib Figure; the caller saves and closes it. :raises KeyError: Batch labels or UMAP snapshots are absent.

<!-- api:end -->

Dependencies

anndata, bbknn, harmonypy, matplotlib, numpy, pandas, scanorama, scanpy, scipy, seaborn

Missing method packages raise ImportError with an install_skill_deps hint.

© TianGzlab, Apache-2.0. 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 10 other files (references) in skills/spatial/spatial-integrate of TianGzlab/OmicsClaw.

  • SKILL.md
  • _api.py
  • examples/example_step.py
  • r_visualization/README.md
  • r_visualization/integration_publication_template.R
  • references/methodology.md
  • references/output_contract.md
  • references/parameters.md
  • spatial_integrate.py
  • tests/test_api.py
  • tests/test_spatial_integrate.py

Open the folder on GitHubat commit 90a3bec

Compare with similar skills

Spatial Integrate 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 Integrate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spatial Integrate this skillTianGzlab/OmicsClaw161—~1.3kAutomated safety check: PassApache-2.0
Alphagenome Predictionsgenomicsxai/alphagenome-pytorch162—~868Automated safety check: PassApache-2.0
ScanpyK-Dense-AI/scientific-agent-skills48k1 repos~5.1kAutomated safety check: PassBSD-3-Clause
Umap LearnK-Dense-AI/scientific-agent-skills48k1 repos~5.4kAutomated safety check: PassBSD-3-Clause
Bio Flow Cytometry Clustering PhenotypingGPTomics/bioSkills1.2k1 repos~2.3kAutomated safety check: PassMIT
Bio Tcr Bcr Analysis Scirpy AnalysisGPTomics/bioSkills1.2k1 repos~4.4kAutomated safety check: PassMIT

Similar skills

  • Alphagenome Predictions

    genomicsxai/alphagenome-pytorch

    Run AlphaGenome-PyTorch to get genomic track predictions — via the agt predict CLI (single locus, BED regions, whole chromosomes, raw FASTA sequences, or per-gene count tables/AnnData), variant…

    162 GitHub stars~868 tokensUpdated 22 days ago
    AI & LLM EngineeringAuto-check passed
  • Scanpy

    K-Dense-AI/scientific-agent-skills

    Performs Scanpy single-cell RNA-seq QC, normalization, HVG selection, PCA/UMAP/t-SNE, clustering, exploratory marker ranking, pseudobulk preparation, visualization, and Seurat or…

    48k GitHub starsUsed in 1 repo~5.1k tokens
    Research & ScienceAuto-check passed
  • Umap Learn

    K-Dense-AI/scientific-agent-skills

    Applies UMAP-learn to nonlinear dimensionality reduction, 2D/3D embeddings, clustering preprocessing, supervised or semi-supervised UMAP, DensMAP, AlignedUMAP, and Parametric UMAP workflows.

    48k GitHub starsUsed in 1 repo~5.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Unsupervised clustering and cell-type identification for high-dimensional flow, spectral, and mass cytometry - FlowSOM, PhenoGraph, FlowSOM-via-CATALYST, with UMAP/tSNE for visualization.

    1.2k GitHub starsUsed in 1 repo~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Integrates single-cell paired TCR/BCR (10x VDJ, AIRR, dandelion, BD Rhapsody) with gene expression in an AnnData/MuData object using scirpy - chain-pairing QC, clonotype definition, clonal…

    1.2k GitHub starsUsed in 1 repo~4.4k tokens
    Research & ScienceAuto-check passed
  • Scanpy

    aipoch/medical-research-skills

    Standard single-cell RNA-seq analysis pipeline. An agent skill from aipoch/medical-research-skills.

    2k GitHub stars~3.9k tokensUpdated 21 days ago
    Research & ScienceAuto-check passed

More from TianGzlab/OmicsClaw

All 88 skills in this repo
  • Bulkrna De

    TianGzlab/OmicsClaw

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

    161 GitHub starsUsed in 1 repo~867 tokens
    Auto-check passed
  • Bulkrna Cosinor Rhythm

    TianGzlab/OmicsClaw

    Load when the user needs Deterministic fixed-period 24-hour single-component cosinor OLS rhythm analysis for a bulk RNA time-course CSV.

    161 GitHub stars~840 tokensUpdated today
    Auto-check passed
  • Bulkrna Qc

    TianGzlab/OmicsClaw

    Load when checking a bulk RNA-seq count matrix for library-size outliers, gene detection rates, and sample-sample correlation before DE.

    161 GitHub starsUsed in 1 repo~789 tokens
    Auto-check passed
  • Sc Fastq Qc

    TianGzlab/OmicsClaw

    Load when checking raw single-cell FASTQ read quality (Phred / GC / adapter / length) before counting.

    161 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Sc Filter

    TianGzlab/OmicsClaw

    Load when removing low-quality cells and lowly-detected genes from a single-cell AnnData using QC-derived thresholds or tissue presets.

    161 GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Sc Markers

    TianGzlab/OmicsClaw

    Load when ranking cluster-level marker genes from a clustered single-cell AnnData via Scanpy Wilcoxon / t-test / logreg or COSG specificity.

    161 GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Works with

Questions about Spatial Integrate

What does Spatial Integrate do?

Load when removing batch effects from multi-batch spatial AnnData with PCA using Harmony, BBKNN, or Scanorama. Spatial Integrate is an agent skill from TianGzlab/OmicsClaw. Load when removing batch effects from multi-batch spatial AnnData with PCA using Harmony, BBKNN, or Scanorama.

When should I use Spatial Integrate?

Spatial Integrate fits situations like: AI & LLM Engineering work in your project.

How do I install Spatial Integrate in Claude Code?

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

How do I install Spatial Integrate in Codex?

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

Can I use Spatial Integrate 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-integrate -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-integrate, .gemini/skills/spatial-integrate, .github/skills/spatial-integrate and .opencode/skills/spatial-integrate in your project.

What does Spatial Integrate need to run?

Going by SKILL.md and its folder, Spatial Integrate 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 Integrate 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 Integrate 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 Integrate use?

Spatial Integrate is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spatial Integrate use?

About 1.3k tokens (SKILL.md is roughly 5.1k 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 3.2k tokens, read only when the agent opens those files.

What are the alternatives to Spatial Integrate?

Skills that share tags, products or a category with Spatial Integrate: Alphagenome Predictions (genomicsxai/alphagenome-pytorch, 162 stars), Scanpy (K-Dense-AI/scientific-agent-skills, 48k stars), Umap Learn (K-Dense-AI/scientific-agent-skills, 48k stars) and Bio Flow Cytometry Clustering Phenotyping (GPTomics/bioSkills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spatial Integrate?

TianGzlab (a GitHub organization) maintains it in TianGzlab/OmicsClaw, which has 161 GitHub stars. The repository holds 88 skills in this directory. The repository was last updated on October 7, 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.