# Question about differential expression and the batch\_correction usage

**URL:** <https://discourse.scverse.org/t/question-about-differential-expression-and-the-batch-correction-usage/2323>\
**Category:** scvi-tools\
**Tags:** diff-exp, scvi\
**Created:** [June 7, 2024, 3:17pm UTC](https://discourse.scverse.org/t/question-about-differential-expression-and-the-batch-correction-usage/2323 "2024-06-07T15:17:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scuser](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@scuser](https://discourse.scverse.org/u/scuser)\
**Post date:** [June 7, 2024, 3:17pm UTC](https://discourse.scverse.org/t/question-about-differential-expression-and-the-batch-correction-usage/2323/1 "2024-06-07T15:17:06Z")

</div>

Hello,

Say I train a model using categorical covariates to correct for donors/biological replicates, but the scRNA experiment was run in one “batch” (that is, on one flow cell/sequencing run) with a treated and untreated groups. The way I setup\_anndata is with the following:

setup\_anndata(adata, layer = “X\_Scar\_Denoised\_Counts”,  
categorical\_covariate\_keys=[“Sample”],  
continuous\_covariate\_keys=[‘pct\_counts\_mt’, ‘total\_counts’])

then I train the model and run differential expression using model.differential\_expression(). My question is in this case, when I call the differential expression function, does it make sense to have the batch\_correction in the function when I wish to compare treated vs untreated populations?

Another question I have is that many of the calculated differentially expressed genes have 0 or near 0 normalized expression in the untreated group, and some expression in the treated. Is there a good way to filter so that there is a min expression value?

Thanks
