# Merging data from multiple cohorts and many donors with scVI

**URL:** <https://discourse.scverse.org/t/merging-data-from-multiple-cohorts-and-many-donors-with-scvi/182>\
**Category:** scvi-tools\
**Created:** [September 18, 2021, 5:13pm UTC](https://discourse.scverse.org/t/merging-data-from-multiple-cohorts-and-many-donors-with-scvi/182 "2021-09-18T17:13:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![adamgayoso](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/adamgayoso/32/100_2.png) [@adamgayoso](https://discourse.scverse.org/u/adamgayoso)\
**Post date:** [September 18, 2021, 6:34pm UTC](https://discourse.scverse.org/t/merging-data-from-multiple-cohorts-and-many-donors-with-scvi/182/2 "2021-09-18T18:34:25Z")

</div>

Hi Phil,

> [@Phil\_Bradley](#):
>
> is there a recommended minimum number of cells per donor ie batch (I am using the donor as the “batch” identifier)? I understand that there are suggestions to keep the number of cells greater than the number of genes, but I’m not sure if this applies within individual batches as well.

It’s hard to say. What you’re attempting to to is beyond what we have explicitly tested (and very cool!).  
We are currently working on an extension related to this post:

> [@Models for handling hundreds of batches](https://discourse.scverse.org/t/models-for-handling-hundreds-of-batches/24/5):
>
> I think this is a great idea! Very curious to know what you find.

> [@Phil\_Bradley](#):
>
> It looks like there are systematic technical differences in expression between the cohorts. Is there a way to include the cohort as an additional “batch” covariate for the model fitting? Does that even make sense, given that each donor has a cohort membership so the model already has freedom to fit those differences on a per-donor basis?

Yes you can put both the donor and the cohort as a key using `categorical_covariate_keys` here: [https://docs.scvi-tools.org/en/stable/api/reference/scvi.data.setup\_anndata.html#scvi.data.setup\_anndata](https://docs.scvi-tools.org/en/stable/api/reference/scvi.data.setup_anndata.html#scvi.data.setup_anndata)

> [@Phil\_Bradley](#):
>
> Any other thoughts/suggestions you might have on integrating very many batches would be much appreciated! For example, would it be better to integrate a few big batches and then bring the rest into that latent space using something like scarches? Are there SCVI flags (use\_layer\_norm, use\_batch\_norm, etc?) that might be appropriate for handling many cells/batches?

I would be interested to learn a bit more about what you’re trying to do. What you stated are reasonable things to try though. Please feel free to email me (firstlast at berkeley dot edu) if you’d like to schedule a meeting!

---

_[View the full topic](https://discourse.scverse.org/t/merging-data-from-multiple-cohorts-and-many-donors-with-scvi/182)._
