scgen.SCGEN.get_latent_representation¶
- SCGEN.get_latent_representation(adata=None, indices=None, give_mean=True, mc_samples=5000, batch_size=None, return_dist=False)¶
Return the latent representation for each cell.
This is typically denoted as \(z_n\).
- Parameters
- adata
AnnData
|None
Optional
[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
] |None
Optional
[Sequence
[int
]] (default:None
) Indices of cells in adata to use. If None, all cells are used.
- give_mean
bool
(default:True
) Give mean of distribution or sample from it.
- mc_samples
int
(default:5000
) For distributions with no closed-form mean (e.g., logistic normal), how many Monte Carlo samples to take for computing mean.
- batch_size
int
|None
Optional
[int
] (default:None
) Minibatch size for data loading into model. Defaults to scvi.settings.batch_size.
- return_dist
bool
(default:False
) Return (mean, variance) of distributions instead of just the mean. If True, ignores give_mean and mc_samples. In the case of the latter, mc_samples is used to compute the mean of a transformed distribution. If return_dist is true the untransformed mean and variance are returned.
- adata
- Return type
ndarray
|Tuple
[ndarray
,ndarray
]Union
[ndarray
,Tuple
[ndarray
,ndarray
]]- Returns
Low-dimensional representation for each cell or a tuple containing its mean and variance.