- dynamo.vf.jacobian(adata, regulators=None, effectors=None, cell_idx=None, sampling=None, sample_ncells=1000, basis='pca', Qkey='PCs', vector_field_class=None, method='analytical', store_in_adata=True, **kwargs)
Calculate Jacobian for each cell with the reconstructed vector field.
If the vector field was reconstructed from the reduced PCA space, the Jacobian matrix will then be inverse transformed back to high dimension. Note that this should also be possible for reduced UMAP space and will be supported shortly. Note that we compute the Jacobian for the RKHS kernel vector field analytically, which is much more computationally efficient than the numerical method.
AnnData) – AnnData object that contains the reconstructed vector field in .uns.
List]) – The list of genes that will be used as regulators when calculating the cell-wise Jacobian matrix. The Jacobian is the matrix consisting of partial derivatives of the vector field wrt gene expressions. It can be used to evaluate the change in velocities of effectors (see below) as the expressions of regulators increase. The regulators are the denominators of the partial derivatives.
int) – The number of cells to be sampled. If sampling is None, this parameter is ignored.
str) – The embedding data in which the vector field was reconstructed. If None, use the vector field function that was reconstructed directly from the original unreduced gene expression space.
str) – The key of the PCA loading matrix in .uns.
str) – The method that will be used for calculating Jacobian, either ‘analytical’ or ‘numerical’. ‘analytical’ method uses the analytical expressions for calculating Jacobian while ‘numerical’ method uses numdifftools, a numerical differentiation tool, for computing Jacobian. ‘analytical’ method is much more efficient.
cores – Number of cores to calculate Jacobian. If cores is set to be > 1, multiprocessing will be used to parallel the Jacobian calculation.
kwargs – Any additional keys that will be passed to elementwise_jacobian_transformation function.
- AnnData object that is updated with the ‘jacobian’ key in the .uns. This is a 3-dimensional tensor with
dimensions n_effectors x n_regulators x n_obs.