Between the qvalue package and the p.adjust function, which is more appropriate to use when trying to calculate the q-values of a dataset? According to the manual for the q-value package, the q-value calculated is not an adjusted p-value which is what the p.adjust function would return. There seems to be an equal amount of people that use one or the other, but I wanted to see other opinions that could help clarify what would be most appropriate to use.

• "then q-value is equal to FDR" Does it mean if I use the parameter"pi0=1" in qvalue(), the outcome will be equal to adjust.P(pvalues,"BH")? Could you explain it by citing an example? Any answer is appreciated!Thanks a lot!
– Yang
Oct 13 '21 at 9:33

p.adjust can calculate adjusted p-values with different methods. I think you can choose Bonferroni correction and BH correction, for instance. BH correction gives you False Discovery Rate (FDR), which is one of the most commonly used I guess.
Q-value is different and cannot be calculated by p.adjust. The idea is that when you have many p-values to adjust, they form a distribution. If all p-values come from the null hypothesis, the p-value distribution is going to be uniform on [0, 1]. But usually, our p-values are a mixture of the null distribution and alternative distribution. The parameter $$\pi_0$$ describes the proportion of p-values (or tests) that comes from the null hypothesis. To calculated q-values, the algorithm first estimates $$\pi_0$$, then calculates the q-value.
Note that if you set $$\pi_0=1$$, which means that you believe all the p-values come from the null distribution, then q-value is equal to FDR.