AnnData
AnnData is a Python package for handling annotated data matrices, storing experimental measurements (X) alongside observation metadata (obs)…
Maintainer FreedomIntelligence · Last updated April 1, 2026
Deconvolution estimates cell type proportions in each spatial spot using a reference single-cell dataset. Essential for Visium data where spots contain multiple cells.
Original source
https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills/tree/main/skills/bio-spatial-transcriptomics-spatial-deconvolution
Skill Snapshot
Source Doc
Goal: Estimate cell type abundances per spatial spot using a probabilistic model trained on scRNA-seq reference signatures.
Approach: Train a regression model on reference scRNA-seq to extract cell type signatures, then decompose spatial spots using those signatures.
"Deconvolve my Visium spots into cell types" -> Train a reference signature model on scRNA-seq, then map cell type abundances to spatial locations using cell2location.
import cell2location
from cell2location.utils.filtering import filter_genes
from cell2location.models import RegressionModel
## Load reference scRNA-seq
adata_ref = sc.read_h5ad('reference_scrna.h5ad')
adata_ref.obs['cell_type'] = adata_ref.obs['cell_type'].astype('category')
## Load spatial data
adata_vis = sc.read_h5ad('spatial_data.h5ad')
Related skills
AnnData is a Python package for handling annotated data matrices, storing experimental measurements (X) alongside observation metadata (obs)…
Arboreto is a computational library for inferring gene regulatory networks (GRNs) from gene expression data using paralleli.
Cell segmentation from multiplexed tissue images. Covers deep learning (Cellpose, Mesmer) and classical approaches for nuclear and whole-cel…
Extract, process, and deduplicate reads using Unique Molecular Identifiers (UMIs) with umi_tools. Use when library prep includes UMIs and ac…