# Best way to rank genes for GSEA analysis

**URL:** <https://discourse.scverse.org/t/best-way-to-rank-genes-for-gsea-analysis/1043>\
**Category:** scvi-tools\
**Tags:** diff-exp, scvi\
**Created:** [January 9, 2023, 3:07pm UTC](https://discourse.scverse.org/t/best-way-to-rank-genes-for-gsea-analysis/1043 "2023-01-09T15:07:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![munta](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@munta](https://discourse.scverse.org/u/munta)\
**Post date:** [January 9, 2023, 3:07pm UTC](https://discourse.scverse.org/t/best-way-to-rank-genes-for-gsea-analysis/1043/1 "2023-01-09T15:07:01Z")

</div>

Hi there,  
Thanks for the tool. I have used scvi differential expression to get DE genes. Now, I want to proceed to do GSEA analysis (with another tool) so I have to rank the genes for that. Generally, I use sign(lfc)\*pvalue for ordering genes. But, in scvi de results there is no p-value (I got delta=0.25 for all genes). Also, not sure which should I use lfc\_mean or lfc\_median? So, do you have any idea that you can help me with regarding this. Many thanks.

---

<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:** [January 23, 2023, 11:14pm UTC](https://discourse.scverse.org/t/best-way-to-rank-genes-for-gsea-analysis/1043/2 "2023-01-23T23:14:58Z")

</div>

> [@munta](#):
>
> Thanks for the tool. I have used scvi differential expression to get DE genes. Now, I want to proceed to do GSEA analysis (with another tool) so I have to rank the genes for that. Generally, I use sign(lfc)\*pvalue for ordering genes. But, in scvi de results there is no p-value (I got delta=0.25 for all genes). Also, not sure which should I use lfc\_mean or lfc\_median? So, do you have any idea that you can help me with regarding this. Many thanks.

You can use the Bayes factor, where higher would indicate more likelihood of the hypothesis that there is differential expression (note that this is not interpreted exactly the same as a p-value).

I would start with LFC median as it’s more likely to get the sign correct, where mean can be influenced by outliers.

---

<div class="post-metadata">

**Author:** ![aj95b](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/aj95b/32/1070_2.png) [@aj95b](https://discourse.scverse.org/u/aj95b)\
**Post date:** [June 4, 2024, 10:50pm UTC](https://discourse.scverse.org/t/best-way-to-rank-genes-for-gsea-analysis/1043/3 "2024-06-04T22:50:24Z")

</div>

@munta@PierreBoyeau  
I don’t think this is correct. With GSEA, you need to be able to asses if a pathway is enriched positively or negatively between treatment and controls. So you do need to rank the genes in a way that makes sense with direction of regulation. @munta For volcano plots the scVI tutorial uses ‘proba\_not\_de’ as equivalent to p-value to compute a -log10(proba\_not\_de) score, it has made sense in my analyses to rank with sign(lfc\_median)\*(-log10(proba\_not\_de))

---

<div class="post-metadata">

**Author:** ![munta](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@munta](https://discourse.scverse.org/u/munta)\
**Post date:** [June 5, 2024, 10:01pm UTC](https://discourse.scverse.org/t/best-way-to-rank-genes-for-gsea-analysis/1043/4 "2024-06-05T22:01:32Z")

</div>

Thanks @aj95b for that and you are right I did the same by taking (proba\_not\_de) as I wasn’t convinced to take bayes factor (@adamgayoso no offence).
