scvi.model.SCANVI.posterior_predictive_sample

SCANVI.posterior_predictive_sample(adata=None, indices=None, n_samples=1, gene_list=None, batch_size=None)

Generate observation samples from the posterior predictive distribution.

The posterior predictive distribution is written as \(p(\hat{x} \mid x)\).

Parameters
adata : AnnData | NoneOptional[AnnData] (default: None)

AnnData object with equivalent structure to initial AnnData. If None, defaults to the AnnData object used to initialize the model.

indices : Sequence[int] | NoneOptional[Sequence[int]] (default: None)

Indices of cells in adata to use. If None, all cells are used.

n_samples : intint (default: 1)

Number of samples for each cell.

gene_list : Sequence[str] | NoneOptional[Sequence[str]] (default: None)

Names of genes of interest.

batch_size : int | NoneOptional[int] (default: None)

Minibatch size for data loading into model. Defaults to scvi.settings.batch_size.

Return type

ndarrayndarray

Returns

x_new : torch.Tensor tensor with shape (n_cells, n_genes, n_samples)