bio-spatial-transcriptomics-spatial-deconvolution
Estimate cell type composition in spatial transcriptomics spots using reference-based deconvolution. Use cell2location, RCTD, SPOTlight, or Tangram to infer cell type proportions from scRNA-seq references. Use when estimating cell type composition in spatial spots.
Profile →npx skills add majiayu000/claude-skill-registry --skill spatial-deconvolution-gptomics-bioskills-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Spatial Deconvolution Estimate cell type composition in spatial spots using scRNA-seq references. ## Required Imports ```python import scanpy as sc import anndata as ad import numpy as np import pandas as pd import matplotlib.pyplot as plt ``` ## Overview Deconvolution estimates cell type proportions in each spatial spot using a reference single-cell dataset. Essential for Visium data where spots contain multiple cells. ## Using cell2location ```python 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') # Find shared genes intersect = np.intersect1d(adata_vis.var_names, adata_ref.var_names) adata_ref = adata_ref[:, intersect].copy() adata_vis = adata_vis[:, intersect].copy() ``` ## Train Reference Signature Model ```python # Select genes for deconvolution selected = filter_genes(adata_ref, cell_count_cutoff=5, cell_percentage_cutoff2=0.03, nonz_mean_cutoff=1.12) adata_ref = adata_ref[:, selected
- Required Imports
- Overview
- Using cell2location
- Train Reference Signature Model
- Run Spatial Deconvolution
- Access Deconvolution Results
- Using Tangram (Alternative)
- Using RCTD (via R)
- Visualize Cell Type Proportions
- Pie Chart Per Spot (Advanced)
- Evaluate Deconvolution Quality
- Compare Deconvolution Methods
- Export Results
- Related Skills
What does the bio-spatial-transcriptomics-spatial-deconvolution skill do?
Estimate cell type composition in spatial transcriptomics spots using reference-based deconvolution. Use cell2location, RCTD, SPOTlight, or Tangram to infer cell type proportions from scRNA-seq references. Use when estimating cell type composition in spatial spots.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill spatial-deconvolution-gptomics-bioskills-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.