Skip to contents

Extracts significant GO terms (adjusted p-value < 0.05) from an enrichResult object and pairs them with fold-change information from a differential-expression table. The output is a list containing: (1) a named list of gene-set members (collection), (2) a data frame of mean log2 fold-changes per pathway (results_set), and (3) the unique set of DE genes (de_genes). These three components are the required inputs for generate_overlap_network.

Usage

build_network_inputs(ego, de_df)

Arguments

ego

An enrichResult object (or coercible via as.data.frame) produced by clusterProfiler::enrichGO or a similar ORA function. Must contain columns Description, p.adjust, and geneID (slash-delimited gene symbols).

de_df

A data frame of differentially expressed genes with at least columns gene and avg_log2FC.

Value

A list with three elements:

collection

Named list of character vectors; each element contains the gene symbols associated with one GO term.

results_set

Data frame with one row per GO term and a single column avg_log2FC giving the mean fold-change of DE genes in that term's gene set.

de_genes

Character vector of unique DE gene symbols.

Returns NULL if no significant terms pass filtering.