Annotation and Enrichment Functions

Peter Langfelder, Jeremy A. Miller, Steve Horvath

With contributions from Jim Wang, Mike Palazzolo, X. William Yang, CHDI, Rancho Biosciences and others

Peter (dot) Langfelder (at) gmail (dot) com
Jeremym (at) alleninstitute (dot) org
SHorvath (at) mednet (dot) ucla (dot) edu

Quick navigation

R packages anRichment and anRichmentMethods

Packages anRichmentMethods and anRichment are add-on packages for the R statististical language and environment. The aim of these packakes is to provide tools for enrichment calculations, access to multiple reference gene sets such as GO, KEGG, Reactome as well as more specialized collections of gene sets collected from published literature, tools for creating custom collections of reference gene sets and others.

Package anRichmentMethods includes genral functions for working with collections and for enrichment calculations while anRichment contains mostly data together with functions to access the stored collections and to build specific collections dynamically from external data.

Caution: experimental package!

These packages should be considered experimental. The "API" (such as it is), i.e., the function names, arguments and returned values, can and probably will change.

R tutorials

A Set of tutorials that illustrate various aspects of this annotation and enrichement package are available.

Click here to access the tutorial page.

Download and installation


Although the packages can be installed under older R versions (down to R-3.5.0), we strongly recommend using the newest R version because the external annotation packages (GO, organism-specific genome annotation) are continuously updated.

Simple installation

We provide an installation script that automatically installs all necesary dependencies as well as both packages anRichmentMethods and anRichment. The simplest installation procedure consist of these two steps:


If this installation script fails, please examine the error message and try correcting the indicated problem. If that fails, please try the manual installation below or contact Peter Langfelder, including the error message and output of the command sessionInfo().

Manual installation

If the above automatic script fails, one can install the dependencies and the anRichment/anRichmentMethods packages separately. Download the packages anRichment and anRichmentMethods from the links below, then follow these installation instructions.

R package download

Packages anRichment and anRichmentMethods are available here in the source form.

Should you discover bugs (of which there are most likely plenty), please report them to Peter Langfelder (peter.langfelder at

Extensions: packages containing additional collections

Some users may be interested in additional collections beyond the stanadard internal collection and the dynamically generated GO collection. We aim to provide further collections in separate "mostly-data" packages that contain an additional collection (or collections) and simple accessor functions. Currently, there are 2 such packages available:

Problems installing or using the package

Please see our list of Frequently Asked Questions (and frequently given answers); the solution to your problem may already be posted there. If you find a bug in the newest version, please email Peter Langfelder.


This package originated as an attempt to merge Jeremy Miller's function userListEnrichment and the gene lists it provides, and Peter Langfelder's GOenrichmentAnalysis. Both these functions were provided as part of the
WGCNA package.

The package is currently maintained by Peter Langfelder and contains gene sets compiled by multiple contributors. At the risk of putting out an incomplete list, these include Jeremy A. Miller, Michael Palazzolo, Jim Wang, X. William Yang and his group (in particular, Jeff Cantle and Nan Wang), Dan Salomon and his group, Jeff Aaronson and the team at Rancho Biosciences. PL gratefully ackowledges the support of CHDI, Inc.

free web stats