This function takes the objects generated from pathEnrich
.
If performing a dfferential enrichment analysis, the user will have 2 objects. There
will be one for the genes of interest in gene list 1 and one for the genes of interest in gene list 2 (see example for pathEnrich
).
This function then uses a Fisher's Exact test to identify differentially enriched
pathways between the terms enriched in the gene-of-interest lists. diffEnrich
will remove KEGG pathways that do not contain any genes from either gene list as these
cannot be tested, and will print a warning message telling the user how many pathways
were removed.
diffEnrich
returns a dataframe containing differentially enriched
pathways with their associated estimated odds ratio, unadjusted p-value, and fdr adjusted
p-value. S3 generic functions for print
and summary
are
provided. The print
function prints the results table as a tibble
, and the
summary
function returns the number of pathways that reached statistical significance
as well as their descriptions, the number of genes used from the KEGG data base, the KEGG species,
the number of pathways that were shared (and therefore tested) between the gene lists and the
method used for multiple testing correction.
diffEnrich(list1_pe, list2_pe, method = "BH", cutoff = 0.05)# S3 method for diffEnrich
print(x, ...)
# S3 method for diffEnrich
summary(object, ...)
object of class pathEnrich
generated from pathEnrich
.
See example for pathEnrich
.
object of class pathEnrich
generated from pathEnrich
.
See example for pathEnrich
.
character. Character string telling diffEnrich
which method to
use for multiple testing correction. Available methods are thos provided by
p.adjust
, and the default is "BH", or False Discovery Rate (FDR).
Numeric. The p-value threshold to be used as the cutoff when determining statistical significance, and used to filter list of significant pathways.
object of class diffEnrich
Unused
object of class diffEnrich
A list object of class diffEnrich
that contains 5 items:
The species used in enrichment
The method used to correct for multiple testing for the differential enrichment
The KEGG pathways the reached statistical significance after multiple testing correction.
the number of pathways that were shared (and therefore tested) between the gene lists.
A data frame that summarizes the results of the differential enrichment analysis and contains the following variables:
KEGG Pathway Identifier
Description of KEGG Pathway (provided by KEGG)
Number of Genes in KEGG Pathway
Number of Genes in KEGG Database
Number of Genes from gene list 1 in KEGG Pathway
Number of Genes from gene list 1 in KEGG Database
Expected number of genes from list 1 to be in KEGG pathway by chance (i.e., not enriched)
P-value for enrichment of list 1 genes related to KEGG pathway
Multiple testing adjustment of enrich_p_list1 (default = False Discovery Rate (Benjamini and Hochberg))
KEGG_PATHWAY_in_list1/expected_list1
Number of Genes from gene list 2 in KEGG Pathway
Number of Genes from gene list 2 in KEGG Database
Expected number of genes from list 2 to be in KEGG pathway by chance (i.e., not enriched)
P-value for enrichment of list 2 genes related to KEGG pathway
Multiple testing adjustment of enrich_p_list2 (default = False Discovery Rate (Benjamini and Hochberg))
KEGG_PATHWAY_in_list2/expected_list2
Odds of a gene from list 2 being from this KEGG pathway / Odds of a gene from list 1 being from this KEGG pathway
P-value for differential enrichment of this KEGG pathway between list 1 and list 2
Multiple testing adjustment of diff_enrich_p (default = False Discovery Rate (Benjamini and Hochberg))
# NOT RUN {
## Generate individual enrichment reults
list1_pe <- pathEnrich(gk_obj = kegg, gene_list = geneLists$list1)
list2_pe <- pathEnrich(gk_obj = kegg, gene_list = geneLists$list2)
## Perform differential enrichment
dif_enrich <- diffEnrich(list1_pe = list1_pe, list2_pe = list2_pe, method = 'none', cutoff = 0.05)
# }
Run the code above in your browser using DataLab