bulkrna-batch-correcti…
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when deconvolving spot-level cell-type proportions on a Visium-style spatial AnnData
$ npx -y skills add tiangzlab/omicsclaw --skill spatial-deconv --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/spatial-deconvContext preview
The summary Claude sees to decide when to auto-load this skill.
Load when deconvolving spot-level cell-type proportions on a Visium-style spatial AnnData
name: spatial-deconv description: Load when deconvolving spot-level cell-type proportions on a Visium-style spatial AnnData using a labelled scRNA reference (FlashDeconv / Cell2location / RCTD / DestVI / Tangram / others). Skip when each spot is a single cell already (Xenium / MERFISH) (use spatial-annotate); tissue-domain detection (use spatial-domains). trigger: cell type deconvolution, spatial deconvolution, cell proportion, cell type proportion, cell2location, RCTD, DestVI, Stereoscope, Tangram, SPOTlight, CARD tags: - spatial - deconvolution - cell2location - rctd - destvi - stereoscope - tangram - spotlight - card - flashdeconv
Estimate cell-type proportions for spatial spots using a labelled single-cell reference. Use spatial-annotate for discrete labels and spatial-domains for tissue regions. Every method requires a reference; the CLI default is cell2location.
from skills._sdk.notebook import load_skill, read_input, write_output
spatial = read_input("spatial.h5ad")
reference = read_input("reference.h5ad")
library = load_skill("spatial-deconv")
library.deconvolve(spatial, reference=reference, method="flashdeconv", random_state=0)
write_output(library.proportions(spatial), "tables/proportions.csv")[examples/example_step.py](examples/example_step.py) uses an explicit synthetic reference and verifies known stripe identities; it is not a real-tissue benchmark. It sets lambda_spatial=10 for the small grid; the CLI default remains 5000.
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
Estimate proportions in place and return the same spatial AnnData.
Count models read layers['counts'], raw or X in that order. FlashDeconv, Tangram and SPOTlight read nonnegative X. Reference data are copied. RCTD, SPOTlight and CARD retain their temporary R bridges; their wrappers do not expose a seed and results vary between runs.
:param adata: Spatial AnnData; input expression is retained. :param reference: Required labelled reference AnnData; load it with read_input. :param method: CLI default cell2location; flashdeconv, rctd, destvi, stereoscope, tangram, spotlight and card are also supported. :param cell_type_key: Reference label column, CLI default cell_type. :param random_state: Seed for FlashDeconv/Tangram and scvi training, default 0. :param parameters: Method options in references/parameters.md, with CLI prefixes removed; omitted options keep their CLI defaults. :returns: The same AnnData with deconvolution_<method>, labels and JSON diagnostics. :raises ValueError: Invalid method, expression, reference labels or backend proportions. :raises TypeError: Reference is not AnnData or a method option is unknown. :raises ImportError: A backend is missing; use install_skill_deps for its named package.
Read method settings, reference overlap and result diagnostics.
:param adata: AnnData returned by deconvolve. :param keep: True retains diagnostics; False removes them before CLI serialization. :returns: Diagnostic dict with matrix_sources, seed (None for R wrappers) and optional CARD refinement tables.
Return stored proportions with observation and cell-type identifiers.
:param adata: AnnData returned by deconvolve; expression values are not read. :param method: None infers a sole stored method; specify it after multiple analyses. :returns: A DataFrame indexed by observation, with one column per reference label. :raises ValueError: No unique method can be inferred or label metadata are missing.
Plot mean proportions per reference cell type.
:param adata: AnnData returned by deconvolve; reads the stored proportion matrix. :param method: None infers a sole method; specify it for multiple results. :returns: A matplotlib Figure without writing files. :raises ValueError: No unique stored method is available.
<!-- api:end -->
FlashDeconv, cell2location, RCTD, DestVI, Stereoscope, Tangram, SPOTlight and CARD remain available. Python method options omit CLI prefixes; see [parameters](references/parameters.md) and [matrix conventions](references/methodology.md). The default cell2location budget is 30,000 epochs; select a method explicitly for a quick exploratory run.
Functions return AnnData, DataFrames and Figures. CLI output includes processed.h5ad, tables/proportions.csv, reports and conditional gallery files. See the complete [output contract](references/output_contract.md).
python skills/spatial/spatial-deconv/spatial_deconv.py --input spatial.h5ad --reference reference.h5ad --method flashdeconv --output results/deconv
`anndata`, `cell2location`, `flashdeconv`, `matplotlib`, `numpy`, `pandas`, `scanpy`, `scipy`, `scvi-tools`, `seaborn`, `tangram-sc`, `torch`
R backends need Rscript and spacexr (RCTD), SPOTlight or CARD.
Conversational & memory-enabled AI research partner for multi-omics analysis. CLI + Desktop App (installers in Releases). From biological idea to full research paper.
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when discovering bulk gene co-expression modules and hub genes with R WGCNA. Skip direct expression contrasts (use…
Load when comparing gene expression between two conditions in bulk RNA-seq count data. Skip
Load when estimating cell-type proportions in bulk RNA-seq samples from a single-cell or
Load when running pathway / GO term enrichment on a bulk RNA-seq DE result list. Skip when
Load when converting Ensembl, Entrez or symbol IDs in a bulk RNA count matrix using an explicit mapping or a small human demo…