FDR calculation for each p value I am trying to understand how FDR is calculated and what to understand from it. I selected R as language so the example is in R 
Lets look at an example of 10 samples 
df<- structure(list(Names = structure(c(1L, 3L, 4L, 5L, 6L, 7L, 8L, 
9L, 10L, 2L), .Label = c("Sample1", "Sample10", "Sample2", "Sample3", 
"Sample4", "Sample5", "Sample6", "Sample7", "Sample8", "Sample9"
), class = "factor"), p_value_1 = c(0.01, 0.02, 0.03, 0.05, 0.013, 
0.014, 0.019, 0.35, 0.5, 0.63)), class = "data.frame", row.names = c(NA, 
-10L))

To calculate FDR values , one should use adjusted-p_value which I think is influenced by the size of the sample , how ? I don't know. One can calculate it based on different method for example  
FDR <- p.adjust(df$p_value_1, method="fdr")

I came across a study which I cannot understand. is the following formula FDR? 

 A: How to do the math
To adjust for multiple comparisons using the Benjamini-Hochberg procedure for controlling the False Discovery Rate (FDR) of $\alpha$ on $m$ different tests ($m$ is not sample size):


*

*Compute the p-value for each test.

*Order the p-values from largest to smallest.

*In the first (ordered) test ($i=1$), compare the p­-value to $\frac{\alpha\times(m+1–1)}{m}$ (if you are using, say, $p=P(|T|>|t|)$ for two-tailed tests, if using $p=P(T>|t|)$, then replace $\alpha$ with $\alpha/2$).

*In the second test ($i=2$), compare the p­-value to $\frac{\alpha\times(m+1–2)}{m}$.

*In the third test ($i=3$), compare the p­-value to $\frac{\alpha\times(m+1–3)}{m}$.

*In the ith test, compare the p­-value to $\frac{\alpha\times(m+1–i)}{m}$.

*Using Benjamini & Hochberg’s method, we reject all tests including and following the first test for which we reject the null hypothesis. 


Adjusted p-values simply invert the above math to transform p, instead of alter the rejection threshold. So reject if $p \le \frac{\alpha (m+1–i)}{m}$ becomes reject if $\frac{mp}{(m+1–i)} \le \alpha$
Important things to note about adjusted p values 


*

*Adjusted p-values can be computed as $>1$ which is incoherent, since p-values are supposed to be probabilities. These are typically reported simply as $1$.

*One cannot determine whether any given test is significant or not simply by looking at the adjusted p-values alone, since these decisions also depend on the ordering of the unadjusted p-values.

*p.adjust() for some reason has a arithmetic error relative to Benjamini & Hochberg: the first two adjusted p values it reports are always given the same value in my experience.

