# Help with cellrank2 macrostates (multiple conditions design)

**URL:** <https://discourse.scverse.org/t/help-with-cellrank2-macrostates-multiple-conditions-design/3978>\
**Category:** Help\
**Created:** [May 7, 2026, 1:44pm UTC](https://discourse.scverse.org/t/help-with-cellrank2-macrostates-multiple-conditions-design/3978 "2026-05-07T13:44:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paolaporracciolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/paolaporracciolo/32/1618_2.png) [@paolaporracciolo](https://discourse.scverse.org/u/paolaporracciolo)\
**Post date:** [May 7, 2026, 1:44pm UTC](https://discourse.scverse.org/t/help-with-cellrank2-macrostates-multiple-conditions-design/3978/1 "2026-05-07T13:44:54Z")

</div>

Hello, I have a question about cellrank2.

First off, thank you very much for this very interesting tool.

I am currently exploring the trajectories of the differentiation of the respiratory epithelium. The design of the analysis is 8 conditions (Healthy/Disease Treatment/CTRL D3/D14).

1. I first run palantir pseudotime all conditions together as suggested in issue 957 in github scverse/cellrank (can’t add the link here), choosing cell\_A as the cluster for the root cell. I run palantir with 2500 waypoints, since my dataset size is 40014 × 62703, which would be around only 6% of my cells. My pseudotime results make sense.
2. Then I calculate macrostates with 100 cells (if I use only 30, one of the healthy conditions does not contribute at all to the macrostates, if I use more, other cell types contaminate the macrostates). You can see the UMAP with the macrostates.

My problem is not the contribution of the original cell type clusters to the macrostates, but the contribution of the conditions to the macrostates (as you can see in the heatmap): only Disease conditions contribute to macrostates, except for the macrostate cell\_C. Is there a way to balance the contribution of the conditions to the macrostates? Do you think this comes from something in the gene expression? My problem here is that it is unbalanced, and then it does not seem correct to calculate fate probabilities of my cells towards macrostates characterized only by Disease conditions.

I can share my notebooks with you to see if there is any parameter I can change along the pipeline.  
Thank you very much,  
Paola

 ![Capture d’écran du 2026-05-07 15-44-25](https://canada1.discourse-cdn.com/flex035/uploads/forum11/original/2X/9/9f29c2c1b557262286ba70615fe09f01a1997174.jpeg)

---

<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:** [May 8, 2026, 8:11am UTC](https://discourse.scverse.org/t/help-with-cellrank2-macrostates-multiple-conditions-design/3978/2 "2026-05-08T08:11:10Z")

</div>

> [@paolaporracciolo](#):
>
> Hello, I have a question about cellrank2.
> 
> First off, thank you very much for this very interesting tool.
> 
> I am currently exploring the trajectories of the differentiation of the respiratory epithelium. The design of the analysis is 8 conditions (Healthy/Disease Treatment/CTRL D3/D14).
> 
> 1. I first run palantir pseudotime all conditions together as suggested in issue 957 in github scverse/cellrank (can’t add the link here), choosing cell\_A as the cluster for the root cell. I run palantir with 2500 waypoints, since my dataset size is 40014 × 62703, which would be around only 6% of my cells. My pseudotime results make sense.
> 2. Then I calculate macrostates with 100 cells (if I use only 30, one of the healthy conditions does not contribute at all to the macrostates, if I use more, other cell types contaminate the macrostates). You can see the UMAP with the macrostates.
> 
> My problem is not the contribution of the original cell type clusters to the macrostates, but the contribution of the conditions to the macrostates (as you can see in the heatmap): only Disease conditions contribute to macrostates, except for the macrostate cell\_C. Is there a way to balance the contribution of the conditions to the macrostates? Do you think this comes from something in the gene expression? My problem here is that it is unbalanced, and then it does not seem correct to calculate fate probabilities of my cells towards macrostates characterized only by Disease conditions.
> 
> I can share my notebooks with you to see if there is any parameter I can change along the pipeline.  
> Thank you very much,  
> Paola

Hi Paola! thanks for your question. Would you expect all conditions to contribute to all macrostates? Could it make sense biologically that healthy only contributes to a single macrostate, or is the contribution of different conditions to the phenocypic landscape much more mixed, including the healthy condition? You could look at scanpy density plots in the UMAP as a first step of exploring this.

---

<div class="post-metadata">

**Author:** ![paolaporracciolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/paolaporracciolo/32/1618_2.png) [@paolaporracciolo](https://discourse.scverse.org/u/paolaporracciolo)\
**Post date:** [May 11, 2026, 11:15am UTC](https://discourse.scverse.org/t/help-with-cellrank2-macrostates-multiple-conditions-design/3978/3 "2026-05-11T11:15:35Z")

</div>

Hello Marius, thank you very much for your answer!

> Would you expect all conditions to contribute to all macrostates?

Maybe not to all. It would not be surprising to have some macrostates with higher contribution from treatment or disease, but not almost 0 contribution from healthy conditions among all macrostates, this is very weird.

> Could it make sense biologically that healthy only contributes to a single macrostate, or is the contribution of different conditions to the phenocypic landscape much more mixed, including the healthy condition?

The weird result is the non-contribution of healthy conditions to any of the macrostates basically (with the exception of one). That being said, there could be a biological reason of a second macrostate for a cell type, that is not a weird.

> You could look at scanpy density plots in the UMAP as a first step of exploring this.

To explore the contribution of each condition to that part of the cluster after integration/annotation etc?

Thanks very much for your help 😄

---

<div class="post-metadata">

**Author:** ![paolaporracciolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/paolaporracciolo/32/1618_2.png) [@paolaporracciolo](https://discourse.scverse.org/u/paolaporracciolo)\
**Post date:** [June 8, 2026, 3:03pm UTC](https://discourse.scverse.org/t/help-with-cellrank2-macrostates-multiple-conditions-design/3978/4 "2026-06-08T15:03:52Z")

</div>

Hello Marius,

I have checked the density plots, overall we have a good integration of the conditions in the dataset. There are certain macrostates that have higher % of cells from a certain condition, and the density plot is coherent. For other macrostates, the density plots are not coherent. For example, healthy ctrl d3 is the condition with the highest density around cell\_E\_1, yet not even one cell was taken for the macrostate. What else could I check?

Thanks very much,  
Paola

---

<div class="post-metadata">

**Author:** ![paolaporracciolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/paolaporracciolo/32/1618_2.png) [@paolaporracciolo](https://discourse.scverse.org/u/paolaporracciolo)\
**Post date:** [July 17, 2026, 9:03am UTC](https://discourse.scverse.org/t/help-with-cellrank2-macrostates-multiple-conditions-design/3978/5 "2026-07-17T09:03:15Z")

</div>

Hi Marius,

Thanks for reaching out and for the detailed explanation!

Just to make sure I understand correctly: the likelihood of a macrostate not being left is related to the transition probabilities between cells, which are themselves derived from gene expression similarity/dynamics, right? If that’s the case, isn’t there a risk that the pseudotime/trajectory ends up biased toward tracing the differentiation driven by disease-specific gene expression programs, rather than a more “general” differentiation trajectory shared across conditions — with different terminal macrostates simply reflecting different disease phenotypes rather than distinct biological endpoints?

This is why I’m having trouble seeing how idea 1 fits my case. The macrostates I’d want to use as representative of the control condition keep getting dominated by disease-condition macrostates, and I suspect this is because the random walk itself is somehow unbalanced — possibly due to the transition probabilities (and the gene expression dynamics behind them). So I’m not able to actually identify separate macrostates for healthy vs. disease conditions.

For idea 2, I have a similar concern: even if I manually set terminal states that are representative of the control condition, since I expect some genuine differences between healthy and disease, wouldn’t the driver gene analysis still end up biased? If most/all macrostates are shifted toward the disease condition, am I not at risk of recovering driver genes that mostly reflect the disease condition rather than the healthy one?

Do you think using the RealTimeKernel could help balance this, by forcing progression from the first timepoint to the last? My understanding is that I’d need to add condition as a covariate to the lineage/temporal problem — is that right? And if so, how much weight would you suggest giving to each kernel?

Best,  
Paola
