bulkrna-batch-correcti…
Load when correcting batch effects in bulk expression using R sva ComBat or the legacy Python parametric approximation. Skip…
Load when assigning per-spot cell-type labels on a spatial AnnData via marker-gene scoring
$ npx -y skills add tiangzlab/omicsclaw --skill spatial-annotate --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/spatial-annotateContext preview
The summary Claude sees to decide when to auto-load this skill.
Load when assigning per-spot cell-type labels on a spatial AnnData via marker-gene scoring
name: spatial-annotate description: Load when assigning per-spot cell-type labels on a spatial AnnData via marker-gene scoring or scRNA-reference mapping (Tangram / scANVI / CellAssign). Skip when computing spot-level cell-type proportions for multi-cell-per-spot platforms (use spatial-deconv); tissue-domain detection (use spatial-domains). trigger: cell type annotation, annotate cell types, Tangram, scANVI, CellAssign, marker genes, label transfer, spatial annotation tags: - spatial - annotation - cell-type - marker-based - tangram - scanvi - cellassign
Assign discrete cell labels using marker overlap, Tangram, scANVI or CellAssign. Use spatial-deconv for proportions and spatial-domains for tissue regions.
from skills._sdk.notebook import load_skill, read_input, write_output
library = load_skill("spatial-annotate")
data = read_input("input.h5ad")
data = library.annotate(data, cluster_key="leiden")
write_output(library.cell_type_counts(data), "tables/results.csv")Run [examples/example_step.py](examples/example_step.py) through the step runner.
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
Annotate in place and return the same AnnData without file writes.
Marker and Tangram methods read log-normalized X. scANVI/CellAssign require raw counts in the requested layer (normally counts), raw, or explicitly selected X. Reference AnnData is copied before training.
:param adata: Spatial AnnData with normalized X and method-required labels/counts. :param method: CLI default marker_based; tangram, scanvi or cellassign are optional. :param reference: Labelled reference AnnData for Tangram/scANVI; None otherwise. :param species: Human by default or mouse for built-in marker dictionaries. :param marker_genes: Optional CellAssign marker mapping; None uses species markers. :param random_state: Training seed, 0 by default; change to assess sensitivity. :param parameters: Method keyword options in references/parameters.md. Defaults match the CLI, including cluster_key=leiden and n_marker_genes=50. :returns: The same AnnData with cell_type labels and JSON run diagnostics. :raises ValueError: Invalid method, species, missing reference or invalid counts. :raises TypeError: Unknown method parameter. :raises ImportError: Missing backend; use install_skill_deps for the named package.
Read annotation counts, method parameters and cluster-marker scores.
:param adata: AnnData returned by annotate. :param keep: True retains diagnostics; False removes them before CLI serialization. :returns: Diagnostic dict, or an empty dict before analysis.
Count cell labels and their percentages.
:param adata: AnnData with cell_type labels; expression values are not read. :returns: DataFrame with cell_type, n_cells and proportion (percent). :raises KeyError: Annotation labels are absent.
Plot discrete cell labels in spatial coordinates.
:param adata: Annotated spatial AnnData; reads coordinates and cell_type. :returns: A matplotlib Figure without saving it. :raises KeyError: Annotation labels are absent.
<!-- api:end -->
Marker/Tangram methods read normalized X. scANVI/CellAssign validate raw integer counts. Reference methods take reference=AnnData; marker_genes applies only to CellAssign. See [parameters](references/parameters.md) and [methodology](references/methodology.md).
The library returns AnnData, DataFrames or Figures without file writes. The CLI keeps reports, result.json, tables and conditional gallery outputs. See the complete [output contract](references/output_contract.md) for filenames and conditions.
python skills/spatial/spatial-annotate/spatial_annotate.py --input data.h5ad --output results/spatial-annotate
`anndata`, `matplotlib`, `numpy`, `pandas`, `scanpy`, `scipy`, `scvi-tools`, `seaborn`, `tangram-sc`, `torch`
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…