graphvelo.graph_velocity.GraphVelo
- class graphvelo.graph_velocity.GraphVelo(adata, xkey='Ms', vkey='velocity', X_data=None, V_data=None, gene_subset=None, approx=True, n_pcs=30, mo=False)[source]
GraphVelo encapsulates the workflow for learning a manifold-constrained velocity projection.
It supports computing a low-dimensional representation of the gene expression space, estimating a velocity graph (phi coefficients), and transform velocity vectors to different basis.
Initialize the GraphVelo object.
- Parameters:
adata: AnnData object containing the expression and velocity data. xkey (str): Key in adata.layers for the expression data. vkey (str): Key in adata.layers for the velocity data. X_data, V_data: Optionally provided expression and velocity matrices. gene_subset: Optionally, a subset of genes to use. approx (bool): If True, perform an approximate projection using PCA. n_pcs (int): Number of principal components for dimensionality reduction. mo (bool): Flag indicating if multi-omic data is used (affects neighbor extraction).
Methods
Plot the distribution of the learned phi coefficients.
project_velocity(X_embedding[, T])Project the velocity vectors onto a low-dimensional embedding.
train([a, b, r, loss_func, ...])Train the GraphVelo model by learning the phi coefficients in tangent space.
write_to_adata(adata[, key])Write the learned phi coefficients (velocity projection basis) to the AnnData object.