# Two root for the pseudotime?

**URL:** <https://discourse.scverse.org/t/two-root-for-the-pseudotime/497>\
**Category:** cellrank\
**Created:** [May 28, 2022, 5:58pm UTC](https://discourse.scverse.org/t/two-root-for-the-pseudotime/497 "2022-05-28T17:58:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamidsta](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/hamidsta/32/246_2.png) [@hamidsta](https://discourse.scverse.org/u/hamidsta)\
**Post date:** [May 28, 2022, 5:58pm UTC](https://discourse.scverse.org/t/two-root-for-the-pseudotime/497/1 "2022-05-28T17:58:23Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![hamidsta](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/hamidsta/32/246_2.png) [@hamidsta](https://discourse.scverse.org/u/hamidsta)\
**Post date:** [June 1, 2022, 6:24am UTC](https://discourse.scverse.org/t/two-root-for-the-pseudotime/497/2 "2022-06-01T06:24:43Z")

</div>

i still have no idea how to do it 😕

---

<div class="post-metadata">

**Author:** ![ivirshup](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/ivirshup/32/160_2.png) [@ivirshup](https://discourse.scverse.org/u/ivirshup)\
**Post date:** [June 7, 2022, 9:14am UTC](https://discourse.scverse.org/t/two-root-for-the-pseudotime/497/3 "2022-06-07T09:14:53Z")

</div>

I’m not sure this is going to be possible within scanpy. I would suggest you instead use [CellRank](https://cellrank.readthedocs.io/en/stable/) which has much richer tooling for fate mapping/ trajectory inference.

---

<div class="post-metadata">

**Author:** ![Marius1311](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/marius1311/32/193_2.png) [@Marius1311](https://discourse.scverse.org/u/Marius1311)\
**Post date:** [June 20, 2022, 3:54pm UTC](https://discourse.scverse.org/t/two-root-for-the-pseudotime/497/4 "2022-06-20T15:54:56Z")

</div>

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](https://cellrank.readthedocs.io/en/stable/)

In particular, for the CytoTRACE kernel, take a look at this tutorial: [CellRank beyond RNA velocity — CellRank master documentation](https://cellrank.readthedocs.io/en/stable/beyond_rna_velocity.html)
