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:
ln_p=log_hypergeometric(5,30,200,20000);
% or, in 10 based log p-value
lg_p=log_hypergeometric(5,30,200,20000)/log(10);
% or, the decimal p-value
p=exp(log_hypergeometric(5,30,200,20000));
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.

The source code and files included in this project are listed in the project files section, please make sure whether the listed source code meet your needs there.

## Project Files:

File Name | Size |
---|---|

license.txt | 1308 |

Efficient Calculation of the log p-value of Fisher Test.pdf | 273882 |

log_fisher_test.m | 1657 |

log_hypergeometric.m | 1356 |