The following Matlab project contains the source code and Matlab examples used for fast algorithm for the log p value of fisher's exact test or hypergeometric distribution.
example: after identifying a list of 30 genes from the entire genome of
20000 genes, 5 genes are related to cycle, while there are totally 200
cell cylce gene in the genome, then the log p-value will be:
% or, in 10 based log p-value
% or, the decimal p-value
This is to say, 5 genes are in gene list,
and related to cell cycle; 25 genes are in the gene list but not related
to cell cycle; 195 genes are related to cell cycle but not in the gene
list; 19775 genes are not in the gene list and not related to cell cycle.