---
library_name: scvi-tools
license: cc-by-4.0
tags:
- biology
- genomics
- single-cell
- model_cls_name:SCANVI
- scvi_version:1.2.0
- anndata_version:0.11.1
- modality:rna
- tissue:various
- annotated:True
---
ScANVI is a variational inference model for single-cell RNA-seq data that can learn an underlying
latent space, integrate technical batches and impute dropouts.
In addition, to scVI, ScANVI is a semi-supervised model that can leverage labeled data to learn a
cell-type classifier in the latent space and afterward predict cell types of new data.
The learned low-dimensional latent representation of the data can be used for visualization and
clustering.
scANVI takes as input a scRNA-seq gene expression matrix with cells and genes as well as a
cell-type annotation for a subset of cells.
We provide an extensive [user guide](https://docs.scvi-tools.org/en/1.2.0/user_guide/models/scanvi.html).
- See our original manuscript for further details of the model:
[scANVI manuscript](https://www.embopress.org/doi/full/10.15252/msb.20209620).
- See our manuscript on [scvi-hub](https://www.biorxiv.org/content/10.1101/2024.03.01.582887v2)
how to leverage pre-trained models.
This model can be used for fine tuning on new data using our Arches framework:
[Arches tutorial](https://docs.scvi-tools.org/en/1.0.0/tutorials/notebooks/scarches_scvi_tools.html).
# Model Description
Tabula Sapiens is a benchmark, first-draft human cell atlas of nearly 500,000 cells from 24 organs of 15 normal human subjects.
# Metrics
We provide here key performance metrics for the uploaded model, if provided by the data uploader.
Coefficient of variation
The cell-wise coefficient of variation summarizes how well variation between different cells is
preserved by the generated model expression. Below a squared Pearson correlation coefficient of 0.4
, we would recommend not to use generated data for downstream analysis, while the generated latent
space might still be useful for analysis.
**Cell-wise Coefficient of Variation**:
| Metric | Training Value | Validation Value |
|-------------------------|----------------|------------------|
| Mean Absolute Error | 2.33 | 2.31 |
| Pearson Correlation | 0.63 | 0.61 |
| Spearman Correlation | 0.61 | 0.59 |
| R² (R-Squared) | 0.10 | 0.11 |
The gene-wise coefficient of variation summarizes how well variation between different genes is
preserved by the generated model expression. This value is usually quite high.
**Gene-wise Coefficient of Variation**:
| Metric | Training Value |
|-------------------------|----------------|
| Mean Absolute Error | 13.92 |
| Pearson Correlation | 0.56 |
| Spearman Correlation | 0.61 |
| R² (R-Squared) | -1.21 |
Differential expression metric
The differential expression metric provides a summary of the differential expression analysis
between cell types or input clusters. We provide here the F1-score, Pearson Correlation
Coefficient of Log-Foldchanges, Spearman Correlation Coefficient, and Area Under the Precision
Recall Curve (AUPRC) for the differential expression analysis using Wilcoxon Rank Sum test for each
cell-type.
**Differential expression**:
| Index | gene_f1 | lfc_mae | lfc_pearson | lfc_spearman | roc_auc | pr_auc | n_cells |
| --- | --- | --- | --- | --- | --- | --- | --- |
| stromal cell | 0.90 | 1.29 | 0.70 | 0.95 | 0.46 | 0.90 | 2943.00 |
| endothelial cell | 0.84 | 1.70 | 0.66 | 0.92 | 0.36 | 0.85 | 1309.00 |
| CD8-positive, alpha-beta memory T cell | 0.88 | 3.52 | 0.61 | 0.77 | 0.23 | 0.76 | 857.00 |
| macrophage | 0.87 | 2.46 | 0.61 | 0.84 | 0.28 | 0.84 | 846.00 |
| mast cell | 0.90 | 3.31 | 0.61 | 0.79 | 0.20 | 0.75 | 645.00 |
| mature NK T cell | 0.84 | 3.97 | 0.58 | 0.74 | 0.24 | 0.75 | 605.00 |
| T cell | 0.91 | 4.45 | 0.56 | 0.70 | 0.22 | 0.73 | 519.00 |
| muscle cell | 0.91 | 3.40 | 0.61 | 0.79 | 0.36 | 0.79 | 437.00 |
| CD4-positive, alpha-beta memory T cell | 0.83 | 4.39 | 0.60 | 0.69 | 0.23 | 0.71 | 339.00 |
| CD1c-positive myeloid dendritic cell | 0.81 | 4.54 | 0.61 | 0.72 | 0.29 | 0.82 | 165.00 |
| CD8-positive, alpha-beta cytotoxic T cell | 0.80 | 5.81 | 0.52 | 0.54 | 0.31 | 0.71 | 129.00 |
| regulatory T cell | 0.85 | 5.06 | 0.60 | 0.63 | 0.30 | 0.77 | 126.00 |
| epithelial cell | 0.69 | 4.50 | 0.61 | 0.72 | 0.35 | 0.71 | 106.00 |
| naive thymus-derived CD8-positive, alpha-beta T cell | 0.84 | 5.45 | 0.57 | 0.55 | 0.28 | 0.75 | 88.00 |
| naive thymus-derived CD4-positive, alpha-beta T cell | 0.81 | 5.32 | 0.56 | 0.56 | 0.28 | 0.71 | 71.00 |
| melanocyte | 0.71 | 6.10 | 0.53 | 0.57 | 0.38 | 0.73 | 64.00 |
| CD4-positive helper T cell | 0.78 | 5.73 | 0.54 | 0.54 | 0.30 | 0.73 | 59.00 |
| Langerhans cell | 0.70 | 5.94 | 0.54 | 0.56 | 0.37 | 0.75 | 36.00 |
| plasma cell | 0.53 | 7.21 | 0.46 | 0.45 | 0.30 | 0.73 | 24.00 |
| CD141-positive myeloid dendritic cell | 0.64 | 6.55 | 0.52 | 0.52 | 0.28 | 0.75 | 17.00 |
| smooth muscle cell | 0.60 | 5.75 | 0.53 | 0.51 | 0.38 | 0.69 | 13.00 |
# Model Properties
We provide here key parameters used to setup and train the model.
Model Parameters
These provide the settings to setup the original model:
```json
{
"n_hidden": 128,
"n_latent": 20,
"n_layers": 3,
"dropout_rate": 0.05,
"dispersion": "gene",
"gene_likelihood": "nb",
"linear_classifier": false,
"latent_distribution": "normal",
"use_batch_norm": "none",
"use_layer_norm": "both",
"encode_covariates": true
}
```
Setup Data Arguments
Arguments passed to setup_anndata of the original model:
```json
{
"labels_key": "cell_ontology_class",
"unlabeled_category": "unknown",
"layer": null,
"batch_key": "donor_assay",
"size_factor_key": null,
"categorical_covariate_keys": null,
"continuous_covariate_keys": null,
"use_minified": false
}
```
Data Registry
Registry elements for AnnData manager:
| Registry Key | scvi-tools Location |
|-------------------|--------------------------------------|
| X | adata.X |
| batch | adata.obs['_scvi_batch'] |
| labels | adata.obs['_scvi_labels'] |
| latent_qzm | adata.obsm['scanvi_latent_qzm'] |
| latent_qzv | adata.obsm['scanvi_latent_qzv'] |
| minify_type | adata.uns['_scvi_adata_minify_type'] |
| observed_lib_size | adata.obs['observed_lib_size'] |
- **Data is Minified**: False
Summary Statistics
| Summary Stat Key | Value |
|--------------------------|-------|
| n_batch | 3 |
| n_cells | 9398 |
| n_extra_categorical_covs | 0 |
| n_extra_continuous_covs | 0 |
| n_labels | 22 |
| n_latent_qzm | 20 |
| n_latent_qzv | 20 |
| n_vars | 3000 |
Training
**Training data url**: Not provided by uploader
If provided by the original uploader, for those interested in understanding or replicating the
training process, the code is available at the link below.
**Training Code URL**: https://github.com/YosefLab/scvi-hub-models/blob/main/src/scvi_hub_models/TS_train_all_tissues.ipynb
# References
The Tabula Sapiens Consortium. The Tabula Sapiens: A multiple-organ, single-cell transcriptomic atlas of humans. Science, May 2022. doi:10.1126/science.abl4896