scvi-tools
Agent skill fromaipoch/open-science
Probabilistic single-cell RNA-seq with scvi-tools — scVI for a batch-corrected latent space, scANVI for semi-supervised label transfer, and Bayesian differential expression. Reach for this skill to integrate scRNA-seq batches, embed cells for clustering, transfer annotations from a reference onto a query, or score differentially expressed genes per cluster. For spatial deconvolution / mapping use the cell2location, DestVI, or Tangram methods instead.
How to install scvi-tools
install scvi-tools
# install the open-science pack with the skills CLI
npx skills add aipoch/open-science# or add only this skill to Claude Code: copy the folder
resources/skills/scvi-tools/
# into
~/.claude/skills/scvi-tools/ (all projects)
.claude/skills/scvi-tools/ (one project)
1# scvi-tools — scVI / scANVI23scvi-tools (Gayoso et al. 2022, github.com/scverse/scvi-tools, BSD-3-Clause)4wraps a family5of deep generative models for single-cell omics. The scRNA-seq core is **scVI**6(unsupervised batch-corrected latent embedding) and **scANVI** (scVI + a7classifier head for semi-supervised cell-type label transfer). Both expect8**raw integer UMI counts** and emit a low-dimensional `X_scVI` / `X_scANVI`9that drops into the scanpy neighbors → leiden → umap pipeline.1011## Setup (any agent, no API key)1213This is a **pure skill** — `kernel.py` is deterministic Python and _you_ (the14base model) do all the reasoning. There is no `host` runtime and no LLM API.15The helpers are `prepare_scvi_counts` for input validation and `h5ad_safe_obs`16for obs/var frames that `anndata.write_h5ad()` can serialize. Load them once17per session in a Python cell:1819```python20exec(open("scvi-tools/kernel.py", encoding="utf-8").read()) # path to this skill's kernel.py21```2223Nothing auto-loads it outside Claude Science. Then call the helpers directly.24If a helper raises `NameError`, you haven't exec'd kernel.py.2526Dependencies: `pip install scvi-tools scanpy anndata`. Training needs a27CUDA-capable GPU — see [Remote compute](#remote-compute-rent-a-gpu) to fall out28to a rented GPU when you don't have one locally.2930## How to run3132### scVI — batch-corrected latent space3334`prepare_scvi_counts(adata)` checks and preserves existing `counts`. If absent,35…
Excerpt shown under the repository's Apache-2.0 license.
