# Pseudobulk DE gene Analysis in scverse ecosystem

**URL:** <https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275>\
**Category:** scRNA-seq\
**Created:** [March 30, 2023, 12:39am UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275 "2023-03-30T00:39:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![wbrett87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/wbrett87/32/517_2.png) [@wbrett87](https://discourse.scverse.org/u/wbrett87)\
**Post date:** [March 30, 2023, 12:39am UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/1 "2023-03-30T00:39:45Z")

</div>

Hi Everyone,

I was wondering if there is a way to run a pseudobulk DE analysis within scanpy/scverse?

Thanks!!!

---

<div class="post-metadata">

**Author:** ![PauBadiaM](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/paubadiam/32/410_2.png) [@PauBadiaM](https://discourse.scverse.org/u/PauBadiaM)\
**Post date:** [March 30, 2023, 7:09am UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/2 "2023-03-30T07:09:56Z")

</div>

Hi @wbrett87

Recently we have added a vignette in `decoupler` showcasing how to do this in the scverse: [Pseudo-bulk functional analysis — decoupler 1.4.0 documentation](https://decoupler-py.readthedocs.io/en/latest/notebooks/pseudobulk.html)

Hope this is helpful!

---

<div class="post-metadata">

**Author:** ![wbrett87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/wbrett87/32/517_2.png) [@wbrett87](https://discourse.scverse.org/u/wbrett87)\
**Post date:** [March 30, 2023, 2:56pm UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/3 "2023-03-30T14:56:56Z")

</div>

Hi @PauBadiaM

Thanks for getting back to me! I tried using Decoupler, but I ran into issues because I dont have replicate samples. Are replicates always required for this kind of analysis.

---

<div class="post-metadata">

**Author:** ![PauBadiaM](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/paubadiam/32/410_2.png) [@PauBadiaM](https://discourse.scverse.org/u/PauBadiaM)\
**Post date:** [March 30, 2023, 3:09pm UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/4 "2023-03-30T15:09:25Z")

</div>

Oh I see. But then, may I ask, between which groups of samples do you plan on applying DE analysis if no replicates are available?

---

<div class="post-metadata">

**Author:** ![wbrett87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/wbrett87/32/517_2.png) [@wbrett87](https://discourse.scverse.org/u/wbrett87)\
**Post date:** [March 30, 2023, 3:16pm UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/5 "2023-03-30T15:16:57Z")

</div>

So I have three “conditions” (single cell experiments from the same tissue from mice with different genotypes). I would like to do DE between cluster A from condition 1 with cluster A from condition 2 and 3. Sorry if my question is naive!

---

<div class="post-metadata">

**Author:** ![wbrett87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/wbrett87/32/517_2.png) [@wbrett87](https://discourse.scverse.org/u/wbrett87)\
**Post date:** [March 30, 2023, 3:30pm UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/6 "2023-03-30T15:30:59Z")

</div>

I think I might have been confused about the use of the term replicate. When we refer to replicates, are we talking about biological replicates? Or genetically different samples considered as “replicates”?

---

<div class="post-metadata">

**Author:** ![PauBadiaM](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/paubadiam/32/410_2.png) [@PauBadiaM](https://discourse.scverse.org/u/PauBadiaM)\
**Post date:** [March 30, 2023, 3:32pm UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/7 "2023-03-30T15:32:21Z")

</div>

It’s okay, this forum is the right place to ask these questions 😉 . Then, I take that you have 3 different samples, one for each condition, and you want to compute DE analysis between them, is that right? Unfortunately, if no replicates per condition are present you cannot perform DE at the pseudobulk level. One strategy could be to build metacells, using [SEACells](https://github.com/dpeerlab/SEACells) for example, and then treat those as replicates, but they will still hold the same variability of the sample they come from.

---

<div class="post-metadata">

**Author:** ![PauBadiaM](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/paubadiam/32/410_2.png) [@PauBadiaM](https://discourse.scverse.org/u/PauBadiaM)\
**Post date:** [March 30, 2023, 3:34pm UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/8 "2023-03-30T15:34:53Z")

</div>

What I meant before is, inside each condition, do you have more than one sample? Or is it n=1? If n \>= 2 inside each condition, you can apply pseudobulk DE analysis.

---

<div class="post-metadata">

**Author:** ![wbrett87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/wbrett87/32/517_2.png) [@wbrett87](https://discourse.scverse.org/u/wbrett87)\
**Post date:** [March 30, 2023, 3:40pm UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/9 "2023-03-30T15:40:28Z")

</div>

So inside each condition we pooled tissue from three separate mice. Unfortunately, we did not hash the cells, so there is no way to separate them into replicates.

---

<div class="post-metadata">

**Author:** ![PauBadiaM](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/paubadiam/32/410_2.png) [@PauBadiaM](https://discourse.scverse.org/u/PauBadiaM)\
**Post date:** [March 30, 2023, 3:47pm UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/10 "2023-03-30T15:47:24Z")

</div>

Unfortunately, pseudobulking for DE analysis is not possible in this situation. I would still try to generate metacells per condition and then perform the DE on those, this way at least you work with less sparse data than with pure single cell. Good luck!

---

<div class="post-metadata">

**Author:** ![wbrett87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/wbrett87/32/517_2.png) [@wbrett87](https://discourse.scverse.org/u/wbrett87)\
**Post date:** [March 30, 2023, 4:38pm UTC](https://discourse.scverse.org/t/pseudobulk-de-gene-analysis-in-scverse-ecosystem/1275/11 "2023-03-30T16:38:49Z")

</div>

Ahh I see! Thanks for the tips, I will definitely check out SEAcell.
