scvelo.tl.VELOVI.get_velocity¶
-
VELOVI.
get_velocity
(adata=None, indices=None, gene_list=None, n_samples=1, n_samples_overall=None, batch_size=None, return_mean=True, return_numpy=None, velo_statistic='mean', velo_mode='spliced', clip=True)¶ Returns cells by genes velocity estimates.
- Parameters
- adata :
AnnData
,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
Indices of cells in adata to use. If None, all cells are used.
- gene_list :
Sequence
[str
],None
Return velocities for a subset of genes. This can save memory when working with large datasets and few genes are of interest.
- n_samples :
int
Number of posterior samples to use for estimation for each cell.
- n_samples_overall :
int
,None
Number of overall samples to return. Setting this forces n_samples=1.
- batch_size :
int
,None
Minibatch size for data loading into model. Defaults to scvi.settings.batch_size.
- return_mean :
bool
Whether to return the mean of the samples.
- return_numpy :
bool
,None
Return a
ndarray
instead of aDataFrame
. DataFrame includes gene names as columns. If either n_samples=1 or return_mean=True, defaults to False. Otherwise, it defaults to True.- velo_statistic :
str
Whether to compute expected velocity over states, or maximum a posteriori velocity over maximal probability state.
- velo_mode :
_Literalgenericalias
[spliced, unspliced] Compute ds/dt or du/dt.
- clip :
bool
Clip to minus spliced value
- adata :
- Return type
ndarray
,DataFrame
- Returns
If n_samples > 1 and return_mean is False, then the shape is (samples, cells, genes).
Otherwise, shape is (cells, genes). In this case, return type is
DataFrame
unless return_numpy is True.