Fisher's Exact Test for Competitive Gene-set Enrichment
Outline
To run these functions you need:
- a collection of gene-sets, in list format
- the set of genes to be tested (i.e. "experimental genes"), in character format
- the gene universe-set (e.g. all genes on your experimental platform)
Notes:
- all sets are restricted to the universe within both functions
- the FDR estimation takes quite a bit of time with 2000 iterations; efficiency suggestions welcome!
Code
Function to generate FET p-values and other simple statistics
Fisher_Enrichment_13.R- Function to empirically estimate FDR q-value (random generation of experimental gene-set)
enr.df <- f.Enr_Fisher (
GS.ls = , # list, slot names = gene-set IDs, slot content = gene IDs
GS_names.chv = , # character array, values = gene-set IDs, names = gene-set full names
exp.genes = , # character array, values = experimental gene IDs
uni.genes = # character array, values = all the genes in the platform
)
enr.df$FDR <- f.Fisher_FDR (
GS.ls = , # as above
exp.genes = , # as above
uni.genes = , # as above
pval_obs.nv = enr.df$pvalue,
iter.n = , # numeric value (default 2000)
)