scvelo.tl.recover_dynamics

scvelo.tl.recover_dynamics(data, var_names='velocity_genes', n_top_genes=None, max_iter=10, assignment_mode='projection', t_max=None, fit_time=True, fit_scaling=True, fit_steady_states=True, fit_connected_states=None, fit_basal_transcription=None, use_raw=False, load_pars=None, return_model=None, plot_results=False, steady_state_prior=None, add_key='fit', copy=False, **kwargs)

Recovers the full splicing kinetics of specified genes

The model infers transcription rates, splicing rates, degradation rates, as well as cell-specific latent time and transcriptional states.

Parameters:
data : AnnData

Annotated data matrix.

var_names : str, list of str (default: ‘velocity_genes)

Names of variables/genes to use for the fitting.

n_top_genes : int or None (default: None)

Number of top velocity genes to use for the dynamical model.

max_iter : int (default: 10)

Maximal iterations in the EM-Algorithm.

assignment_mode : str (default: projection)

Determined how times are assigned to observations. If projection, observations are projected onto the model trajectory. Else uses an inverse approximating formula.

t_max : float or None (default: None)

Total range for time assignments.

fit_scaling : bool or float or None (default: True)

Whether to fit scaling between unspliced and spliced or keep initially given scaling fixed.

fit_time : bool or float or None (default: True)

Whether to fit time or keep initially given time fixed.

fit_steady_states : bool or None (default: True)

Allows fitting of observations to steady states next to repression and induction.

fit_connected_states : bool or None (default: None)

Restricts fitting to neighbors given by connectivities.

fit_basal_transcription : bool or None (default: None)

Enables model to incorporate basal transcriptions.

use_raw : bool or None (default: None)

if True, use .layers[‘sliced’], else use moments from .layers[‘Ms’]

load_pars : bool or None (default: None)

Load parameters from past fits.

return_model : bool or None (default: True)

Whether to return the model as :DynamicsRecovery: object.

plot_results : bool or None (default: False)

Plot results after parameter inference.

steady_state_prior : list of bool or None (default: None)

Mask for indices used for steady state regression.

add_key : str (default: ‘fit’)

Key to add to parameter names, e.g. ‘fit_t’ for fitted time.

copy : bool (default: False)

Return a copy instead of writing to adata.

Returns:

Returns or updates adata