scvi.external.GIMVI.setup_anndata

static GIMVI.setup_anndata(adata, batch_key=None, labels_key=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.

Parameters
adata : AnnDataAnnData

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

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

key in adata.obs for batch information. Categories will automatically be converted into integer categories and saved to adata.obs[‘_scvi_batch’]. If None, assigns the same batch to all the data.

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

key in adata.obs for label information. Categories will automatically be converted into integer categories and saved to adata.obs[‘_scvi_labels’]. If None, assigns the same label to all the data.

copy : boolbool (default: False)

if True, a copy of adata is returned.

Return type

AnnData | NoneOptional[AnnData]

Returns

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

.uns[‘_scvi’]

scvi setup dictionary

.obs[‘_scvi_labels’]

labels encoded as integers

.obs[‘_scvi_batch’]

batch encoded as integers