View source: R/EnrichCirclize.R
adjust_export_pathway | R Documentation |
This function processes a dataframe containing fgsea results. It adjusts pathway names by removing underscores, converting to lowercase, then capitalizing the first letter, and joining the components with spaces. It selects and merges the top upregulated and downregulated pathways based on enrichment score (ES) and p-value.
adjust_export_pathway(fgseaRes, nTop = 10)
fgseaRes |
Dataframe containing fgsea results with columns 'pathway', 'ES', and 'pval'. |
nTop |
Integer, number of top pathways to select based on the p-value. |
A vector containing combined top upregulated and downregulated pathways.
# Create a synthetic fgseaRes dataframe
fgseaRes <- data.frame(
pathway = c("KEGG_APOPTOSIS",
"GO_CELL_CYCLE",
"REACTOME_DNA_REPAIR",
"KEGG_METABOLISM",
"GO_TRANSPORT"),
ES = c(0.45, -0.22, 0.56, -0.35, 0.33),
pval = c(0.001, 0.02, 0.0003, 0.05, 0.01)
)
# Run the function to get top pathways
result <- adjust_export_pathway(fgseaRes = fgseaRes, nTop = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.