Deep generative models for single-cell omics: probabilistic batch correction (scVI), semi-supervised annotation (scANVI), CITE-seq RNA+protein (totalVI), transfer learning (scARCHES), and DE with uncertainty. Unified setup→train→extract API on AnnData. Use harmony-batch-correction for fast linear correction without deep learning; muon for multi-modal MuData workflows.
SkillScore95Maintained
Automatic
◆Research pack
Last verified 8/24/2026
What it changes
Passed 21 of 22 test cases with the skill, and 20 of 22 without it.
Without skill91%
With skill95%
Checks it passed that the model alone missed
Passes a boolean mask or cluster index list to idx1.
Specifies setting weight_decay to 0 in plan_kwargs during query training.
2 fixed19 passed either way0 still failing1 broke
Pass-rate lift
+5 pp
Tokens
+388%
Agent turns
0%
Response time
-35%
Model gemini-3.6-flashMeasured 8/24/2026v1 · latest is v221 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
This benchmark measured an earlier version of the skill.
See it in action
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 2
Prompt
I have 8 distinct cell clusters in `adata.obs["cell_type"]`. I want to run probabilistic differential expression for each cluster against all remaining cells ('one-vs-rest'). How is group indexing specified in `model.differential_expression()` when selecting a single cluster against the rest?
What was checked, without and with the skill
Checked
Without skill
With skill
Calls model.differential_expression with cell group selection.
Passed
Passed
Passes a boolean mask or cluster index list to idx1.
Missed
Passed
case-21 · gemini-3.6-flash · 8/24/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md653 linessingle file
scvi-tools — Single-Cell Deep Generative Models
Overview
scvi-tools is a probabilistic modeling framework for single-cell genomics built on PyTorch. It implements variational autoencoders (VAEs) that learn low-dimensional latent representations of cells while explicitly modeling batch effects, count noise distributions, and multi-modal data. All models share a unified API: setup_anndata() to register data, instantiate the model, train(), then extract latent representations, normalized expression, or differential expression results. Models operate on raw count data in AnnData format and return statistically grounded outputs with uncertainty estimates.
When to Use
Integrating multiple scRNA-seq batches or studies with probabilistic batch correction that preserves biological variation
Performing differential expression with uncertainty quantification and composite hypotheses (not just fold-change thresholding)
Annotating cell types via semi-supervised transfer learning from a partially-labeled reference (scANVI)
Jointly modeling CITE-seq protein and RNA data to obtain denoised protein estimates and joint embeddings (totalVI)
Adapting a pretrained model to a new query dataset without full retraining (scARCHES transfer learning)
Deconvolving spatial transcriptomics spots into cell type proportions using a matched scRNA-seq reference (DestVI)
Detecting doublets in scRNA-seq data as a QC preprocessing step (Solo)
Use harmony-batch-correction instead when you need fast linear batch correction (seconds vs minutes) without deep learning overhead
For multi-modal MuData workflows (joint RNA+ATAC Multiome, combined modality objects), use muon instead
For standard clustering and visualization without batch effects or probabilistic DE, use scanpy-scrna-seq
Prerequisites
Python packages: scvi-tools>=1.1, scanpy, anndata
Data requirements: AnnData (.h5ad) with raw counts — not log-normalized. Store counts in adata.layers["counts"] if adata.X has been normalized.
Hardware: CPU works for <50k cells; GPU (8GB+ VRAM) recommended for larger datasets. Training time: 5–30 minutes on GPU for 100k cells.
pip install scvi-tools scanpy
# GPU acceleration (recommended for >50k cells)
pip install "scvi-tools[cuda12]" # or scvi-tools[cuda11]
Pre-flight Interview
Settle these with the user before writing any analysis code.