
Calculate enrichment of DE genes in a gene set Compute one‐sided hypergeometric p-values, z-scores, and combined scores for a list of differentially expressed genes (deg
) against each entry in a list of gene sets (genesets
). Internal function
Source: R/compute_hyper_enrich_bg.R
compute_hyper_enrich_bg.Rd
Calculate enrichment of DE genes in a gene set
Compute one‐sided hypergeometric p-values, z-scores, and combined scores
for a list of differentially expressed genes (deg
) against each entry in
a list of gene sets (genesets
).
Internal function
Arguments
- deg
vector of differentially expressed genes
- genesets
list of genes per pathway from enrichr
- background
integer or
character
("human"
,"mouse"
, or"geneset"
). If"human"
, uses an approximate universe of 20 000 genes; if"mouse"
, 22 000; if"geneset"
, the total unique genes ingenesets
. You may also supply a custom integer (n
) equal to the exact size of your tested universe.
Examples
data(mini_mac)
treatment_samples="Staurosporine_0.1"
control_samples<-"DMSO_0"
top_table <- compute_single_de(mini_mac, treatment_samples, control_samples,
method = "limma_voom")
top_genes <- top_table$gene[top_table$p_value_adj<0.01]
data(genesets)
results <- compute_hyper_enrich_bg(top_genes, genesets)
head(results)
#> Term Overlap P.value Adjusted.P.value
#> Androgen Response Androgen Response 1/100 0.01985198 0.0394069
#> IL-2/STAT5 Signaling IL-2/STAT5 Signaling 1/199 0.03921281 0.0394069
#> Apical Junction Apical Junction 1/200 0.03940690 0.0394069
#> Xenobiotic Metabolism Xenobiotic Metabolism 1/200 0.03940690 0.0394069
#> Genes Combined.Score
#> Androgen Response ACTN1 27.16313
#> IL-2/STAT5 Signaling AHCY 15.58983
#> Apical Junction ACTN1 15.52386
#> Xenobiotic Metabolism AHCY 15.52386