The standard over-representation (Fisher / hypergeometric) test against a set of pathway memberships. With a universe of N genes, a pathway containing m of them, a selected list of n genes and q of those in the pathway, the one-sided p-value is the upper hypergeometric tail. The tail sum is formed in log space through the log-gamma function; p-values across pathways are adjusted by the Benjamini-Hochberg step-up procedure. Membership is passed as indicator vectors over a fixed gene universe so that both language arms index genes identically.
Value
List with estimate (smallest p-value), pvalue,
qvalue, overlap, pathway_size,
top_pathway, n_significant, significant,
n_selected, n_pathways, alpha, n,
method.
References
Kanehisa, Furumichi, Tanabe, Sato and Morishima (2017), KEGG: new perspectives on genomes, pathways, diseases and drugs, Nucleic Acids Research 45(D1):D353-D361, doi:10.1093/nar/gkw1092 ; Benjamini and Hochberg (1995), JRSS-B 57(1):289-300. doi:10.1111/j.2517-6161.1995.tb02031.x
Examples
genes <- c(1, 0, 1, 0, 1)
kegg_pathways <- matrix(c(1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0),
5, 3, byrow = TRUE)
Keggp(genes, kegg_pathways)
#> $estimate
#> [1] 0.1
#>
#> $pvalue
#> [1] 0.7 0.1 0.9
#>
#> $qvalue
#> [1] 0.9 0.3 0.9
#>
#> $overlap
#> [1] 2 3 1
#>
#> $pathway_size
#> [1] 3 3 2
#>
#> $top_pathway
#> [1] 1
#>
#> $n_significant
#> [1] 0
#>
#> $significant
#> [1] 0 0 0
#>
#> $n_selected
#> [1] 3
#>
#> $n_pathways
#> [1] 3
#>
#> $alpha
#> [1] 0.05
#>
#> $n
#> [1] 5
#>
#> $method
#> [1] "hypergeometric P(X >= q) per pathway with Benjamini-Hochberg FDR, Kanehisa et al (2017)"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
