# Scale by total protein counts before running totalVI (to eliminate a batch effect of having different sequencing depths)

**URL:** <https://discourse.scverse.org/t/scale-by-total-protein-counts-before-running-totalvi-to-eliminate-a-batch-effect-of-having-different-sequencing-depths/2249>\
**Category:** scvi-tools\
**Created:** [May 1, 2024, 4:24pm UTC](https://discourse.scverse.org/t/scale-by-total-protein-counts-before-running-totalvi-to-eliminate-a-batch-effect-of-having-different-sequencing-depths/2249 "2024-05-01T16:24:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Milcah](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Milcah](https://discourse.scverse.org/u/Milcah)\
**Post date:** [May 1, 2024, 4:24pm UTC](https://discourse.scverse.org/t/scale-by-total-protein-counts-before-running-totalvi-to-eliminate-a-batch-effect-of-having-different-sequencing-depths/2249/1 "2024-05-01T16:24:31Z")

</div>

Hello,  
I am trying to scale by total protein counts before running totalVI to eliminate the batch effect).

More specifically,  
Prior to running TotalVI with data integrated from two independent experiments (two batches), I would like to normalize or scale protein counts for each cells. Is there an equivalent to the scanpy normalization function for genes (scanpy.pp.normalize\_total) for protein? Or, what is the best way to scale my protein count values prior to running TotalVI?

---

<div class="post-metadata">

**Author:** ![martinkim0](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/martinkim0/32/881_2.png) [@martinkim0](https://discourse.scverse.org/u/martinkim0)\
**Post date:** [May 1, 2024, 5:25pm UTC](https://discourse.scverse.org/t/scale-by-total-protein-counts-before-running-totalvi-to-eliminate-a-batch-effect-of-having-different-sequencing-depths/2249/2 "2024-05-01T17:25:07Z")

</div>

Hi, we don’t recommend scaling or normalizing protein counts prior to running totalVI since the generative model of totalVI uses a negative binomial distribution to model counts, thus normalized counts will not be suitable for this type of modeling. Hope this clarifies things.

---

<div class="post-metadata">

**Author:** ![Milcah](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@Milcah](https://discourse.scverse.org/u/Milcah)\
**Post date:** [May 1, 2024, 5:37pm UTC](https://discourse.scverse.org/t/scale-by-total-protein-counts-before-running-totalvi-to-eliminate-a-batch-effect-of-having-different-sequencing-depths/2249/3 "2024-05-01T17:37:38Z")

</div>

That makes sense. But, even so, is there a way I can scale the protein count values and round up to the nearest integer prior to TotalVI?

---

<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:** [May 3, 2024, 8:41pm UTC](https://discourse.scverse.org/t/scale-by-total-protein-counts-before-running-totalvi-to-eliminate-a-batch-effect-of-having-different-sequencing-depths/2249/4 "2024-05-03T20:41:09Z")

</div>

This is not recommended. Downsampling would be fine but it’s throwing away part of your data with potentially negative side effects. Maybe we start a step earlier: why do you want to do it? Do you get low integration without doing these steps and using totalVI?
