Tooluck logoTooluck
SKILL.md

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)

resources/skills/scvi-tools/SKILL.md

Apache-2.0Full file
1# scvi-tools — scVI / scANVI
2
3scvi-tools (Gayoso et al. 2022, github.com/scverse/scvi-tools, BSD-3-Clause)
4wraps a family
5of deep generative models for single-cell omics. The scRNA-seq core is **scVI**
6(unsupervised batch-corrected latent embedding) and **scANVI** (scVI + a
7classifier head for semi-supervised cell-type label transfer). Both expect
8**raw integer UMI counts** and emit a low-dimensional `X_scVI` / `X_scANVI`
9that drops into the scanpy neighbors → leiden → umap pipeline.
10
11## Setup (any agent, no API key)
12
13This is a **pure skill** — `kernel.py` is deterministic Python and _you_ (the
14base 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 once
17per session in a Python cell:
18
19```python
20exec(open("scvi-tools/kernel.py", encoding="utf-8").read()) # path to this skill's kernel.py
21```
22
23Nothing auto-loads it outside Claude Science. Then call the helpers directly.
24If a helper raises `NameError`, you haven't exec'd kernel.py.
25
26Dependencies: `pip install scvi-tools scanpy anndata`. Training needs a
27CUDA-capable GPU — see [Remote compute](#remote-compute-rent-a-gpu) to fall out
28to a rented GPU when you don't have one locally.
29
30## How to run
31
32### scVI — batch-corrected latent space
33
34`prepare_scvi_counts(adata)` checks and preserves existing `counts`. If absent,
35…

Excerpt shown under the repository's Apache-2.0 license.

More skills in open-science

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates