phlower.tl.random_climb_knn

phlower.tl.random_climb_knn(adata, graph_name=None, A=None, W=None, knn_edges_k=9, attr: str = 'u', roots_ratio: float = 0.1, n: int = 10000, iscopy=False, traj_name=None, knn_type='diffusion', seeds: int = 2022)

Randomly climb the graph from the roots cells to the leaves cells using the knn_edges. 1. random climb the knn_edges graph from the root cells 2. each edge in knn_edges, find the shortest path in the graph_name graph if there’s no edge in the graph_name

Parameters:

adata: AnnData

AnnData object

graph_name: str

the graph with holes to be used, adata.uns[“graph_basis”] + “_triangulation” by default if None

A: csr_matrix

the adjacency matrix of the diffusion

W: csr_matrix

the weight matrix of the diffusion

knn_edges_k: int

the number of knn edges to be used, 9 by default

attr: str

the attribute of the graph_name, “u” by default

roots_ratio: float

the ratio of the cells to be used as root, 0.1 by default

n: int

the number of trajectories to be produced, 10000 by default

iscopy: bool

whether to return a copy of adata or not, False by default

traj_name: str

the name of the trajectories to be saved in adata.uns, “knn_trajs” by default

seeds: int

the random seeds to be used, 2022 by default