dynamo.tl.velocity_N

dynamo.tl.velocity_N(adata, group=None, recalculate_pca=True, recalculate_umap=True, del_2nd_moments=None)[source]

Use new RNA based pca, umap, for velocity calculation and projection for kinetics or one-shot experiment.

The AnnData object will be updated inplace with the low dimensional (umap or pca) velocity projections with the new RNA or pca based RNA velocities.

Note that currently velocity_N function only considers labeling data and removes splicing data if they exist.

Parameters:
  • adata (AnnData) – AnnData object that stores data for the kinetics or one-shot experiment, must include X_new, X_total layers.

  • group (Optional[str]) – The cell group that will be used to calculate velocity in each separate group. This is useful if your data comes from different labeling condition, etc. Defaults to None.

  • recalculate_pca (bool) – Whether to recalculate pca with the new RNA data. If setting to be False, you need to make sure the pca is already generated via new RNA. Defaults to True.

  • recalculate_umap (bool) – Whether to recalculate umap with the new RNA data. If setting to be False, you need to make sure the umap is already generated via new RNA. Defaults to True.

  • del_2nd_moments (Optional[bool]) – Whether to remove second moments or covariances. If None, would be set according to DynamoAdataConfig. Defaults to None.

Raises:
  • ExceptionX_new or X_total layer unavailable.

  • Exception – experiment type is not supported.

Return type:

None