Enrichr is a popular gene-set enrichment analysis tool developed in the Ma’ayan Lab.
Directly quoting from Enrichr’s help page:
A gene set library is a set of related gene sets or enrichment terms […] These libraries have been constructed from many sources such as published studies and major biological and biomedical online databases. Others have been created for and only available through Enrichr.
To get a list of the available libraries in Enrichr, use:
In the returned data frame, you can find the names of available Enrichr libraries in “libraryName” column. As you will see in the following sections, you can use these names to request an enrichment analysis based on the selected library or libraries.
To perform enrichment analysis on your gene-set with Enrichr using rbioapi, you can take two approaches. We will begin with the simple one. But first, we create a vector of genes’ NCBI IDs to use as the input example in this article.
The only required input for this function is to simply supply your
gene-set as a character vector. Optionally you can also select one or
more libraries. Please see
rba_enrichr() function’s manual
for more details on the arguments.
Note that the default value for the argument
gene_set_library in the rba_enrichr function is “all”. This
means that if you call the function as above, all of the Enrichr
libraries will be used for the enrichment analysis of your uploaded gene
list. In this case, you will have a named list, where each of its
elements is a dataframe containing your genes’ analysis results using
that Enrichr library.
Alternatively, you can use the
to specify the library (or libraries) to use. Here we demonstrate using
When supplying the
gene_set_library argument, rbioapi
assumes you are entering a regex pattern. You can disable this by
this feature is useful if you need -for example- partial matches in the
library names. Suppose you want to perform the enrichment analysis on
every library available in Enrichr that contains the name “MSig”. You
can do the following:
Note that when only one Enrichr library is selected, a data frame with enrichment analysis result will be returned.
str(results_msig_hallmark) #> 'data.frame': 18 obs. of 9 variables: #> $ Term : chr "Mitotic Spindle" "G2-M Checkpoint" "E2F Targets" "Apoptosis" ... #> $ Overlap : chr "5/199" "4/200" "4/200" "3/161" ... #> $ P.value : num 2.57e-07 1.22e-05 1.22e-05 2.17e-04 2.74e-03 ... #> $ Adjusted.P.value : num 4.62e-06 7.29e-05 7.29e-05 9.76e-04 9.87e-03 ... #> $ Old.P.value : int 0 0 0 0 0 0 0 0 0 0 ... #> $ Old.Adjusted.P.value: int 0 0 0 0 0 0 0 0 0 0 ... #> $ Odds.Ratio : num 51 36.7 36.7 31.4 29.7 ... #> $ Combined.Score : num 774 416 416 265 175 ... #> $ Genes : chr "CDC42;RACGAP1;PLK1;CDK1;KIF23" "RACGAP1;PLK1;CDK1;KIF23" "RACGAP1;PLK1;CDK1;BRCA1" "CDK2;BRCA1;RHOB" ...
But when multiple libraries have been selected, the function’s output will be a list where each element is a data frame corresponding to one of the selected libraries.
rba_enrichr() is a wrapper function. It internally
executes a sequence of functions necessary to run your analysis.
Alternatively, you could go step by step. We demonstrate these steps in
First, you need to retrieve the list of available Enrichr libraries. This step is optional. You can skip it if you already know the name of your desired libraries or if you want to run the analysis over every available library.
Now, you need to upload your genes list to Enrichr. By this, an identifier will be assigned to your submitted list, which is needed for the next step.
From the returned response, we need the numeric ID in the “userListId” element.
Finally, we are ready to submit the enrichment analysis request to
Enrichr. Same as explained above for the wrapper function
rba_enrichr(), we can supply the “gene_set_library”
argument in different ways. Here we will only select the
Enrichr also provides libraries for model organisms. The following
functions have an
organism argument that allows you to
perform the analysis on species other than humans:
The available options for the organism argument are human”, (H. sapiens & M. musculus), fly” (D. melanogaster), “yeast” (S. cerevisiae), “worm” (C. elegans), and “fish” (D. rerio).
Some rbioapi Enrichr functions were not covered in this vignette, be sure to check their manuals:
To cite Enrichr (Please see https://maayanlab.cloud/Enrichr/help#terms):
Chen, E.Y., Tan, C.M., Kou, Y. et al. Enrichr: interactive and collaborative HTML5 gene list enrichment analysis tool. Bioinformatics 14, 128 (2013). https://doi.org/10.1186/1471-2105-14-128
Maxim V. Kuleshov, Matthew R. Jones, Andrew D. Rouillard, Nicolas F. Fernandez, Qiaonan Duan, Zichen Wang, Simon Koplev, Sherry L. Jenkins, Kathleen M. Jagodnik, Alexander Lachmann, Michael G. McDermott, Caroline D. Monteiro, Gregory W. Gundersen, Avi Ma’ayan, Enrichr: a comprehensive gene set enrichment analysis web server 2016 update, Nucleic Acids Research, Volume 44, Issue W1, 8 July 2016, Pages W90–W97, https://doi.org/10.1093/nar/gkw377
Xie, Z., Bailey, A., Kuleshov, M. V., Clarke, D. J. B., Evangelista, J. E., Jenkins, S. L., Lachmann, A., Wojciechowicz, M. L., Kropiwnicki, E., Jagodnik, K. M., Jeon, M., & Ma’ayan, A. (2021). Gene set knowledge discovery with Enrichr. Current Protocols, 1, e90. doi: 10.1002/cpz1.90
To cite rbioapi:
Other services supported by rbioapi also provide Over-representation analysis tools. Please see the vignette article Do with rbioapi: Over-Representation (Enrichment) Analysis in R (link to the documentation site) for an in-depth review.
#> R version 4.3.1 (2023-06-16 ucrt) #> Platform: x86_64-w64-mingw32/x64 (64-bit) #> Running under: Windows 11 x64 (build 22621) #> #> Matrix products: default #> #> #> locale: #>  LC_COLLATE=C #>  LC_CTYPE=English_United States.utf8 #>  LC_MONETARY=English_United States.utf8 #>  LC_NUMERIC=C #>  LC_TIME=English_United States.utf8 #> #> time zone: Europe/Brussels #> tzcode source: internal #> #> attached base packages: #>  stats graphics grDevices utils datasets methods base #> #> other attached packages: #>  rbioapi_0.8.0 #> #> loaded via a namespace (and not attached): #>  digest_0.6.33 R6_2.5.1 fastmap_1.1.1 xfun_0.40 #>  magrittr_2.0.3 cachem_1.0.8 knitr_1.44 htmltools_0.5.5 #>  rmarkdown_2.25 DT_0.29 cli_3.6.1 sass_0.4.7 #>  jquerylib_0.1.4 compiler_4.3.1 httr_1.4.7 rstudioapi_0.15.0 #>  tools_4.3.1 curl_5.0.2 ellipsis_0.3.2 evaluate_0.21 #>  bslib_0.5.1 yaml_2.3.7 htmlwidgets_1.6.2 rlang_1.1.1 #>  jsonlite_1.8.7 crosstalk_1.2.0