spatial-condition

Perform pseudobulk differential expression analysis on spatial transcriptomics AnnData objects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires scanpy, scipy, pydeseq2, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of comparing experimental conditions in spatial transcriptomics data, preventing common pitfalls like pseudoreplication and ensuring robust statistical analysis.

Core Features & Use Cases

  • Pseudobulk Differential Expression: Performs proper multi-sample pseudobulk differential expression analysis.
  • Statistical Rigor: Utilizes DESeq2-style statistics or Wilcoxon rank-sum tests on pseudobulk values for accurate results.
  • Use Case: Analyze spatial transcriptomics data from healthy and diseased tissue samples to identify genes that are differentially expressed between the two conditions, specifically within different annotated regions of the tissue.

Quick Start

Compare the 'treatment' and 'control' conditions in your spatial data using the 'sample_id' column for sample identification.

Frequently Asked Questions about spatial-condition

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

FAQPage Schema
How do I perform differential expression analysis on spatial transcriptomics data across multiple samples?

To perform differential expression on spatial transcriptomics data, this Skill aggregates counts per sample and annotated region into pseudobulk values. It then applies DESeq2-style statistics or Wilcoxon testing with multiple hypothesis correction to compare experimental conditions reliably.

Why does pseudoreplication occur in spatial transcriptomics condition comparison and how can I avoid it?

Pseudoreplication occurs when spatial spots are treated as independent replicates. To avoid this, spatial transcriptomics condition comparison requires pseudobulk aggregation of counts per sample and region before applying statistical tests, ensuring robust multi-sample statistics.

Can I use pydeseq2 for advanced statistical modeling in spatial data differential expression?

Yes, spatial transcriptomics differential expression optionally supports pydeseq2 for advanced statistical modeling. The Skill leverages scanpy and scipy alongside pydeseq2 to apply DESeq2-style testing on pseudobulk values aggregated by sample and condition.

What AnnData metadata is required to compare experimental conditions in spatial transcriptomics data?

Comparing experimental conditions in spatial transcriptomics data requires AnnData objects containing condition and sample keys. These keys allow the pseudobulk aggregation and differential expression testing to properly group and compare samples across annotated tissue regions.

What is the best way to identify differentially expressed genes within specific annotated tissue regions between healthy and diseased samples?

The best way to identify differentially expressed genes within annotated regions is using pseudobulk differential expression. This Skill aggregates spatial transcriptomics counts per sample and region, then applies DESeq2-style testing to compare healthy and diseased conditions accurately.

Does DESeq2-style pseudobulk testing work with Wilcoxon rank-sum tests for spatial data?

Yes, pseudobulk differential expression testing for spatial data supports both DESeq2-style statistics and Wilcoxon rank-sum tests. The Skill applies multiple hypothesis correction to both methods, allowing robust condition comparison across aggregated sample counts.