# mrVI and groupby=None

**URL:** <https://discourse.scverse.org/t/mrvi-and-groupby-none/4017>\
**Category:** scvi-tools\
**Created:** [June 24, 2026, 6:35am UTC](https://discourse.scverse.org/t/mrvi-and-groupby-none/4017 "2026-06-24T06:35:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmartimis](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mmartimis](https://discourse.scverse.org/u/mmartimis)\
**Post date:** [June 24, 2026, 6:35am UTC](https://discourse.scverse.org/t/mrvi-and-groupby-none/4017/1 "2026-06-24T06:35:04Z")

</div>

Hi,

I am fairly new to data analysis and therefore there might be an obvious answer to this, but I hope you can help me figure this out.

I have a dataset of immune cells with samples from many different predefined disease “states” within the same disease. I want to figure out of the unsupervised approach mrVI offers is able to group the samples based on these states, or if rather there are other biological groupings that appear instead. But I don’t want to get one clustermap per cell type as the tutorial examplifies, I would like to get one clustermap for the entire dataset, and therefore have set `dists = model.get_local_sample_distances(keep_cell=False, groupby=None)`. However, I then get the error “ValueError: Undefined computation because not keep\_cell and no groupby”. And it seems I do not have access to enough computational resources to run with keep\_cell=True. Is there a way to run this without grouping per cell type or other group to get one global clustermap? If so, are there other adjustments you would do to the rest of the script to allow it to run?

Thank you!

---

<div class="post-metadata">

**Author:** ![cane11](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/cane11/32/241_2.png) [@cane11](https://discourse.scverse.org/u/cane11)\
**Post date:** [June 24, 2026, 7:06am UTC](https://discourse.scverse.org/t/mrvi-and-groupby-none/4017/2 "2026-06-24T07:06:56Z")

</div>

Thanks for your interest in MrVI. There is some confusion here (keep\_cell keeps the values for each single cell, while groupby defines the summary groups). We provided some evidence in the manuscript that sample stratification of different cell-types can be meaningful and I would recommend to first check the per cell-type stratification. To get a single summary statistic, you can pass in a cell-type key with a unique value for all cells.

---

<div class="post-metadata">

**Author:** ![mmartimis](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mmartimis](https://discourse.scverse.org/u/mmartimis)\
**Post date:** [June 25, 2026, 6:32am UTC](https://discourse.scverse.org/t/mrvi-and-groupby-none/4017/3 "2026-06-25T06:32:55Z")

</div>

Thank you for the clarification and quick response! I will try out your suggestions!
