Skip to content
Back to skills

Scvi Tools

ASecurity

"Use scvi-tools for probabilistic single-cell omics analysis with

  • 247 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 9, 2026
developmentpythonbashexpressapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill scvi-tools --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Scvi Tools?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Scvi Tools
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-scvi-tools/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-scvi-tools)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: scvi-tools
description: "Use scvi-tools for probabilistic single-cell omics analysis with
  AnnData/MuData setup, model selection, training, downstream analysis,
  save/load, Hub workflows, and advanced extension/autotune tasks."
disable-model-invocation: true
metadata:
  disco-role: operating
license: BSD 3-Clause
---

# scvi-tools

Use this skill when working with `scvi-tools`, the PyTorch/AnnData-based package for probabilistic analysis of single-cell RNA, protein, ATAC, spatial, methylation, perturbation, velocity, and related omics data.

Use the bundled sub-skills for workflow depth. Keep the root as a router: read only the sub-skill and references needed for the user request.

## First Checks

For a new environment or bug report, verify the install before choosing a workflow:

```bash
python - <<'PY'
import scvi, torch, anndata
print('scvi-tools', scvi.__version__)
print('torch', torch.__version__, 'cuda', torch.cuda.is_available())
print('anndata', anndata.__version__)
PY
```

Or run the bundled diagnostic:

```bash
python scripts/check_scvi_environment.py --json
```

`scvi-tools` requires Python 3.12+ in this checkout. GPU acceleration is optional for most APIs; CPU works for inspection and small examples, while real training may require CUDA/MPS/accelerator-specific PyTorch installations.

## Route by Task

- Preparing input data, `AnnData`/`MuData`, layers, `.obs`, `.obsm`, `.varm`, registries, readers, or `setup_anndata`: use `sub-skills/data-setup/`.
- Choosing and instantiating built-in models such as `SCVI`, `SCANVI`, `TOTALVI`, `PEAKVI`, `MULTIVI`, `AUTOZI`, `LinearSCVI`, `CondSCVI`, `DestVI`, `AmortizedLDA`, or `mlxSCVI`: use `sub-skills/core-models/`.
- Label transfer, semi-supervised annotation, query/reference mapping, doublet detection, or marker-based assignment with `SCANVI`, `SOLO`, or `CellAssign`: use `sub-skills/annotation-and-query/`.
- Multimodal, spatial, ATAC, methylation, velocity, perturbation, contrastive, deconvolution, and external specialized model families: use `sub-skills/multimodal-and-spatial/`.
- Training arguments, `Trainer` behavior, accelerator/device choices, callbacks, validation splits, dataloaders, custom datamodules, or inference dataloaders: use `sub-skills/training-and-inference/`.
- Post-training outputs such as latent representations, normalized expression/protein/accessibility, imputation, differential expression/abundance/accessibility/methylation, posterior predictive checks, criticism, or simulation: use `sub-skills/downstream-analysis/`.
- Saving/loading, model directories, minified data, registry compatibility, version migration, or Hugging Face Hub metadata/publish/load flows: use `sub-skills/model-io-and-hub/`.
- Hyperparameter tuning, Ray/HyperOpt, MLflow, optional extras, developer extension APIs, custom modules, Pyro/module internals, distributions, or neural-network building blocks: use `sub-skills/advanced-operations/`.

## Common End-to-End Pattern

```python
import scvi

scvi.model.SCVI.setup_anndata(adata, layer='counts', batch_key='batch')
model = scvi.model.SCVI(adata, n_latent=10)
model.train(max_epochs=20, accelerator='auto', devices='auto')
latent = model.get_latent_representation()
model.save('my_scvi_model', overwrite=True)
```

For this pattern:

1. Use `data-setup` to make sure `adata` contains valid counts, batch labels, covariates, modality matrices, and registry fields.
2. Use `core-models` or a specialized model sub-skill to choose the class and setup keys.
3. Use `training-and-inference` to tune epochs, batch size, accelerator, callbacks, and dataloaders.
4. Use `downstream-analysis` for accessors and statistical outputs.
5. Use `model-io-and-hub` before handing off a saved model or loading one in another environment.

## Optional Dependencies

The base package covers common model APIs, but several routes need extras or services:

- `autotune`: Ray/HyperOpt and tuning helpers.
- `hub`: Hugging Face Hub and storage metadata workflows.
- `dataloaders`: LaminDB, CELLxGENE Census, TileDB-SOMA, torchdata, and AnnBatch integrations.
- `regseq`, `file_sharing`, `parallel`, `interpretability`, `diagvi`, `mlflow`, `rapids`, `cuda`, `tpu`, `metal`: specialized workflows.

Do not install `all` or broad extras automatically. Install the smallest extra set needed for the requested route, then rerun `scripts/check_scvi_environment.py`.

## Troubleshooting Entry Points

- Cross-cutting install/import/backend/version failures: read `references/troubleshooting.md`.
- Data-field or registry failures: read `sub-skills/data-setup/references/troubleshooting.md`.
- Model-family or modality mismatch: read the nearest model sub-skill troubleshooting reference.
- Training failures: read `sub-skills/training-and-inference/references/troubleshooting.md`.
- Save/load or Hub failures: read `sub-skills/model-io-and-hub/references/troubleshooting.md`.

## Provenance

This generated skill is aligned to the source snapshot in `references/repo-provenance.md`. Refresh the skill if the repository version, public model APIs, optional extras, setup signatures, or save/load/hub behavior changes.

Files in this skill

  • SKILL.md5 KB
  • references/repo-provenance.md1.7 KB
  • references/repo-routing-metadata.json523 B
  • references/troubleshooting.md3.5 KB
  • scripts/check_scvi_environment.py3.4 KB
  • sub-skills/advanced-operations/SKILL.md3 KB
  • sub-skills/advanced-operations/references/autotune-and-extras.md6.4 KB
  • sub-skills/advanced-operations/references/developer-extension.md7.4 KB
  • sub-skills/advanced-operations/references/troubleshooting.md6.5 KB
  • sub-skills/annotation-and-query/SKILL.md2.6 KB
  • sub-skills/annotation-and-query/references/api-reference.md6.9 KB
  • sub-skills/annotation-and-query/references/troubleshooting.md7.2 KB
  • sub-skills/annotation-and-query/references/workflows.md6.2 KB
  • sub-skills/core-models/SKILL.md2.4 KB
  • sub-skills/core-models/references/api-reference.md10.6 KB
  • sub-skills/core-models/references/model-selection.md6 KB
  • sub-skills/core-models/references/troubleshooting.md5.4 KB
  • sub-skills/core-models/scripts/inspect_model_api.py3.4 KB
  • sub-skills/data-setup/SKILL.md3.4 KB
  • sub-skills/data-setup/references/api-reference.md5.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.