static DestVI.setup_anndata(adata, layer=None, copy=False)[source]

Sets up the AnnData object for this model. A mapping will be created between data fields used by this model to their respective locations in adata.

None of the data in adata are modified. Only adds fields to adata.

adata : AnnDataAnnData

AnnData object containing raw counts. Rows represent cells, columns represent features.

layer : str | NoneOptional[str] (default: None)

if not None, uses this as the key in adata.layers for raw count data.

copy : boolbool (default: False)

if True, a copy of adata is returned.

Return type

AnnData | NoneOptional[AnnData]


If copy, will return AnnData. Adds the following fields to adata:


scvi setup dictionary


labels encoded as integers


batch encoded as integers