Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Fits probabilistic scvi-tools models for single-cell omics: batch integration, annotation, CITE-seq, RNA/ATAC, and differential expression.
59% 95%+36 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 13 of 22 without it.
This test ran on v2. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
Targets scvi-tools 1.5.1. Code is illustrative and source-verified; short synthetic
SCVI/SCANVI fitting, predictions, DE and persistence were exercised in CPU tests. Unless stated otherwise, examples require an
AnnData with measured RNA counts in layers['counts'], unique gene/cell IDs and
valid named metadata. Complete QC and feature selection before setup.
import scvi
scvi.model.SCVI.setup_anndata(adata, layer="counts", batch_key="batch")
rna_model = scvi.model.SCVI(adata, n_latent=20, gene_likelihood="nb")
rna_model.train()
adata.obsm["X_scVI"] = rna_model.get_latent_representation()
normalized = rna_model.get_normalized_expression(library_size=1e4)
# cell_type contains known labels and a literal Unknown for unlabeled cells.
scanvi_model = scvi.model.SCANVI.from_scvi_model(
rna_model, labels_key="cell_type", unlabeled_category="Unknown",
)
scanvi_model.train()
predictions = scanvi_model.predict()
probabilities = scanvi_model.predict(soft=True)
For training from scratch, use SCANVI.setup_anndata with labels_key and
unlabeled_category, then SCANVI(adata). There is no predict_proba() method;
predict(soft=True) returns class probabilities. Provide labels_key explicitly
when the source SCVI model was not registered with labels. Do not reuse a SCANVI
registry to initialize a different class without that class's setup.
SCVI defaults include n_latent=10, n_hidden=128, n_layers=1,
dropout_rate=0.1, gene_likelihood='zinb', and dispersion='gene'.
Dispersion options include gene, gene-batch, gene-label and gene-cell; a gene-batch
parameter is not a cell-specific parameter. Choice of likelihood requires checking
the assay and fit, not simply counting zeros.
Embeddings are candidates for integration, not guaranteed batch-free biology.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.