spatial-patterns

spatial-patterns is a skill for Claude Code from cafferychen777/ChatSpatial. It costs 90 tokens per session (1,450 once invoked), scanned A, original, MIT.

An analysis of genes whose activity is organized by location in a tissue. It finds spatially variable genes and uses spatial statistics to measure patterns such as clustering, hot spots, and cold spots.

In plain words
What is it for?
Use it to find spatially variable genes, test spatial autocorrelation, identify expression hot spots, and study patterns across tissue coordinates.
Why use it?
It separates meaningful geographic patterns from expression that is distributed randomly. This helps reveal tissue regions and biological signals linked to local structure.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: agent in frontmatter; installed under .agents/ (shared by several agents).

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/cafferychen777/chatspatial/spatial-patterns
Any agent
npx skills add cafferychen777/ChatSpatial --skill spatial-patterns
Clone the repo
git clone --depth 1 https://github.com/cafferychen777/ChatSpatial

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/cafferychen777/chatspatial/spatial-patterns.svg)](https://agentmods.dev/skills/cafferychen777/chatspatial/spatial-patterns)
Your own site
<a href="https://agentmods.dev/skills/cafferychen777/chatspatial/spatial-patterns"><img src="https://agentmods.dev/badge/skills/cafferychen777/chatspatial/spatial-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,450 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.1 $0.00090 $0.01450
Opus 5 $0.00045 $0.00725
Sonnet 5 $0.00018 $0.00290
Haiku 4.5 $0.00009 $0.00145

Measured 6d ago against content hash f626ac332617, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

spatial-patterns 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 6d ago.

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.

.agents/skills/spatial-patterns/SKILL.md · 191 lines

How it starts

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

Spatial Pattern Analysis

Overview

This skill answers: Which genes/features show significant spatial organization in this tissue?

Two complementary analyses:

  1. Spatially Variable Genes (SVG): Find genes with non-random spatial expression
  2. Spatial Statistics: Quantify and test spatial patterns

Decision Tree: Which Analysis?

Q: What do you want to know?
│
├─ Which genes have spatial patterns?
│   └─ SVG Detection
│       ├─ SpatialDE - Gaussian Process, handles noise well
│       ├─ SPARK-X - Fast, scalable to large datasets
│       └─ Moran's I per gene - Classic, interpretable
│
├─ Are spatial patterns statistically significant?
│   └─ Spatial Statistics
│       ├─ Global Moran's I - Overall spatial autocorrelation
│       ├─ Getis-Ord Gi* - Local hot/cold spot detection
│       └─ Ripley's K/L - Point pattern analysis
│
└─ Where are the spatial hotspots?
    └─ Local Spatial Statistics
        ├─ LISA - Local Moran's I
        └─ Getis-Ord Gi* - Hot spot analysis

Spatially Variable Gene Detection

Method Selection

Method Speed Best For Output
SpatialDE Moderate Noise robustness p-values, effect sizes
SPARK-X Fast Large datasets (>50k spots) p-values, adjusted
Moran's I Fast Simple interpretation I statistic, p-value
Sepal Moderate Multi-scale patterns Scale-specific genes

Workflow

Step 1: Run SVG Detection

Use find_spatial_genes tool with:

  • method: "spatialDE", "sparkx", or "moran"
  • n_top_genes: Number of top genes to return (default 100)
Step 2: Interpret Results

Key output columns:

  • pval / padj: Statistical significance
  • moranI / effect_size: Strength of spatial pattern
  • gene: Gene identifier

Filtering criteria:

Recommended thresholds:
- Adjusted p-value < 0.05 (stringent: < 0.01)
- Effect size > 0.1 (moderate spatial pattern)
- Expression level: Filter very low-expressed genes

Read the full file on GitHub · 191 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. 6d ago First seen · 191 lines · 90 tokens per session scan A f626ac332617

Subscribe to this mod's changes

spatial-patterns is a skill published in the GitHub repository cafferychen777/ChatSpatial (44 stars, last pushed 21d ago), licensed MIT. It adds 90 tokens to every session and 1,450 once invoked, about $0.0005 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-08-30.

Related

Other skills, from other repositories

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

bulkrna-deconvolution

Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or signature-matrix reference. Skip when the data is already single-cell (no deconvolution needed); spatial deconvolution (use spatial-deconv).

TianGzlab/OmicsClaw · 54 tokens

bulkrna-trajblend

Load when placing bulk RNA-seq samples on a single-cell reference's pseudotime axis (NNLS deconvolution + nearest-neighbour mapping). Skip when plain cell-type proportions (use bulkrna-deconvolution); native single-cell trajectory inference (use sc-pseudotime).

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

Bulk RNAseq differential expression (DeSeq2)

Core DESeq2 workflow for RNA-seq differential expression analysis with count data.

TianGzlab/OmicsClaw · 10 tokens

Single-Cell RNA-seq Core Analysis (Seurat)

Complete workflow for single-cell RNA-seq analysis using Seurat v5. Process raw data through quality control, normalization, clustering, and cell type annotation with publication-ready visualizations.

TianGzlab/OmicsClaw · 12 tokens