技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
scvi-tools【数据与研究】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.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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.
For a new environment or bug report, verify the install before choosing a workflow:
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:
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.
AnnData/MuData, layers, .obs, .obsm, .varm, registries, readers, or setup_anndata: use sub-skills/data-setup/.SCVI, SCANVI, TOTALVI, PEAKVI, MULTIVI, AUTOZI, LinearSCVI, CondSCVI, DestVI, AmortizedLDA, or mlxSCVI: use sub-skills/core-models/.SCANVI, SOLO, or CellAssign: use sub-skills/annotation-and-query/.sub-skills/multimodal-and-spatial/.Trainer behavior, accelerator/device choices, callbacks, validation splits, dataloaders, custom datamodules, or inference dataloaders: use sub-skills/training-and-inference/.sub-skills/downstream-analysis/.sub-skills/model-io-and-hub/.sub-skills/advanced-operations/.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:
data-setup to make sure adata contains valid counts, batch labels, covariates, modality matrices, and registry fields.core-models or a specialized model sub-skill to choose the class and setup keys.training-and-inference to tune epochs, batch size, accelerator, callbacks, and dataloaders.downstream-analysis for accessors and statistical outputs.model-io-and-hub before handing off a saved model or loading one in another environment.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.
references/troubleshooting.md.sub-skills/data-setup/references/troubleshooting.md.sub-skills/training-and-inference/references/troubleshooting.md.sub-skills/model-io-and-hub/references/troubleshooting.md.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.