Two root for the pseudotime?

Hello, i wonder if i can use two roots for computing my pseudotime?
If yes , how sould i do ? I’m not used to python

Also , here is what i have done for doing a trajectory inference

sc.pp.neighbors(anndata, n_neighbors=50, use_rep=‘X_PCA_INT’)
sc.tl.leiden(anndata, resolution = 1)
sc.tl.paga(anndata,groups=‘leiden’)
sc.pl.paga(anndata)
anndata.uns[‘xroot’] = np.flatnonzero(anndata.obs[‘leiden’] ==‘8’)[0] # <=== i would like to use two different clusters
sc.tl.draw_graph(anndata,
init_pos=‘paga’,
root =np.flatnonzero(anndata.obs[‘leiden’]==‘8’)[0])
sc.tl.dpt(anndata)

i still have no idea how to do it :confused:

I’m not sure this is going to be possible within scanpy. I would suggest you instead use CellRank which has much richer tooling for fate mapping/ trajectory inference.

Hi there! Yes, indeed, looking at CellRank would be a good option, in particular, the CytoTRACE kernel may be what you’re looking for. See our docs with tutorials at CellRank for directed single-cell fate mapping — CellRank master documentation

In particular, for the CytoTRACE kernel, take a look at this tutorial: CellRank beyond RNA velocity — CellRank master documentation