# How are q-values for pearson correlation are calculated?

**URL:** <https://forum.depmap.org/t/how-are-q-values-for-pearson-correlation-are-calculated/2143>\
**Category:** Q&A\
**Created:** [December 19, 2022, 3:47am UTC](https://forum.depmap.org/t/how-are-q-values-for-pearson-correlation-are-calculated/2143 "2022-12-19T03:47:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anh\_Nguyen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.depmap.org/anh_nguyen/32/361_2.png) [@Anh\_Nguyen](https://forum.depmap.org/u/Anh_Nguyen)\
**Post date:** [December 19, 2022, 3:47am UTC](https://forum.depmap.org/t/how-are-q-values-for-pearson-correlation-are-calculated/2143/1 "2022-12-19T03:47:53Z")

</div>

Hello,  
I was looking for pearson correlation between a gene expression and the drug sensitivity dataset using the custom analyses tool. I am wondering how the q values are calculated because they are very small compared to the adjusted p-values I calculated myself using BH methods.  
Thank you so much for your help!

---

<div class="post-metadata">

**Author:** ![dllahr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.depmap.org/dllahr/32/23_2.png) [@dllahr](https://forum.depmap.org/u/dllahr)\
**Post date:** [December 20, 2022, 1:17am UTC](https://forum.depmap.org/t/how-are-q-values-for-pearson-correlation-are-calculated/2143/2 "2022-12-20T01:17:06Z")

</div>

This thread provides links to the methodology / underlying methods - that might explain the difference you’re seeing:

> [@Details on methodology of “Two Class Comparison”](https://forum.depmap.org/t/details-on-methodology-of-two-class-comparison/211):
>
> Would it be possible to include some details on the two class comparison custom analysis method? I assume it’s a two sample hypothesis test with some form of multiple hypothesis correction, but the exact method that is used would be useful for reporting and reproducibility. It’s a great tool overall though, really has sped up the process of working through a lot of datasets quickly.

---

<div class="post-metadata">

**Author:** ![Anh\_Nguyen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.depmap.org/anh_nguyen/32/361_2.png) [@Anh\_Nguyen](https://forum.depmap.org/u/Anh_Nguyen)\
**Post date:** [December 20, 2022, 3:36am UTC](https://forum.depmap.org/t/how-are-q-values-for-pearson-correlation-are-calculated/2143/3 "2022-12-20T03:36:49Z")

</div>

Thank you for your response!  
In the R script, the function p.adjust(method = ‘BH’) was used and I used the same function but I still can’t get the same p-value.  
And the link you suggested me is referring to two-class comparison tool, but I would like to know about the pearson correlation. Can I have the link to that script also?

---

<div class="post-metadata">

**Author:** ![pmontgom](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.depmap.org/pmontgom/32/4_2.png) [@pmontgom](https://forum.depmap.org/u/pmontgom)\
**Post date:** [December 20, 2022, 7:02pm UTC](https://forum.depmap.org/t/how-are-q-values-for-pearson-correlation-are-calculated/2143/4 "2022-12-20T19:02:49Z")

</div>

For the pearson correlations, we are using using R’s p.adjust(method=‘fdr’). According to the docs, that ‘fdr’ should be synonymous with ‘BH’, it should report the same q-value.

However, looking at the UI, I don’t see a way to download the q-values, only the uncorrected p-values. (I imagine that was an oversight in making the download. Our plot has the uncorrected p-value and we’re coloring by a threshold on the q-value, so I imagine it’d be good to include both in the download.)

Are you looking at the p-value column and expecting it to be a corrected p-value? If so, that’s likely the source of confusion.

Thanks,  
Phil

---

<div class="post-metadata">

**Author:** ![Anh\_Nguyen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.depmap.org/anh_nguyen/32/361_2.png) [@Anh\_Nguyen](https://forum.depmap.org/u/Anh_Nguyen)\
**Post date:** [December 21, 2022, 3:53am UTC](https://forum.depmap.org/t/how-are-q-values-for-pearson-correlation-are-calculated/2143/5 "2022-12-21T03:53:37Z")

</div>

Hello,  
I know the plot only shows uncorrected p-values, so I downloaded the whole table to get the q-values. However, when I use those uncorrected p-values in the downloaded table to calculated the q-value myself, the results are different compared to the q-values provided in the downloaded table. The function I used is p.adjust(df$PValue, method = ‘fdr’), in which ‘df’ is the table I downloaded from DepMap.  
Thank you for your help!  
Anh Nguyen
