Chapter 7 Functional enrichment analysis
This function utilises gProfiler as well, but this time to retrieve a functional enrichment analysis, similar to using their website: https://biit.cs.ut.ee/gprofiler/gost
There are various customisations that are possible, including automatically splitting the DE genes into positive and negative fold change prior to searching the database. It can also export tables for easier viewing.
This function takes the DE_results_objects
from the DE output list, accessed via GET_DESeq2_res_object()
.
This can take a while as it connects to an online server to conduct the search.
#DE_results_objects from DE_out
<- GET_DESeq2_res_object(auto_DE_output = DE_out)
DE_results_objects
#view names
names(DE_results_objects)
## [1] "ARC_DESeq2_Output.LR vs MAL" "ARC_DESeq2_Output.LR vs LAL"
## [3] "ARC_DESeq2_Output.MAL vs LAL" "LHA_DESeq2_Output.LR vs MAL"
## [5] "LHA_DESeq2_Output.LR vs LAL" "LHA_DESeq2_Output.MAL vs LAL"
## [7] "VMH_DESeq2_Output.LR vs MAL" "VMH_DESeq2_Output.LR vs LAL"
## [9] "VMH_DESeq2_Output.MAL vs LAL" "ABO_DESeq2_Output.LR vs MAL"
## [11] "ABO_DESeq2_Output.LR vs LAL" "ABO_DESeq2_Output.MAL vs LAL"
## [13] "DUO_DESeq2_Output.LR vs MAL" "DUO_DESeq2_Output.LR vs LAL"
## [15] "DUO_DESeq2_Output.MAL vs LAL" "RUM_DESeq2_Output.LR vs MAL"
## [17] "RUM_DESeq2_Output.LR vs LAL" "RUM_DESeq2_Output.MAL vs LAL"
## [19] "LIV_DESeq2_Output.LR vs MAL" "LIV_DESeq2_Output.LR vs LAL"
## [21] "LIV_DESeq2_Output.MAL vs LAL"
<-
gprofiler_output enrich_DE(list_DE_obj = DE_results_objects,
sig_thresh = 0.05,
log2_thresh = 0,
split_by_pos_neg = TRUE,
gene_annotations = gene_annot,
organism = "btaurus",
base_URL = "http://biit.cs.ut.ee/gprofiler_archive3/e100_eg47_p14",
export_tables = TRUE,
export_dir = "./outputs/gProfiler/")
## Filtering data...
## Filtering data... COMPLETE
## g:Profiler Version URL: http://biit.cs.ut.ee/gprofiler_archive3/e100_eg47_p14
## Running gprofiler2::gost()...
## Running gprofiler2::gost()... COMPLETE
## Reformatting dataframe...
## Reformatting dataframe... COMPLETE
## Split and sort dataframe...
## Split and sort dataframe... COMPLETE
## Directory created: ./outputs/gProfiler/
## gProfiler functional enrichment tables exported to an .xlsx file in the sub-directory: ./outputs/gProfiler/