Skip to contents

This function performs enrichment analysis for transcription factor (TF) modules using known TF-target interactions. For each module, it takes the hub TFs and retrieves their known targets from the CollecTRI database. It then conducts an over-representation analysis (ORA) against the Reactome pathway database. To reduce redundancy, only unique pathways per module are retained by filtering out overlaps between modules.

Usage

compute.modules.enrichment(RNA.tpm, hub_tfs)

Arguments

RNA.tpm

A numeric matrix of normalized gene expression values. Rows are gene symbols, columns are samples. This matrix is used to restrict the universe of genes used in enrichment and validate TF-target gene presence.

hub_tfs

A list of hub TFs per module, typically obtained using identify_hub_TFs(). This should be a list of two elements: one with named hub TFs per module, and another with their module membership or additional metadata.

Value

No object is returned. For each module with significant enrichment (adjusted p-value < 0.05), a dot plot is saved in the Results/ directory as a PDF file named Enrichment_Reactome_Module_<color>.pdf. If no enrichment is found for a module, a message is printed and no file is saved for that module.

Details

The function uses the decoupleR::get_collectri() function to obtain TF-target relationships (cached in Results/TF_target_collection_CollecTRI.csv), and ReactomePA::enrichPathway() for ORA using the Reactome database. The ORA input is the 20% most variable targets of the module's hub TFs (at least one gene). Pathways enriched in more than one module are removed, so only module-specific results are kept.

Examples

if (FALSE) { # \dontrun{
# Identify hub TFs from a TF activity matrix and WGCNA network
hub_tfs <- identify_hub_TFs(t(tfs_activity), wgcna_network, MM_thresh = 0.8, degree_thresh = 0.9)

# Perform module-level Reactome enrichment
compute.modules.enrichment(counts.norm, hub_tfs)
} # }