Q-value for FDR correction in R stats package I used FDR correction (i.e., Benjamin-Hochberg tests) from the R 'Stats' package, but I'm confused of the q value used in the package. The notations in the 'p.adjust' function does not include the default setting for q values, which makes me feel a little less confident. For example, here is my original p-value list:
 p_raw <- c(8.133371e-04, 2.471103e-01, 3.343610e-03, 2.505031e-03, 2.887362e-06, 5.736712e-19, 8.955674e-03, 1.199260e-02, 7.698829e-04, 3.301545e-02, 1.126950e-03, 9.405598e-03)

Here is my R code for adjusting p-values:
p_adjust <- round(p.adjust(p_raw,method="BH"),3)

Here is the output for p_adjust:
0.002 0.247 0.006 0.005 0.000 0.000 0.013 0.014 0.002 0.036 0.003 0.013

I tried to calculate q values using the formula p_adjusted = (i/m)*q where i is the rank and m is the number of tests but did not get consistent q values for each p_adjust output. I wonder if anyone knows how the R 'Stats' package calculates this and what q value is the package using?

Thanks for COOLSerdash's prompt, I looked up the source code for p.adjust in stats package. Here is the part that's informative:
BH = {
    i <- lp:1L
    o <- order(p, decreasing = TRUE)
    ro <- order(o)
    pmin(1, cummin(n/i * p[o]))[ro]

Basically, stats uses a formula of m/i * raw_p to calculate the adjusted p instead of the traditional i/m * q. Therefore, there is no default q value in the R stats package FDR correction.
According to the R documentation of this p.adjust function, the original Benjamin-Hochberg (1995) paper was cited to support their method. The original paper used the p_raw <= i/m * q correction exactly as the procedure mentioned in this page. Therefore, just multiply the equation by m/i we get p_raw * m/i <= q. I assume the package uses p_raw * m/i to calculate adjusted p value and then it's upon us to decide what q value to use as criteria. I think it's commonly 0.05 or 0.1.
