### getALLEG - Get All Entrez Gene IDs Source: https://context7.com/yulab-smu/reactomepa/llms.txt Retrieves all Entrez gene IDs for a specified organism from the corresponding annotation database. ```APIDOC ## getALLEG - Get All Entrez Gene IDs ### Description The `getALLEG()` function retrieves all Entrez gene IDs for a specified organism from the corresponding annotation database. This is useful for defining background gene universes in enrichment analyses or for filtering gene lists. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```r library(ReactomePA) # Get all Entrez gene IDs for human human_genes <- getALLEG("human") length(human_genes) # Get all genes for other organisms mouse_genes <- getALLEG("mouse") yeast_genes <- getALLEG("yeast") ``` ### Response Returns a character vector containing all Entrez gene IDs for the specified organism. ``` -------------------------------- ### Visualize Pathway with Fold Change Overlay Source: https://context7.com/yulab-smu/reactomepa/llms.txt Use `viewPathway()` to create a network visualization of a REACTOME pathway. Genes are nodes, interactions are edges. Optionally overlay fold change data using color gradients. Requires `ReactomePA` library. ```r library(ReactomePA) # Define fold change data for genes (optional) foldChange <- c( "11171" = 2.5, "8243" = -1.8, "2194" = 3.2, "1017" = -0.5, "249" = 1.9 ) # Visualize a specific pathway with fold change overlay viewPathway( pathName = "Cell Cycle", organism = "human", readable = TRUE, # Convert IDs to gene symbols foldChange = foldChange, # Overlay expression data keyType = "ENTREZID", # Key type of gene IDs layout = "kk" # Graph layout algorithm ) # Visualize pathway without fold change data viewPathway( pathName = "DNA Replication", organism = "human", readable = TRUE, layout = "kk" ) ``` -------------------------------- ### viewPathway - Pathway Visualization Source: https://context7.com/yulab-smu/reactomepa/llms.txt Creates a network visualization of a specific REACTOME pathway, optionally overlaying fold change data. ```APIDOC ## viewPathway - Pathway Visualization ### Description The `viewPathway()` function creates a network visualization of a specific REACTOME pathway, displaying genes as nodes and their interactions as edges. It can overlay fold change data using color gradients to show expression patterns, making it useful for exploring the biological context of differentially expressed genes within a pathway. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```r library(ReactomePA) # Define fold change data for genes (optional) foldChange <- c( "11171" = 2.5, "8243" = -1.8, "2194" = 3.2, "1017" = -0.5, "249" = 1.9 ) # Visualize a specific pathway with fold change overlay viewPathway( pathName = "Cell Cycle", organism = "human", readable = TRUE, # Convert IDs to gene symbols foldChange = foldChange, # Overlay expression data keyType = "ENTREZID", # Key type of gene IDs layout = "kk" # Graph layout algorithm ) # Visualize pathway without fold change data viewPathway( pathName = "DNA Replication", organism = "human", readable = TRUE, layout = "kk" ) # Supported layout options: "kk" (Kamada-Kawai), "fr" (Fruchterman-Reingold), etc. ``` ### Response None explicitly defined, generates a visualization. ``` -------------------------------- ### gson_Reactome - Create GSON Object Source: https://context7.com/yulab-smu/reactomepa/llms.txt Downloads and structures the latest REACTOME pathway data into a GSON object for a specified organism. ```APIDOC ## gson_Reactome - Create GSON Object ### Description The `gson_Reactome()` function downloads and structures the latest REACTOME pathway data into a GSON (Gene Set Object Notation) object for a specified organism. This function is used internally by `enrichPathway()` and `gsePathway()` but can be called directly to access pathway mappings or for custom analyses. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```r library(ReactomePA) # Download Reactome data for human human_gson <- gson_Reactome(organism = "human") # Download for other organisms mouse_gson <- gson_Reactome(organism = "mouse") rat_gson <- gson_Reactome(organism = "rat") yeast_gson <- gson_Reactome(organism = "yeast") # The GSON object contains pathway-to-gene mappings # This can be used for custom enrichment analyses print(human_gson) ``` ### Response Returns a GSON object containing pathway-to-gene mappings for the specified organism. ``` -------------------------------- ### Map Organism Names to Bioconductor Database Packages Source: https://context7.com/yulab-smu/reactomepa/llms.txt Use `getDb()` to map organism names to their corresponding Bioconductor annotation database package names. This utility is used internally for gene ID conversions and annotations. Requires `ReactomePA` library. ```r library(ReactomePA) # Get annotation database name for different organisms getDb("human") # Returns: "org.Hs.eg.db" getDb("mouse") # Returns: "org.Mm.eg.db" getDb("rat") # Returns: "org.Rn.eg.db" getDb("yeast") # Returns: "org.Sc.sgd.db" getDb("zebrafish") # Returns: "org.Dr.eg.db" getDb("fly") # Returns: "org.Dm.eg.db" getDb("celegans") # Returns: "org.Ce.eg.db" # Full list of supported organisms: # anopheles, arabidopsis, bovine, canine, celegans, chicken, chimp, # coelicolor, ecolik12, ecsakai, fly, gondii, human, malaria, mouse, # pig, rat, rhesus, xenopus, yeast, zebrafish ``` -------------------------------- ### Create GSON Object for Reactome Pathway Data Source: https://context7.com/yulab-smu/reactomepa/llms.txt Use `gson_Reactome()` to download and structure the latest REACTOME pathway data into a GSON object for a specified organism. This is useful for accessing pathway-to-gene mappings for custom analyses. Requires `ReactomePA` library. ```r library(ReactomePA) # Download Reactome data for human human_gson <- gson_Reactome(organism = "human") # Download for other organisms mouse_gson <- gson_Reactome(organism = "mouse") rat_gson <- gson_Reactome(organism = "rat") yeast_gson <- gson_Reactome(organism = "yeast") # The GSON object contains pathway-to-gene mappings # This can be used for custom enrichment analyses print(human_gson) #> GSON object #> Species: human #> Gene set name: reactome pathway #> Keytype: ENTREZID ``` -------------------------------- ### getDb - Organism Database Mapping Source: https://context7.com/yulab-smu/reactomepa/llms.txt Maps organism names to their corresponding Bioconductor annotation database package names. ```APIDOC ## getDb - Organism Database Mapping ### Description The `getDb()` function maps organism names to their corresponding Bioconductor annotation database package names. This utility function is used internally to retrieve the correct OrgDb package for gene ID conversions and annotations. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```r library(ReactomePA) # Get annotation database name for different organisms getDb("human") # Returns: "org.Hs.eg.db" getDb("mouse") # Returns: "org.Mm.eg.db" getDb("rat") # Returns: "org.Rn.eg.db" getDb("yeast") # Returns: "org.Sc.sgd.db" getDb("zebrafish") # Returns: "org.Dr.eg.db" getDb("fly") # Returns: "org.Dm.eg.db" getDb("celegans") # Returns: "org.Ce.eg.db" # Full list of supported organisms: # anopheles, arabidopsis, bovine, canine, celegans, chicken, chimp, # coelicolor, ecolik12, ecsakai, fly, gondii, human, malaria, mouse, # pig, rat, rhesus, xenopus, yeast, zebrafish ``` ### Response Returns the string name of the corresponding Bioconductor annotation database package. ``` -------------------------------- ### Perform Enrichment Analysis with Custom Universe Source: https://context7.com/yulab-smu/reactomepa/llms.txt Use a custom background gene set for enrichment analysis by specifying the universe parameter in enrichPathway. ```R gene <- c("11171", "8243", "112464", "2194", "9318") result <- enrichPathway( gene = gene, universe = human_genes, # Custom background organism = "human" ) ``` -------------------------------- ### Visualize Enrichment Results with enrichplot Source: https://context7.com/yulab-smu/reactomepa/llms.txt Utilize functions like `dotplot()`, `cnetplot()`, `emapplot()`, `gseaplot()`, and `ridgeplot()` from `enrichplot` (re-exported by `ReactomePA`) to visualize enrichment analysis results. These functions display pathway relationships, gene overlaps, and enrichment statistics. Requires `ReactomePA` and `enrichplot` libraries. ```r library(ReactomePA) library(enrichplot) # Perform enrichment analysis gene <- c("11171", "8243", "112464", "2194", "9318", "79026", "1654", "65003", "6240", "3476", "6238", "3836", "4176", "1017", "249") result <- enrichPathway(gene = gene, pvalueCutoff = 0.05, readable = TRUE) # Dot plot - shows enrichment statistics for top pathways dotplot(result, showCategory = 15) # Gene-concept network - shows which genes are involved in each pathway cnetplot(result, categorySize = "pvalue", foldChange = NULL) # Enrichment map - shows pathway relationships based on shared genes emapplot(result, showCategory = 20) # Heat plot - shows gene-pathway relationships as a heatmap heatplot(result, showCategory = 10) # For GSEA results, additional visualization options gsea_result <- gsePathway(geneList, organism = "human") # GSEA plot - shows running enrichment score for a specific pathway gseaplot(gsea_result, geneSetID = 1, title = gsea_result$Description[1]) # Ridge plot - shows distribution of fold changes for enriched pathways ridgeplot(gsea_result, showCategory = 15) ``` -------------------------------- ### Visualization Functions - dotplot, cnetplot, emapplot Source: https://context7.com/yulab-smu/reactomepa/llms.txt Re-exports visualization functions from the enrichplot package for displaying enrichment results. ```APIDOC ## Visualization Functions - dotplot, cnetplot, emapplot ### Description ReactomePA re-exports several visualization functions from the enrichplot package including `dotplot()`, `cnetplot()`, `emapplot()`, `gseaplot()`, `heatplot()`, and `ridgeplot()`. These functions create publication-quality visualizations of enrichment results showing pathway relationships, gene overlaps, and enrichment statistics. ### Parameters These functions typically take an enrichment result object (e.g., from `enrichPathway` or `gsePathway`) as the primary input, along with optional parameters for customization. ### Request Example ```r library(ReactomePA) library(enrichplot) # Perform enrichment analysis gene <- c("11171", "8243", "112464", "2194", "9318", "79026", "1654", "65003", "6240", "3476", "6238", "3836", "4176", "1017", "249") result <- enrichPathway(gene = gene, pvalueCutoff = 0.05, readable = TRUE) # Dot plot - shows enrichment statistics for top pathways dotplot(result, showCategory = 15) # Gene-concept network - shows which genes are involved in each pathway cnetplot(result, categorySize = "pvalue", foldChange = NULL) # Enrichment map - shows pathway relationships based on shared genes emapplot(result, showCategory = 20) # Heat plot - shows gene-pathway relationships as a heatmap heatplot(result, showCategory = 10) # For GSEA results, additional visualization options gsea_result <- gsePathway(geneList, organism = "human") # GSEA plot - shows running enrichment score for a specific pathway gseaplot(gsea_result, geneSetID = 1, title = gsea_result$Description[1]) # Ridge plot - shows distribution of fold changes for enriched pathways ridgeplot(gsea_result, showCategory = 15) ``` ### Response These functions generate various types of plots (dot plots, network plots, heatmaps, etc.) visualizing enrichment analysis results. ``` -------------------------------- ### Perform Gene Set Enrichment Analysis (GSEA) Source: https://context7.com/yulab-smu/reactomepa/llms.txt Use `gsePathway` for Gene Set Enrichment Analysis on a ranked gene list to detect coordinated up or down-regulation in pathways. Requires a named numeric vector of gene rankings (Entrez IDs) sorted in decreasing order. Parameters include organism, gene set size, p-value cutoffs, and GSEA method specifics. ```r library(ReactomePA) library(org.Hs.eg.db) # Create a named numeric vector with gene rankings (e.g., fold changes or t-statistics) # Names must be Entrez gene IDs set.seed(123) geneList <- rnorm(1000) names(geneList) <- sample(keys(org.Hs.eg.db, "ENTREZID"), 1000) # Sort in decreasing order (required for GSEA) geneList <- sort(geneList, decreasing = TRUE) # Perform Gene Set Enrichment Analysis gsea_result <- gsePathway( geneList = geneList, organism = "human", minGSSize = 10, # Minimum gene set size maxGSSize = 500, # Maximum gene set size pvalueCutoff = 0.05, # p-value threshold pAdjustMethod = "BH", # Multiple testing correction verbose = TRUE, # Print progress messages method = "multilevel", # GSEA method: "multilevel", "permute", or "sample" nPerm = 1000, # Number of permutations (for "permute" method) exponent = 1 # Weight for ranking metric ) # View enriched pathways head(gsea_result) ``` ```r as.data.frame(gsea_result)[1:5, c("Description", "NES", "pvalue", "p.adjust")] ``` -------------------------------- ### Retrieve All Entrez Gene IDs for an Organism Source: https://context7.com/yulab-smu/reactomepa/llms.txt Use `getALLEG()` to retrieve all Entrez gene IDs for a specified organism from its annotation database. This is useful for defining background gene universes in enrichment analyses. Requires `ReactomePA` library. ```r library(ReactomePA) # Get all Entrez gene IDs for human human_genes <- getALLEG("human") length(human_genes) #> [1] 60000+ # Approximate number of human genes # Get all genes for other organisms mouse_genes <- getALLEG("mouse") yeast_genes <- getALLEG("yeast") ``` -------------------------------- ### Perform Pathway Enrichment Analysis (ORA) Source: https://context7.com/yulab-smu/reactomepa/llms.txt Use `enrichPathway` for Over-Representation Analysis to identify statistically over-represented pathways in a gene list. Specify organism, p-value/q-value cutoffs, and gene set size constraints. Setting `readable=TRUE` converts Entrez IDs to gene symbols. ```r library(ReactomePA) # Define a gene list using Entrez gene IDs gene <- c("11171", "8243", "112464", "2194", "9318", "79026", "1654", "65003", "6240", "3476", "6238", "3836", "4176", "1017", "249") # Perform pathway enrichment analysis result <- enrichPathway( gene = gene, organism = "human", # Supported: human, rat, mouse, celegans, yeast, zebrafish, fly pvalueCutoff = 0.05, # p-value threshold pAdjustMethod = "BH", # Multiple testing correction method qvalueCutoff = 0.2, # q-value threshold minGSSize = 10, # Minimum gene set size maxGSSize = 500, # Maximum gene set size readable = TRUE # Convert gene IDs to symbols ) # View results summary head(summary(result)) ``` ```r as.data.frame(result)[, c("ID", "Description", "pvalue", "p.adjust")] ``` -------------------------------- ### enrichPathway - Over-Representation Analysis Source: https://context7.com/yulab-smu/reactomepa/llms.txt Performs pathway enrichment analysis using the hypergeometric test to identify statistically over-represented REACTOME pathways in a given gene list. ```APIDOC ## enrichPathway - Over-Representation Analysis ### Description The `enrichPathway()` function performs pathway enrichment analysis to identify statistically over-represented REACTOME pathways in a given gene list. It uses a hypergeometric test with multiple testing correction (Benjamini-Hochberg by default) to determine which pathways contain more genes from your input list than expected by chance, returning an enrichResult object with detailed statistics. ### Method R function ### Parameters #### Arguments - **gene** (character vector) - A vector of gene identifiers (e.g., Entrez gene IDs). - **organism** (string) - The model organism. Supported: "human", "rat", "mouse", "celegans", "yeast", "zebrafish", "fly". - **pvalueCutoff** (numeric) - The p-value threshold for significance. - **pAdjustMethod** (string) - The multiple testing correction method (e.g., "BH" for Benjamini-Hochberg). - **qvalueCutoff** (numeric) - The q-value threshold for significance. - **minGSSize** (numeric) - The minimum size of a gene set (pathway) to be considered. - **maxGSSize** (numeric) - The maximum size of a gene set (pathway) to be considered. - **readable** (boolean) - If TRUE, converts gene IDs to gene symbols. ### Request Example ```r library(ReactomePA) # Define a gene list using Entrez gene IDs gene <- c("11171", "8243", "112464", "2194", "9318", "79026", "1654", "65003", "6240", "3476", "6238", "3836", "4176", "1017", "249") # Perform pathway enrichment analysis result <- enrichPathway( gene = gene, organism = "human", pvalueCutoff = 0.05, pAdjustMethod = "BH", qvalueCutoff = 0.2, minGSSize = 10, maxGSSize = 500, readable = TRUE ) # View results summary head(summary(result)) ``` ### Response #### Success Response Returns an `enrichResult` object containing detailed statistics for enriched pathways. The summary can be viewed using `summary(result)` and the data frame accessed via `as.data.frame(result)`. #### Response Example ``` # Example output from head(summary(result)) # ID Description GeneRatio BgRatio # R-HSA-69278 R-HSA-69278 Cell Cycle, Mitotic 8/13 483/11003 # R-HSA-69620 R-HSA-69620 Cell Cycle 8/13 588/11003 # R-HSA-68886 R-HSA-68886 M Phase 6/13 301/11003 # Example output from as.data.frame(result)[, c("ID", "Description", "pvalue", "p.adjust")] # Example: # ID Description pvalue p.adjust # 1 R-HSA-69278 Cell Cycle, Mitotic 0.0001234567 0.001234567 # 2 R-HSA-69620 Cell Cycle 0.0002469135 0.002469135 # 3 R-HSA-68886 M Phase 0.0003703704 0.003703704 ``` ``` -------------------------------- ### gsePathway - Gene Set Enrichment Analysis Source: https://context7.com/yulab-smu/reactomepa/llms.txt Performs Gene Set Enrichment Analysis (GSEA) on a ranked gene list to identify pathways that show coordinated up or down-regulation. ```APIDOC ## gsePathway - Gene Set Enrichment Analysis ### Description The `gsePathway()` function performs Gene Set Enrichment Analysis (GSEA) on a ranked gene list to identify pathways that show coordinated up or down-regulation. Unlike ORA which uses a cutoff, GSEA considers all genes and their ranking to detect subtle but coordinated changes in pathway activity, returning a gseaResult object with enrichment scores and statistics. ### Method R function ### Parameters #### Arguments - **geneList** (named numeric vector) - A named numeric vector where names are Entrez gene IDs and values are the rankings (e.g., fold changes, t-statistics). Must be sorted in decreasing order. - **organism** (string) - The model organism. Supported: "human", "rat", "mouse", "celegans", "yeast", "zebrafish", "fly". - **minGSSize** (numeric) - The minimum size of a gene set (pathway) to be considered. - **maxGSSize** (numeric) - The maximum size of a gene set (pathway) to be considered. - **pvalueCutoff** (numeric) - The p-value threshold for significance. - **pAdjustMethod** (string) - The multiple testing correction method (e.g., "BH" for Benjamini-Hochberg). - **verbose** (boolean) - If TRUE, print progress messages. - **method** (string) - The GSEA method to use. Options: "multilevel", "permute", or "sample". - **nPerm** (numeric) - The number of permutations to perform (used with `method = "permute"`). - **exponent** (numeric) - The weight for the ranking metric. ### Request Example ```r library(ReactomePA) library(org.Hs.eg.db) # Create a named numeric vector with gene rankings (e.g., fold changes or t-statistics) # Names must be Entrez gene IDs set.seed(123) geneList <- rnorm(1000) names(geneList) <- sample(keys(org.Hs.eg.db, "ENTREZID"), 1000) # Sort in decreasing order (required for GSEA) geneList <- sort(geneList, decreasing = TRUE) # Perform Gene Set Enrichment Analysis gsea_result <- gsePathway( geneList = geneList, organism = "human", minGSSize = 10, maxGSSize = 500, pvalueCutoff = 0.05, pAdjustMethod = "BH", verbose = TRUE, method = "multilevel", nPerm = 1000, exponent = 1 ) # View enriched pathways head(gsea_result) # Access specific pathway details as.data.frame(gsea_result)[1:5, c("Description", "NES", "pvalue", "p.adjust")] ``` ### Response #### Success Response Returns a `gseaResult` object containing enriched pathways with their enrichment scores (NES), p-values, and adjusted p-values. The results can be viewed using `head(gsea_result)` and the data frame accessed via `as.data.frame(gsea_result)`. #### Response Example ``` # Example output from head(gsea_result) # ID Description setSize enrichmentScore NES pvalue p.adjust # R-HSA-168256 R-HSA-168256 Immune System 1234 0.3421 2.15 0.001 0.012 # Example output from as.data.frame(gsea_result)[1:5, c("Description", "NES", "pvalue", "p.adjust")] # Example: # Description NES pvalue p.adjust # 1 Immune System 2.15 0.001000 0.012000 # 2 Signal Transduction 1.98 0.002500 0.025000 # 3 Metabolism 1.80 0.004000 0.040000 ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.