# Extracting Normalized Expression from Trained Model on Variable Subset

**URL:** <https://discourse.scverse.org/t/extracting-normalized-expression-from-trained-model-on-variable-subset/2155>\
**Category:** scvi-tools\
**Tags:** scvi\
**Created:** [March 13, 2024, 3:38pm UTC](https://discourse.scverse.org/t/extracting-normalized-expression-from-trained-model-on-variable-subset/2155 "2024-03-13T15:38:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abbass2](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/abbass2/32/884_2.png) [@abbass2](https://discourse.scverse.org/u/abbass2)\
**Post date:** [March 13, 2024, 3:38pm UTC](https://discourse.scverse.org/t/extracting-normalized-expression-from-trained-model-on-variable-subset/2155/1 "2024-03-13T15:38:19Z")

</div>

Hello, apologies for a somewhat trivial question.

I am trying to extract the normalized expression matrix from my trained model, which was done so on a subset of variable genes. I want to plot a heatmap of the expression but not all of my curated markers appear in the variable genes list used to train the model. I was under the impression I could still extract normalized expression for any gene regardless of whether it was used to train the model. Is this correct or do I need to retrain the model including genes of interest to extract their denoised-normalized expression for visualization?

Thanks in advance!

---

<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:** [March 14, 2024, 7:18pm UTC](https://discourse.scverse.org/t/extracting-normalized-expression-from-trained-model-on-variable-subset/2155/2 "2024-03-14T19:18:16Z")

</div>

Hi, scVI models can only generate gene expression for genes used during training, so yes you would have to retrain your model.

---

<div class="post-metadata">

**Author:** ![abbass2](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/abbass2/32/884_2.png) [@abbass2](https://discourse.scverse.org/u/abbass2)\
**Post date:** [March 14, 2024, 8:31pm UTC](https://discourse.scverse.org/t/extracting-normalized-expression-from-trained-model-on-variable-subset/2155/3 "2024-03-14T20:31:18Z")

</div>

Okay yes I thought so, just wanted to confirm. Thanks for that!
