spatial-statistics

Analyze spatial statistics on multi-omics AnnData files with neighborhood enrichment and autocorrelation metrics.

155|26|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/TianGzlab/OmicsClaw --skill spatial-statistics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spatial-statistics
Source: https://github.com/TianGzlab/OmicsClaw/tree/main/skills/spatial/spatial-statistics
Command: npx skills add https://github.com/TianGzlab/OmicsClaw --skill spatial-statistics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires squidpy, scanpy, anndata, matplotlib, numpy, pandas, esda, libpysal, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates complex spatial statistics analysis, moving beyond manual command execution to provide structured insights into spatial patterns within omics data.

Core Features & Use Cases

  • Neighborhood Enrichment: Quantify how often cell types co-localize in spatial proximity.
  • Spatial Autocorrelation: Measure global and local patterns for genes (Moran's I, Getis-Ord Gi*).
  • Point Pattern Analysis: Analyze cluster distribution using Ripley's L function.
  • Use Case: Identify if immune cells are clustered around tumor cells in a spatial transcriptomics dataset, or if specific gene expressions form hot or cold spots within a tissue.

Quick Start

Calculate neighborhood enrichment for the annotated clusters in the provided AnnData file.

Frequently Asked Questions about spatial-statistics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate spatial autocorrelation for genes in omics data?

To calculate spatial autocorrelation for genes in omics data, you can compute global and local metrics like Moran's I, Geary's C, and Getis-Ord Gi* using a preprocessed AnnData file containing spatial coordinates.

Can I analyze cell co-localization using neighborhood enrichment in spatial transcriptomics?

You can analyze cell co-localization using neighborhood enrichment to quantify how often annotated cell types appear in spatial proximity within spatial transcriptomics datasets.

How do I perform point pattern analysis for cluster distribution using Ripley's L function?

Point pattern analysis evaluates cluster distribution by calculating Ripley's L function, which identifies whether spatial point patterns deviate from complete spatial randomness across varying distance scales.

Do I need preprocessed AnnData files with spatial coordinates for spatial statistics analysis?

Yes, spatial statistics analysis requires preprocessed AnnData files that include spatial coordinates to accurately compute neighborhood enrichment, spatial autocorrelation, and point pattern distributions.

What is the best way to identify gene expression hot spots within tissue sections?

The best way to identify gene expression hot spots within tissue sections is by calculating local spatial autocorrelation metrics such as Getis-Ord Gi* and Local Moran's I.

Does this spatial statistics approach work with squidpy and scanpy for omics analysis?

Yes, this spatial statistics approach works directly with squidpy and scanpy, utilizing anndata structures to perform comprehensive omics analysis and generate matplotlib visualizations.