### Install enrichR from GitHub Source: https://github.com/wjawaid/enrichr/blob/master/README.md Installs the enrichR package directly from its GitHub repository using the devtools package. This is useful for obtaining the latest development version. ```r library(devtools) install_github("wjawaid/enrichR") ``` -------------------------------- ### Install enrichR from CRAN Source: https://github.com/wjawaid/enrichr/blob/master/README.md Installs the enrichR package from the Comprehensive R Archive Network (CRAN). This is the standard method for installing stable releases of R packages. ```r install.packages("enrichR") ``` -------------------------------- ### Perform Enrichment Analysis (Without Background) Source: https://github.com/wjawaid/enrichr/blob/master/README.md Performs gene-set enrichment analysis using the enrichr() function with a list of input genes and selected databases. It shows how to load example genes and view the results. ```r # Load example input genes data(input) # Perform enrichment analysis enriched <- enrichr(input, dbs) # View results for a specific database head(enriched["GO_Biological_Process_2023"]) ``` -------------------------------- ### List and Select Gene-Set Libraries Source: https://github.com/wjawaid/enrichr/blob/master/README.md Demonstrates how to list all available gene-set libraries from the Enrichr database and how to select specific libraries for analysis, such as GO databases from 2023. ```r # List all available databases dbs <- listEnrichrDbs() # Select specific GO databases for analysis dbs <- c("GO_Molecular_Function_2023", "GO_Cellular_Component_2023", "GO_Biological_Process_2023") ``` -------------------------------- ### Initialize Enrichr Connection Source: https://github.com/wjawaid/enrichr/blob/master/README.md Loads the enrichR library and checks the connection status to various Enrichr-related services. It also demonstrates how to set the specific Enrichr site to use for analysis, defaulting to the human gene set. ```r library(enrichR) listEnrichrSites() setEnrichrSite("Enrichr") # Sets connection to the default human Enrichr site ``` -------------------------------- ### Load and Inspect Background Data Source: https://github.com/wjawaid/enrichr/blob/master/README.md Loads a predefined background dataset into the R environment and displays its total length and the first few elements. This step is crucial for understanding the scope of the background set used in enrichment analysis. ```R data(background) length(background) #\> [1] 20625 head(background) #\> [1] "A1BG" "A2M" "NAT1" "NAT2" "SERPINA3" "AADAC" ``` -------------------------------- ### Configure Proxy Settings for Enrichr Source: https://github.com/wjawaid/enrichr/blob/master/README.md Sets R options to configure HTTP or HTTPS proxy settings for the Enrichr package. This is necessary when the R environment is behind a proxy server, ensuring successful connection to the Enrichr database. ```R options(RCurlOptions = list(proxy = 'http://ip_or_url', proxyusername = 'myuser', proxypassword = 'mypwd', proxyport = 'port_num', proxyauth = 'basic')) ``` -------------------------------- ### View Enrichment Results (Default) Source: https://github.com/wjawaid/enrichr/blob/master/README.md Displays the top results for a specific enrichment database, 'GO_Biological_Process_2023', from the 'enriched2' object. This shows terms, ranks, p-values, and associated genes, providing insights into biological pathways. ```R head(enriched2[["GO_Biological_Process_2023"]]) ``` -------------------------------- ### Perform Enrichment with Background Set Source: https://github.com/wjawaid/enrichr/blob/master/README.md Conducts gene enrichment analysis using the enrichr function. It takes a list of genes ('input') and a set of databases ('dbs'), specifying a 'background' gene list for comparative analysis. The function uploads data and retrieves enrichment results from specified databases. ```R enriched2 <- enrichr(input, dbs, background = background) #> Uploading data to Speedrichr... #> - Your gene set... Done. #> - Your background... Done. #> Getting enrichment results... #> - GO_Molecular_Function_2023... Done. #> - GO_Cellular_Component_2023... Done. #> - GO_Biological_Process_2023... Done. #> Parsing results... Done. ``` -------------------------------- ### Export Enrichment Results to Excel Source: https://github.com/wjawaid/enrichr/blob/master/README.md Exports the enrichment results into a single Excel 2007 (XLSX) file, with each worksheet corresponding to a selected database. This provides a convenient way to manage and share multiple result sets. ```R # To Excel printEnrich(enriched, outFile = "excel") ``` -------------------------------- ### Visualize Enrichment Results Source: https://github.com/wjawaid/enrichr/blob/master/README.md Generates a plot to visualize the enrichment results for a specified database ('GO_Biological_Process_2023'). The plot displays the top terms, ordered by p-value, showing gene counts and other relevant metrics, with customizable display options. ```R plotEnrich(enriched[["GO_Biological_Process_2023"]], showTerms = 20, numChar = 40, y = "Count", orderBy = "P.value") ``` -------------------------------- ### Export Enrichment Results to Text Files Source: https://github.com/wjawaid/enrichr/blob/master/README.md Exports the enrichment results from all selected databases into individual text files. This function is useful for saving detailed results for further analysis or reporting. ```R # To text files printEnrich(enriched) ``` -------------------------------- ### View Enrichment Results with Overlap Source: https://github.com/wjawaid/enrichr/blob/master/README.md Displays the top results for 'GO_Biological_Process_2023' from the 'enriched3' object, now including the 'Overlap' column. This column shows the ratio of overlapping genes for each term, aiding in the assessment of enrichment significance. ```R head(enriched3[["GO_Biological_Process_2023"]]) ``` -------------------------------- ### Perform Enrichment with Overlap Calculation Source: https://github.com/wjawaid/enrichr/blob/master/README.md Executes gene enrichment analysis and includes the 'Overlap' column in the results by setting 'include_overlap = TRUE'. This option calculates the number of annotated genes within each term relative to the background set, enhancing result interpretation. ```R enriched3 <- enrichr(input, dbs, background = background, include_overlap = TRUE) #> Uploading data to Speedrichr... #> - Your gene set... Done. #> - Your background... Done. #> Getting enrichment results... #> - GO_Molecular_Function_2023... Done. #> - Download GMT file... Done. #> - GO_Cellular_Component_2023... Done. #> - Download GMT file... Done. #> - GO_Biological_Process_2023... Done. #> - Download GMT file... Done. #> Parsing results... Done. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.