dynamo.tl.cell_wise_confidence¶
- dynamo.tl.cell_wise_confidence(adata, X_data=None, V_data=None, ekey='M_s', vkey='velocity_S', neighbors_from_basis=False, method='jaccard')[source]¶
Calculate the cell-wise velocity confidence metric.
- Parameters
adata (
AnnData
) – an Annodata object.X_data (‘np.ndarray’ or sp.csr_matrix or None (optional, default None)) – The expression states of single cells (or expression states in reduced dimension, like pca, of single cells)
V_data (‘np.ndarray’ or sp.csr_matrix or None (optional, default None)) – The RNA velocity of single cells (or velocity estimates projected to reduced dimension, like pca, of single cells). Note that X, V_mat need to have the exact dimensionalities.
ekey (str (optional, default M_s)) – The dictionary key that corresponds to the gene expression in the layer attribute. By default, it is the smoothed expression M_s.
vkey (‘str’ (optional, default velocity_S)) – The dictionary key that corresponds to the estimated velocity values in layers attribute.
neighbors_from_basis (bool (optional, default False)) – Whether to construct nearest neighbors from low dimensional space as defined by the basis, instead of using that calculated during UMAP process.
method (str (optional, default jaccard)) – Which method will be used for calculating the cell wise velocity confidence metric. By default it uses jaccard index, which measures how well each velocity vector meets the geometric constraints defined by the local neighborhood structure. Jaccard index is calculated as the fraction of the number of the intersected set of nearest neighbors from each cell at current expression state (X) and that from the future expression state (X + V) over the number of the union of these two sets. The cosine or correlation method is similar to that used by scVelo (https://github.com/theislab/scvelo).
- Returns
adata – Returns an updated ~anndata.AnnData with .obs.confidence as the cell-wise velocity confidence.
- Return type