# Benjamini-Hochberg and GEO2R

I'm currently using GEO2R to analyze a microarray data set. There is an option to generate the 250 most statistically significant genes, which calculates an adjusted p-value using the Benjamini-Hochberg method to control the false discovery rate.

My understanding of the Benjamini-Hochberg process is that you first calculate the p-values, then sort and rank the p-values. The smallest value gets a 1, the second 2, and the largest N. The p-values are multiplied by N and divided by its assigned rank.

My question is, is N the total number of genes (54715) or does GEO2R only calculate the Benjamini Hochberg adjusted p-value on the smallest 250 p-values?

GEO2R uses the limma package from bioconductor to do its analysis. The main function used is called topTable, which refers back to the toptable function. Internally the toptable function takes the top $n$ snps from the analysis and only calculates the adjusted P values for those $n$ SNPs, and not the total number of genes. The source code of toptable can be viewed (once the limma package is installed) through getAnywhere(toptable). I can append it to this answer if you would like. Hope this helps!