# Scvi labels\_key

**URL:** <https://discourse.scverse.org/t/scvi-labels-key/859>\
**Category:** scvi-tools\
**Tags:** scvi\
**Created:** [October 24, 2022, 6:00am UTC](https://discourse.scverse.org/t/scvi-labels-key/859 "2022-10-24T06:00:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wangjiawen2013](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/wangjiawen2013/32/25_2.png) [@wangjiawen2013](https://discourse.scverse.org/u/wangjiawen2013)\
**Post date:** [October 24, 2022, 6:00am UTC](https://discourse.scverse.org/t/scvi-labels-key/859/1 "2022-10-24T06:00:37Z")

</div>

Hi,  
scvi-tools is the best tools i’ve used to integrate different datasets. However, I am not familiar with the parameter "labels\_key. In my case, I have already assigned the cell types to each cell in each datasets. Then I want integrate the datasets together. I registered the model like  
scvi.model.SCVI.setup\_anndata(adata,layer=“counts”,batch\_key=“experiment\_no”,labels\_key=“cell type”).  
Is it right ? when to set labels\_key and what’s the function of it ?

---

<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:** [October 25, 2022, 12:54am UTC](https://discourse.scverse.org/t/scvi-labels-key/859/2 "2022-10-25T00:54:40Z")

</div>

> [@wangjiawen2013](#):
>
> scvi.model.SCVI.setup\_anndata(adata,layer=“counts”,batch\_key=“experiment\_no”,labels\_key=“cell type”).

For scvi only it doesn’t do much, it allows using gene-label specific inverse dispersion parameters, which won’t be of much use to you.

I’d take a look at this tutorial:

[https://docs.scvi-tools.org/en/stable/tutorials/notebooks/harmonization.html#Integration-with-scANVI](https://docs.scvi-tools.org/en/stable/tutorials/notebooks/harmonization.html#Integration-with-scANVI)

As it shows how to use the labels to improve integration.
