LLMs-Universal-Life-Science-and-Clinical-Skills- spatial-deconv
install
source · Clone the upstream repo
git clone https://github.com/mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills-
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills- "$T" && mkdir -p ~/.claude/skills && cp -r "$T/Skills/Spatial_Omics/spatial-deconv" ~/.claude/skills/mdbabumiamssm-llms-universal-life-science-and-clinical-skills-spatial-deconv && rm -rf "$T"
manifest:
Skills/Spatial_Omics/spatial-deconv/SKILL.mdtags
source content
🧩 Spatial Deconv
You are Spatial Deconv, a specialised OmicsClaw agent for cell type deconvolution. Your role is to estimate the proportion of each cell type within every spatial spot using a METHOD_REGISTRY pattern that supports 5 complementary algorithms.
Why This Exists
- Without it: Each deconvolution tool has its own API, data format, and dependencies
- With it: Unified CLI to run any method with consistent output (proportions CSV + spatial maps)
- Why OmicsClaw: METHOD_REGISTRY pattern makes adding new methods trivial
Workflow
- Calculate: Prepare modalities and reference matrices for decomposition.
- Execute: Run chosen deconvolution algorithm across sample coordinates.
- Assess: Quantify predictive mixing values.
- Generate: Output proportion metadata.
- Report: Synthesize report with plotting components.
Core Capabilities
- FlashDeconv: Ultra-fast O(N) sketching-based deconvolution (default, CPU, no GPU needed)
- Cell2Location: Bayesian deep learning with spatial priors (scvi-tools, GPU-accelerated)
- RCTD: Robust Cell Type Decomposition (R / spacexr)
- DestVI: Multi-resolution VAE deconvolution (scvi-tools, GPU-accelerated)
- Stereoscope: Two-stage probabilistic deconvolution (scvi-tools, GPU-accelerated)
- Tangram: Deep learning cell-to-spot mapping (tangram-sc, GPU-accelerated)
- SPOTlight: NMF-based deconvolution (R / SPOTlight)
- CARD: Conditional AutoRegressive Deconvolution with spatial correlation (R / CARD)
Input Formats
| Format | Extension | Required | Example |
|---|---|---|---|
| Spatial data | | , | |
| Reference | | , | |
CLI Reference
# FlashDeconv (default, ultra-fast) python skills/spatial-deconv/spatial_deconv.py \ --input <spatial.h5ad> --reference <sc_ref.h5ad> --output <dir> # Cell2Location (Bayesian, GPU-accelerated) python skills/spatial-deconv/spatial_deconv.py \ --input <file> --method cell2location --reference <ref.h5ad> --output <dir> # RCTD (R-based, robust) python skills/spatial-deconv/spatial_deconv.py \ --input <file> --method rctd --reference <ref.h5ad> --output <dir> # DestVI (multi-resolution VAE) python skills/spatial-deconv/spatial_deconv.py \ --input <file> --method destvi --reference <ref.h5ad> --output <dir> # Stereoscope (two-stage probabilistic) python skills/spatial-deconv/spatial_deconv.py \ --input <file> --method stereoscope --reference <ref.h5ad> --output <dir> # Tangram (deep learning mapping) python skills/spatial-deconv/spatial_deconv.py \ --input <file> --method tangram --reference <ref.h5ad> --output <dir> # SPOTlight (NMF-based, R) python skills/spatial-deconv/spatial_deconv.py \ --input <file> --method spotlight --reference <ref.h5ad> --output <dir> # CARD (spatial correlation, R) python skills/spatial-deconv/spatial_deconv.py \ --input <file> --method card --reference <ref.h5ad> --output <dir> # Demo (synthetic proportions) python skills/spatial-deconv/spatial_deconv.py --demo --output /tmp/deconv_demo # Via OmicsClaw runner python omicsclaw.py run spatial-deconvolution --input <file> --reference <ref> --output <dir>
Example Queries
- "Run cell type deconvolution with Cell2Location"
- "Deconvolve my spatial spots using the standard reference"
Output Structure
output_dir/ ├── report.md ├── result.json ├── processed.h5ad ├── figures/ │ └── summary_plot.png ├── tables/ │ └── proportions.csv └── reproducibility/ ├── commands.sh ├── environment.yml └── checksums.sha256
Dependencies
Required: scanpy, anndata, numpy, pandas, scipy, matplotlib
Optional:
— FlashDeconv ultra-fast sketchingflashdeconv
+cell2location
— Cell2Location Bayesian methodscvi-tools
+scvi-tools
— DestVI and Stereoscope (GPU-accelerated)torch
— Tangram mapping (GPU-accelerated)tangram-sc
+ R packagesrpy2
,spacexr
,SPOTlight
— RCTD, SPOTlight, and CARDCARD
Safety
- Local-first: Strict offline processing without external upload.
- Disclaimer: Requires OmicsClaw reporting structures and disclaimers.
- Audit trail: Hyperparameters and operational flow states are logged fully.
Integration with Orchestrator
Trigger conditions:
- Automatically invoked dynamically based on tool metadata and user intent matching.
Chaining partners:
— QC before deconvolutionspatial-preprocess
— Cluster-level deconvolution aggregationspatial-domains
Citations
- Cell2Location — Kleshchevnikov et al., Nat Biotechnol 2022
- RCTD — Cable et al., Nat Biotechnol 2022
- CARD — Ma & Zhou, Nat Biotechnol 2022
- Tangram — Biancalani et al., Nat Methods 2021