scvi.external.GIMVI

class scvi.external.GIMVI(adata_seq, adata_spatial, generative_distributions=['zinb', 'nb'], model_library_size=[True, False], n_latent=10, **model_kwargs)[source]

Joint VAE for imputing missing genes in spatial data [Lopez19].

Parameters
adata_seq : AnnDataAnnData

AnnData object that has been registered via setup_anndata() and contains RNA-seq data.

adata_spatial : AnnDataAnnData

AnnData object that has been registered via setup_anndata() and contains spatial data.

n_hidden

Number of nodes per hidden layer.

generative_distributions : ListList (default: ['zinb', 'nb'])

List of generative distribution for adata_seq data and adata_spatial data.

model_library_size : ListList (default: [True, False])

List of bool of whether to model library size for adata_seq and adata_spatial.

n_latent : intint (default: 10)

Dimensionality of the latent space.

**model_kwargs

Keyword args for JVAE

Examples

>>> adata_seq = anndata.read_h5ad(path_to_anndata_seq)
>>> adata_spatial = anndata.read_h5ad(path_to_anndata_spatial)
>>> scvi.data.setup_anndata(adata_seq)
>>> scvi.data.setup_anndata(adata_spatial)
>>> vae = scvi.model.GIMVI(adata_seq, adata_spatial)
>>> vae.train(n_epochs=400)

Notes

See further usage examples in the following tutorials:

  1. Introduction to gimVI

Attributes

device

history

Returns computed metrics during training.

is_trained

test_indices

train_indices

validation_indices

Methods

get_elbo([adata, indices, batch_size])

Return the ELBO for the data.

get_imputed_values([adatas, deterministic, …])

Return imputed values for all genes for each dataset.

get_latent_representation([adatas, …])

Return the latent space embedding for each dataset.

get_marginal_ll([adata, indices, …])

Return the marginal LL for the data.

get_reconstruction_error([adata, indices, …])

Return the reconstruction error for the data.

load(dir_path[, adata_seq, adata_spatial, …])

Instantiate a model from the saved output.

save(dir_path[, overwrite, save_anndata])

Save the state of the model.

to_device(device)

Move model to device.

train([max_epochs, use_gpu, kappa, …])

Train the model.