# Potential bug in scvi.model.TOTALVI.setup\_mudata

**URL:** <https://discourse.scverse.org/t/potential-bug-in-scvi-model-totalvi-setup-mudata/3822>\
**Category:** scvi-tools\
**Created:** [October 9, 2025, 10:12pm UTC](https://discourse.scverse.org/t/potential-bug-in-scvi-model-totalvi-setup-mudata/3822 "2025-10-09T22:12:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![igrisch](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/igrisch/32/1506_2.png) [@igrisch](https://discourse.scverse.org/u/igrisch)\
**Post date:** [October 9, 2025, 10:12pm UTC](https://discourse.scverse.org/t/potential-bug-in-scvi-model-totalvi-setup-mudata/3822/1 "2025-10-09T22:12:04Z")

</div>

Hi there, I am using the most recent github version of scvi and have been running into this potential bug when I try to set up my data. It occurs when I use mudata or anndata.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/forum11/original/2X/8/8ee84a22d088b9ecc32f4c797972e6e826298366.png)

Basically, it looks like something is happening in the setup that causes the function to cut off the column name of my batch/covariate variable at the first letter. Some other things that may help:

- Removing both the batch and covariate parameters resolves the bug. However, my data has strong batch effect, so I need to be able to use those parameters.
- Renaming my batch/covariate columns to be single-letter does actually get me a step further, but then I get a separate bug: `ValueError: Obsm ‘_scvi_extra_categorical_covs’ needs to be of one of <class ‘numpy.ndarray’>, <class ‘numpy.ma.core.MaskedArray’>, <class ‘scipy.sparse._csr.csr_matrix’>, <class ‘scipy.sparse._csc.csc_matrix’>, <class ‘scipy.sparse._csr.csr_array’>, <class ‘scipy.sparse._csc.csc_array’>, <class ‘h5py._hl.dataset.Dataset’>, <class ‘zarr.core.array.Array’>, <class ‘anndata.compat.ZappyArray’>, <class ‘anndata.abc.CSRDataset’>, <class ‘anndata.abc.CSCDataset’>, <class ‘anndata.compat.DaskArray’>, <class ‘anndata.compat.CupyArray’>, <class ‘anndata.compat.CupySparseMatrix’>, <class ‘anndata.compat.AwkArray’>, or <class ‘xarray.core.dataarray.DataArray’>, not <class ‘pandas.core.series.Series’>.` I’m still trying to figure out how to get past this issue.
- This entire step worked perfectly with the same data and parameters in an older version of scvi (1.2.2.post2), so it might be a dependency thing?

Does anyone know how I might go about fixing this? 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:** [October 10, 2025, 5:27am UTC](https://discourse.scverse.org/t/potential-bug-in-scvi-model-totalvi-setup-mudata/3822/2 "2025-10-10T05:27:03Z")

</div>

Hi, categorical\_covariate\_key is supposed to be a list. It otherwise treats the string as an iterative of single letters.

---

<div class="post-metadata">

**Author:** ![igrisch](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/igrisch/32/1506_2.png) [@igrisch](https://discourse.scverse.org/u/igrisch)\
**Post date:** [October 10, 2025, 4:30pm UTC](https://discourse.scverse.org/t/potential-bug-in-scvi-model-totalvi-setup-mudata/3822/3 "2025-10-10T16:30:03Z")

</div>

Fixed it, thank you so much!
