How runchenwang-dev/enrichgt works
EnrichGT is an experimental R package for gene set enrichment-style analysis. Architecturally, it is a single-package workflow centered on transforming gene inputs into enriched biological interpretations, with several downstream branches for visualization, reclustering, and inference.
The main inputs are two gene representations: a plain gene list and a weighted gene list. Those feed two separate analysis entry points: egt_enrichment_analysis for standard enrichment and egt_gsea_analysis for weighted/GSEA-style analysis.
A separate database layer, exposed through database_* functions, provides the pathway or gene-set reference data used by both analysis paths. This is the package’s main data dependency boundary: analysis functions consume the databases rather than embedding pathway knowledge directly.
Both analysis entry points converge on a common enriched-result output. That shared result object is the key handoff to the rest of the package, which means the architecture is organized around one canonical analysis result and multiple consumers.
Visualization is a distinct downstream subsystem. egt_plot_results is used for enrichment outputs, while egt_plot_gsea is dedicated to GSEA outputs. These functions sit at the presentation boundary and do not appear to alter the analysis data model.
There is also a reclustering-oriented branch, egt_recluster_analysis, which takes the enriched result and reorganizes it into gene clusters or modules. This branch produces two notable outputs: a “pretty table” for human review and an “AI annotation” layer for higher-level interpretation.
The reclustering branch also feeds back into visualization, since clusters/modules can be plotted through the same result-plotting path. In architecture terms, this is a secondary interpretation layer built on top of the core enrichment result.
A further downstream capability is pathway activity and transcription-factor inference via egt_infer. The README indicates this consumes gene modules rather than the raw enriched result, so it appears to depend on the reclustering output as an intermediate abstraction.
Overall, the data flow is: genes or weighted genes in, pathway databases in, enrichment/GSEA out, then optional branches for plotting, reclustering, annotation, and inference. The package is therefore more of an analysis pipeline than a collection of unrelated utilities.
The package is explicitly positioned as exploratory and not a replacement for established tools like clusterProfiler or Metascape. That matters architecturally because it suggests the package favors proof-of-concept analysis flow and interpretation features over a heavily validated production pipeline.
Distribution-wise, this is a standard R package installed via pak, with documentation hosted on a GitHub Pages site and source code on GitHub. No other runtime, backend service, or infrastructure is indicated in the README.
Components 13
Inputs & data
Gene inputs and reference databases that feed analysis.
- Gene list · Plain gene input for standard enrichment analysis.
- Weighted genes · Ranked or weighted gene input for GSEA-style analysis.
- Databases · Pathway or gene-set reference data accessed through database_* functions.
Core analysis
Primary enrichment and GSEA entry points plus shared result object.
- Enrichment · egt_enrichment_analysis: standard enrichment workflow.
- GSEA · egt_gsea_analysis: weighted gene set enrichment workflow.
- Result object · Shared enriched-result representation handed to downstream features.
Downstream interpretation
Plotting, reclustering, annotation, and inference built on the shared results.
- Result plots · egt_plot_results: plots enrichment outputs from the shared result object.
- GSEA plots · egt_plot_gsea: plots GSEA outputs.
- Recluster · egt_recluster_analysis: reorganizes enriched results into gene clusters or modules.
- Pretty table · Human-readable tabular output from reclustering.
- AI annotation · Higher-level interpretation layer produced by reclustering.
- Inference · egt_infer: pathway activity and transcription-factor inference from gene modules.
Other components
- EnrichGT · Experimental single-package workflow for gene set enrichment-style analysis.
Connections 15
- Gene list → Enrichment: feeds · Plain gene input enters standard enrichment.
- Weighted genes → GSEA: feeds · Weighted genes enter GSEA-style analysis.
- Databases → Enrichment: supports · Reference databases are consumed by enrichment analysis.
- Databases → GSEA: supports · Reference databases are consumed by GSEA analysis.
- Enrichment → Result object: produces · Standard enrichment returns the shared result object.
- GSEA → Result object: produces · GSEA returns the shared result object.
- Result object → Result plots: visualized by · Enrichment results are plotted through the main plotting path.
- Result object → GSEA plots: visualized by · GSEA results are plotted through the dedicated GSEA plotting path.
- Result object → Recluster: reclustered by · The shared result object can be reorganized into clusters or modules.
- Recluster → Pretty table: reports · Reclustering produces a human-review table.
- Recluster → AI annotation: annotates · Reclustering produces AI-oriented annotations.
- Recluster → Inference: supplies · Gene modules from reclustering feed downstream inference.
- EnrichGT → Gene list: contains · Package boundary around the gene-input workflow.
- EnrichGT → Databases: contains · Package boundary around the database access layer.
- EnrichGT → Result plots: contains · Package boundary around result visualization.