spatial-condition

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

A spatial transcriptomics analysis workflow that compares gene activity between experimental conditions, such as treated and untreated tissue, within each cell cluster. Spatial transcriptomics measures gene activity together with the locations of cells or tissue spots.

In plain words
What is it for?
Use it to find genes that differ between conditions in each spatial cluster and to produce summary tables and visualisation data.
Why use it?
It accounts for biological sample replicates when testing for differences, reducing misleading results from treating every spot as an independent experiment. A simpler spot-level test is also available when replicate information is missing.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-condition.svg)](https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-condition)
Your own site
<a href="https://agentmods.dev/skills/tiangzlab/omicsclaw/spatial-condition"><img src="https://agentmods.dev/badge/skills/tiangzlab/omicsclaw/spatial-condition.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,761 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.00083 $0.01761
Opus 5 $0.00042 $0.00881
Sonnet 5 $0.00017 $0.00352
Haiku 4.5 $0.00008 $0.00176

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

Security

Grade A, and why

spatial-condition 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 2 executable files (spatial_condition.py, tests/test_spatial_condition.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-condition/SKILL.md · 133 lines

How it starts

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

spatial-condition

When to use

The user has a preprocessed multi-sample spatial AnnData with obs[condition_key] (e.g. treatment/control), obs[sample_key] (biological replicate id), and a cluster column (default leiden), and wants per-cluster differential expression between conditions. Two backends:

  • pydeseq2 (default) — pseudobulk per (sample, cluster), PyDESeq2 NB/GLM. Requires raw counts in layers["counts"] (or adata.raw as fallback). Honours replicate structure correctly.
  • wilcoxon — spot-level Wilcoxon rank-sum (scanpy.tl.rank_genes_groups). Cheap fallback when no replicate structure exists, but ignores pseudoreplication.

For per-cluster DE within a single condition use spatial-de. For spatially variable genes use spatial-genes.

Inputs & Outputs

Inputs

  • File types: .h5ad
  • Requires a preprocessed AnnData (X normalised, PCA/neighbours present)
  • Expects obsm: spatial

Outputs

  • tables/cluster_de_metrics.csv
  • tables/condition_run_summary.csv
  • tables/condition_spatial_points.csv
  • tables/condition_umap_points.csv
  • tables/per_cluster_summary.csv
  • tables/pseudobulk_de.csv
  • tables/pseudobulk_volcano_points.csv
  • tables/sample_counts_by_condition.csv
  • tables/skipped_contrasts.csv
  • tables/top_de_genes.csv
  • figures/cluster_de_burden.png
  • figures/condition_de_barplot.png
  • figures/condition_effect_burden_spatial.png
  • figures/condition_effect_burden_umap.png
  • figures/condition_pvalue_distribution.png
  • figures/condition_spatial_context.png
  • figures/pseudobulk_volcano.png
  • figures/sample_counts_by_condition.png
  • figures/skipped_contrasts.png
  • processed.h5ad
  • report.md
  • result.json
  • Processed AnnData (saves_h5ad)

Flow

  1. Load AnnData (--input) or build a 12-sample demo (--demo).
  2. Validate obs[condition_key] + obs[sample_key] exist (_lib/condition.py:91-95 raises ValueError if missing); cast condition_key + cluster_key to Categorical (spatial_condition.py:84-86).
  3. For pydeseq2: aggregate raw counts per (sample, cluster) pseudobulk; require layers["counts"] or fall back to adata.raw.
  4. Per cluster: skip the contrast if either condition has < --min-samples-per-condition samples; log to tables/skipped_contrasts.csv.
  5. Fit DE model per surviving (cluster, contrast); apply --fdr-threshold + --log2fc-threshold.
  6. Compute UMAP / spatial summaries; render plots; save tables and processed.h5ad.

Read the full file on GitHub · 133 lines

Files

What ships with it

8 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. yesterday First seen · 133 lines · 83 tokens per session scan A 089735455fa1

Subscribe to this mod's changes

spatial-condition is a skill published in the GitHub repository TianGzlab/OmicsClaw (160 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 83 tokens to every session and 1,761 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-de

Differential expression analysis — find marker genes for clusters or compare two groups. Supports Wilcoxon rank-sum, t-test, and PyDESeq2 methods with publication-ready figures and CSV tables.

ShangBioLab/SpatialClaw · 44 tokens

spatial-condition-comparison

Experimental condition comparison using pseudobulk differential expression with proper multi-sample statistics.

ShangBioLab/SpatialClaw · 22 tokens

scanpy

Standard single-cell RNA-seq analysis pipeline. Use for QC, normalization, dimensionality reduction (PCA/UMAP/t-SNE), clustering, differential expression, and visualization. Best for exploratory scRNA-seq analysis with established workflows. For deep learning models use scvi-tools; for data format questions use…

synthetic-sciences/openscience · 68 tokens

cellxgene-census-query

Query CZ CELLxGENE Census (61M+ cells). Filter by cell type/tissue/disease, retrieve expression data, and integrate with scanpy/PyTorch for population-scale single-cell analysis. Use this skill when: (1) Querying single-cell expression data by cell type, tissue, or disease, (2) Exploring available single-cell datasets…

PharMolix/OpenBioMed · 105 tokens

single-cell-scrna-seq-analysis-scanpy

Complete single-cell RNA-seq analysis workflow built on Scanpy and AnnData. Use this skill when: (1) Loading diverse single-cell data formats (10X, h5ad, CSV), (2) Performing quality control and filtering, (3) Normalization, dimensionality reduction, and clustering, (4) Marker gene identification and cell type…

PharMolix/OpenBioMed · 85 tokens

single-cell-multi-omics-analysis-scvi

Probabilistic deep learning framework for single-cell multi-omics data analysis. Use this skill when: (1) Analyzing single-cell RNA-seq data with batch correction, (2) Integrating multi-modal data (CITE-seq, ATAC-seq, multi-omics), (3) Performing cell type annotation with scANVI, (4) Spatial transcriptomics…

PharMolix/OpenBioMed · 94 tokens