enrichit provides C++ implementations of functional enrichment analysis methods and S4 result classes used by the clusterProfiler family. It supports ORA, GSEA, design-aware GSEA on RNA-seq counts, weighted enrichment, network-based enrichment, multilayer network workflows, and multi-omics aggregation and contribution analysis.
You can install the development version of enrichit from GitHub using devtools:
# install.packages("devtools")
devtools::install_github("YuLab-SMU/enrichit")enrichit organizes its functions around five components:
- Core enrichment engines: ORA, GSEA, weighted ORA/GSEA, and GSON-aware variants.
- Design-aware and score-level GSEA:
dsea()for enrichment on a count matrix plus a design (rank by the requested contrast, then GSEA), anddsea_scores()/ssgsea_scores()for per-sample gene set scores. - Network-aware enrichment: single-layer
nsea()and multi-layermnsea()workflows based on Random Walk with Restart. - Multi-omics integration: early fusion at the feature level and late fusion at the pathway level.
- Contribution and topology outputs: contribution tables and topology-aware extraction helpers for visualization in
enrichplot.
- Implementation: Algorithms are implemented in
C++viaRcpp, with sparse network propagation usingRcppEigen. - ORA: standard hypergeometric ORA with optional weighted ORA through Wallenius' noncentral hypergeometric distribution.
- GSEA: multilevel, permutation, and adaptive strategies for ranked enrichment analysis.
- Design-aware GSEA:
dsea()takes a count matrix or aDESeqDataSetplus a design frommodel.matrix()(rownames must match the sample names), variance-stabilises the counts (vstorrlog), ranks genes by the requested contrast, and runs the GSEA engine already in the package. It returns a plain data.frame -- GSEA's table pluspadjandcontrast-- so it can be filtered and plotted like any other GSEA result.dsea_scores()andssgsea_scores()are the other half: a gene set x sample score matrix for analyses that need samples rather than one contrast. - DESeq2 adapters:
as_ranked()andas_genes()turnDESeqResultsand fittedDESeqDataSetobjects into a ranking or a gene vector, so adsea()analysis can start from an existingDESeq2result; extra arguments are passed on toDESeq2::results(), so the contrast uses itsc("factor", "numerator", "denominator")form.DESeq2is suggested, not imported. - GSON support: native
ora_gson()andgsea_gson()interfaces for structured gene set collections. - NSEA:
nsea()andnsea_gson()for network-ranked enrichment on a single graph, includingmode = "signed"for bidirectional propagation. - Multi-layer topology fusion:
mnsea()andmnsea_gson()for multiplex or heterogeneous network propagation across multiple layers. - Multi-omics early fusion:
aggregate_omics(),harmonize_ids(), andselect_features_for_ora()for feature-level integration before enrichment. - Multi-omics late fusion:
aggregate_enrichment()for pathway-level aggregation of multiple enrichment results. - Contribution tracing:
get_omics_contribution(),classify_omics_pattern(), andget_mnsea_contribution()for contribution summaries. - Topology-aware extraction:
extract_mnsea_subnetwork()for pathway-specific node/edge tables that can be passed to downstream visualization packages. - Bayesian term selection:
bayes_enrich()andbayes_summary()for posterior-based term prioritization.
ora(),ora_gson()gsea(),gsea_gson()gseaScores()
ora(..., weight = )ora_gson(..., weight = )gsea(..., weight = )gsea_gson(..., weight = )
dsea()dsea_scores(),ssgsea_scores()as_ranked(),as_genes()
prepare_network()nsea(),nsea_gson()prepare_multilayer_network()propagate_multilayer()collapse_multilayer_scores()mnsea(),mnsea_gson()
aggregate_omics()harmonize_ids()select_features_for_ora()aggregate_enrichment()
get_omics_contribution()classify_omics_pattern()get_mnsea_contribution()extract_mnsea_subnetwork()
The package returns the following S4 result classes:
enrichResultfor ORA-like workflowsgseaResultfor ranked enrichment workflowsnseaResultfor single-network propagation plus enrichmentmnseaResultfor multi-layer propagation, collapsed scores, and cached explanation tables
dsea() is the exception on the other side: it returns a plain data.frame rather than a gseaResult. dsea_scores() and ssgsea_scores() return a DseaScores object, an S3 list holding the gene set x sample score matrix ($scores) and the metadata it was built with ($meta).
These classes are used across the clusterProfiler family:
enrichithandles core computation, algorithm implementation, and contribution data preparationclusterProfilerprovides high-level biological interpretation workflows and general enrichment analysis interfacesenrichplothandles visualizationgsonprovides a structured gene set resource layer for managing and exchanging gene set collections across the family- knowledge-base-oriented downstream packages such as
DOSE,ReactomePA,meshes, andMicrobiomeProfilerprovide domain-specific annotation and interpretation layers