dynamo.vf.diffusionMatrix

dynamo.vf.diffusionMatrix(adata, X_data=None, V_data=None, genes=None, layer=None, basis='umap', dims=None, n=30, VecFld=None, residual='vector_field')[source]

Calculate the diffusion matrix from the estimated velocity vector and the reconstructed vector field.

Parameters:
  • adata (AnnData) – an Annodata object.

  • X_data (Optional[ndarray]) – The user supplied expression (embedding) data that will be used for calculating diffusion matrix directly.

  • V_data (Optional[ndarray]) – The user supplied velocity data that will be used for calculating diffusion matrix directly.

  • genes (Optional[List]) – The list of genes that will be used to subset the data. If None, all genes will be used.

  • layer (Optional[str]) – Which layer of the data will be used for diffusion matrix calculation.

  • basis (str) – Which basis of the data will be used for diffusion matrix calculation.

  • dims (Optional[List]) – The list of dimensions that will be selected for diffusion matrix calculation. If None, all dimensions will be used.

  • n (int) – Number of nearest neighbors when the nearest neighbor graph is not included.

  • VecFld (Optional[VecFldDict]) – The reconstructed vector field function.

  • residual (str) – Method to calculate residual velocity vectors for diffusion matrix calculation. If average, all velocity of the nearest neighbor cells will be minused by its average velocity; if vector_field, all velocity will be minused by the predicted velocity from the reconstructed deterministic velocity vector field.

Returns:

AnnData object that is updated with the diffusion_matrix key in the uns attribute which is a list of

the diffusion matrix for each cell. A column diffusion corresponds to the square root of the sum of all elements for each cell’s diffusion matrix will also be added.

Return type:

adata