Visualize results through HTML reports or figures

HTML reports

Inline or in dynamic documents

Because of the messy result table is hardly to read, EnrichGT help you convert it into pretty tinytable HTML tables. This only supports the re-enriched results.

You can simple print by input the object name of re-enriched object or fused object to R console, to show the table. In IDE like RStudio and Positron, you can view the table in View window. You can also integrate to R-based publish systems like rmarkdown, Quarto or litedown. Like this: The default setting is optimized for HTML reports. For Latex reports, you may refer to the document of tinytable.

re_enrich
Parse form: ora_result; Split into 10 Clusters. Generated by github@zhimingye/EnrichGT. Time: 2025-04-07 22:48:31.201264
Description Count PCT Padj geneID
GO:0035249 | synaptic transmission, glutamatergic 19 4.2 8.1e-08 ATP1A2, GRIA4, GRID2, GRIK2, GRIK3, GRIN1, GRIN2A, GRIN2B, GRIN2D, GRM1, GRM5, GRM8, DGKI, NRXN1, NLGN1, UNC13A, MAPK8IP2, CACNG5, UNC13C
GO:0051966 | regulation of synaptic transmission, glutamatergic 16 3.5 8.1e-08 ATP1A2, GRIK2, GRIK3, GRIN1, GRIN2A, GRIN2B, GRIN2D, GRM1, GRM5, GRM8, DGKI, NRXN1, NLGN1, UNC13A, MAPK8IP2, CACNG5
GO:0050804 | modulation of chemical synaptic transmission 39 8.5 8.1e-08 ACHE, APOE, ATP1A2, CA2, CAMK2B, CDC20, GFAP, GRIA4, GRID2, GRIK2, GRIK3, GRIN1, GRIN2A, GRIN2B, GRIN2D, GRM1, GRM5, GRM8, HRAS, MAP1B, NTRK2, SLC6A1, CNTN2, VGF, WNT5A, INA, DGKI, DLGAP1, NRXN1, RIMS3, NMU, NLGN1, UNC13A, MAPK8IP2, ERC2, CACNG5, LRFN2, UNC13C, SHISA9
GO:0099177 | regulation of trans-synaptic signaling 39 8.5 8.1e-08 ACHE, APOE, ATP1A2, CA2, CAMK2B, CDC20, GFAP, GRIA4, GRID2, GRIK2, GRIK3, GRIN1, GRIN2A, GRIN2B, GRIN2D, GRM1, GRM5, GRM8, HRAS, MAP1B, NTRK2, SLC6A1, CNTN2, VGF, WNT5A, INA, DGKI, DLGAP1, NRXN1, RIMS3, NMU, NLGN1, UNC13A, MAPK8IP2, ERC2, CACNG5, LRFN2, UNC13C, SHISA9
GO:0050808 | synapse organization 36 7.9 2.1e-06 ACHE, APOE, KIF1A, CAMK2B, CDC20, CDH6, CTNNA2, DSCAM, GAP43, GRID2, GRIN2B, GRM5, MAP1B, NRCAM, NTRK2, RAC3, SIX1, SLC6A1, CNTN2, WNT5A, INA, NRXN1, NLGN1, UNC13A, ERC2, IL1RAPL2, SEZ6L2, TREM2, LRFN2, IGSF9, BCAN, SYNDIG1, DNER, ADGRF1, LHFPL4, UNC13C
GO:0048168 | regulation of neuronal synaptic plasticity 12 2.6 4.2e-06 APOE, CAMK2B, GRIK2, GRIN1, GRIN2A, GRIN2B, GRIN2D, GRM5, HRAS, CNTN2, VGF, SHISA9
GO:0007215 | glutamate receptor signaling pathway 11 2.4 5.2e-06 GRIA4, GRID2, GRIK2, GRIK3, GRIN1, GRIN2A, GRIN2B, GRIN2D, GRM1, GRM5, GRM8
GO:0035235 | ionotropic glutamate receptor signaling pathway 8 1.8 1.1e-05 GRIA4, GRID2, GRIK2, GRIK3, GRIN1, GRIN2A, GRIN2B, GRIN2D
GO:0048167 | regulation of synaptic plasticity 20 4.4 4.5e-05 APOE, CAMK2B, CDC20, GFAP, GRID2, GRIK2, GRIN1, GRIN2A, GRIN2B, GRIN2D, GRM5, HRAS, MAP1B, NTRK2, CNTN2, VGF, RIMS3, ERC2, UNC13C, SHISA9
GO:0060078 | regulation of postsynaptic membrane potential 16 3.5 8.5e-05 GABRD, GRIA4, GRID2, GRIK2, GRIK3, GRIN1, GRIN2A, GRIN2B, GRIN2D, GRM1, GRM5, HTR3A, NRXN1, NLGN1, MAPK8IP2, HCN1
GO:0007094 | mitotic spindle assembly checkpoint signaling 11 2.4 4.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, ZWINT, CDCA8, NUF2, SPC24
GO:0071174 | mitotic spindle checkpoint signaling 11 2.4 4.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, ZWINT, CDCA8, NUF2, SPC24
GO:0071173 | spindle assembly checkpoint signaling 11 2.4 4.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, ZWINT, CDCA8, NUF2, SPC24
GO:0031577 | spindle checkpoint signaling 11 2.4 4.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, ZWINT, CDCA8, NUF2, SPC24
GO:0010965 | regulation of mitotic sister chromatid separation 12 2.6 4.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, UBE2C, ZWINT, CDCA8, NUF2, SPC24
GO:0045841 | negative regulation of mitotic metaphase/anaphase transition 11 2.4 4.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, ZWINT, CDCA8, NUF2, SPC24
GO:0033048 | negative regulation of mitotic sister chromatid segregation 11 2.4 4.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, ZWINT, CDCA8, NUF2, SPC24
GO:2000816 | negative regulation of mitotic sister chromatid separation 11 2.4 4.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, ZWINT, CDCA8, NUF2, SPC24
GO:0033046 | negative regulation of sister chromatid segregation 11 2.4 4.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, ZWINT, CDCA8, NUF2, SPC24
GO:0051985 | negative regulation of chromosome segregation 11 2.4 5.2e-06 BIRC5, BUB1, CCNB1, CDC20, CENPF, PLK1, NDC80, ZWINT, CDCA8, NUF2, SPC24
GO:0007626 | locomotory behavior 18 3.9 2.5e-04 ALK, APOE, ATP1A2, DPP4, DSCAM, GAD1, GPR37, GRIN2D, GRM1, GRM5, SLC6A3, CNTN2, UCHL1, ZIC1, RASD2, ANKH, PPP1R1B, CIART
GO:0001964 | startle response 6 1.3 2.7e-03 CTNNA2, GRID2, GRIN2A, GRIN2D, SLC6A3, CNTNAP2
GO:0008038 | neuron recognition 7 1.5 5.4e-03 DSCAM, GAP43, NRCAM, OPCML, CNTN2, CNTNAP2, IGSF9
GO:0008037 | cell recognition 13 2.8 5.4e-03 C4BPB, DSCAM, FOLR2, GAP43, NRCAM, OPCML, CNTN2, ZAN, CNTNAP2, TREM2, IGSF9, MEGF10, ATP8B3
GO:0015669 | gas transport 5 1.1 7.2e-03 CA2, HBA1, HBA2, HBB, MB
GO:0042542 | response to hydrogen peroxide 10 2.2 7.8e-03 COL1A1, CRYAB, NQO1, GPX1, HBA1, HBA2, HBB, HMOX1, SDC1, TRPM2
GO:0021700 | developmental maturation 20 4.4 7.8e-03 AKR1B1, CAMK2B, CDC20, MAP1B, NKX6-1, NRCAM, RAC3, RYR1, CNTN2, WNT5A, NRXN1, NLGN1, UNC13A, CNTNAP2, SEZ6L2, TFCP2L1, SOX8, BCAN, TDRD5, UNC13C
GO:0050905 | neuromuscular process 13 2.8 7.8e-03 CTNNA2, FOXS1, GRID2, GRIN2A, GRIN2D, RAC3, SLC6A3, TNNT1, UCHL1, NRXN1, CNTNAP2, STRA6, STAC2
GO:0014074 | response to purine-containing compound 12 2.6 8.4e-03 HCN2, COL1A1, ENPP1, RYR1, SDC1, SLC5A5, SLC6A1, SLC6A3, SRD5A1, TRPM2, VGF, HCN1
GO:0007409 | axonogenesis 24 5.3 1.1e-02 APLP1, APOE, CTNNA2, DLX5, DSCAM, FOXD1, GAP43, KIF5C, MAG, MAP1B, NKX6-1, NRCAM, NTRK2, RAC3, CNTN2, UCHL1, WNT5A, NRXN1, FSTL4, SEMA5B, DPYSL5, IGSF9, KIAA1755, EPHA10
GO:0045664 | regulation of neuron differentiation 17 3.7 6.7e-04 JAG1, ALK, MAG, MAP1B, NKX6-1, NRCAM, RAC3, SFRP2, SIX1, CNTN2, TP73, ZNF536, NLGN1, HEY2, SOX8, ASPM, WDR62
GO:0051960 | regulation of nervous system development 27 5.9 2.2e-03 ACAN, CAMK2B, HAPLN1, DSCAM, GFAP, GRID2, GRM5, MAG, MAP1B, NKX6-1, NTRK2, TP73, WNT5A, NRXN1, NLGN1, FSTL4, HEY2, DAAM2, SOX8, TREM2, SEMA5B, DPYSL5, BCAN, SYNDIG1, IL34, ASPM, WDR62
GO:0051962 | positive regulation of nervous system development 20 4.4 2.2e-03 ACAN, CAMK2B, HAPLN1, DSCAM, GFAP, GRID2, GRM5, MAG, MAP1B, NKX6-1, NTRK2, TP73, NRXN1, NLGN1, SOX8, BCAN, SYNDIG1, IL34, ASPM, WDR62
GO:0050767 | regulation of neurogenesis 23 5.0 5.3e-03 ACAN, CAMK2B, HAPLN1, DSCAM, GFAP, GRM5, MAG, MAP1B, NKX6-1, NTRK2, TP73, WNT5A, FSTL4, HEY2, DAAM2, SOX8, TREM2, SEMA5B, DPYSL5, BCAN, IL34, ASPM, WDR62
GO:0050769 | positive regulation of neurogenesis 16 3.5 1.1e-02 ACAN, CAMK2B, HAPLN1, DSCAM, GFAP, GRM5, MAG, MAP1B, NKX6-1, NTRK2, TP73, SOX8, BCAN, IL34, ASPM, WDR62
GO:0001764 | neuron migration 13 2.8 1.4e-02 CAMK2B, CTNNA2, EMX2, MAP1B, NKX6-1, NRCAM, NTRK2, SPOCK1, CNTN2, TWIST1, DNER, ASPM, WDR62
GO:0048638 | regulation of developmental growth 19 4.2 1.5e-02 APOE, DSCAM, FOXC2, FOXS1, KCNK2, MAG, MAP1B, NKX6-1, NRCAM, SIX1, SLC6A3, TP73, WNT5A, AGR2, UNC13A, FSTL4, HEY2, SEMA5B, GPAM
GO:0010975 | regulation of neuron projection development 23 5.0 2.2e-02 ALK, APOE, KIF1A, CAMK2B, CTNNA2, DSCAM, GFAP, GRID2, MAG, MAP1B, NRCAM, NTRK2, SDC2, SFRP2, SPOCK1, CNTN2, WNT5A, NLGN1, FSTL4, SEMA5B, DPYSL5, CAMK1D, TRPV4
GO:0010001 | glial cell differentiation 15 3.3 3.4e-02 ACAN, HAPLN1, GAP43, GFAP, MAG, NKX6-1, NTRK2, CNTN2, TP73, DAAM2, SOX8, TREM2, BCAN, DNER, IL34
GO:0061387 | regulation of extent of cell growth 9 2.0 3.4e-02 APOE, DSCAM, MAG, MAP1B, NKX6-1, NRCAM, WNT5A, FSTL4, SEMA5B
GO:0043583 | ear development 17 3.7 2.2e-03 JAG1, COL11A1, GSDME, DLX5, KCNK2, MSX1, SIX1, TFAP2A, TWIST1, WNT5A, ZIC1, TBX18, SIX2, HEY2, STRA6, CTHRC1, MYO3B
GO:0090596 | sensory organ morphogenesis 19 4.2 3.3e-03 JAG1, COL11A1, DLX5, DSCAM, MSX1, NTRK2, SIX1, TFAP2A, TWIST1, WNT5A, ZIC1, TBX18, SIX2, FJX1, SOX8, STRA6, CTHRC1, MYO3B, HCN1
GO:0042471 | ear morphogenesis 12 2.6 3.6e-03 COL11A1, DLX5, MSX1, SIX1, TFAP2A, TWIST1, WNT5A, ZIC1, TBX18, SIX2, CTHRC1, MYO3B
GO:0090102 | cochlea development 7 1.5 6.5e-03 KCNK2, SIX1, WNT5A, TBX18, HEY2, CTHRC1, MYO3B
GO:0060537 | muscle tissue development 24 5.3 7.4e-03 CENPF, COL11A1, EYA2, FOXC2, GPX1, KCNK2, MSX1, RYR1, SIX1, TP73, TWIST1, WNT5A, BARX2, TBX18, HEY2, SOX8, NOX4, STRA6, MEGF10, MYO18B, MYLK2, DNER, ALPK2, SGCZ
GO:0090103 | cochlea morphogenesis 5 1.1 1.0e-02 SIX1, WNT5A, TBX18, CTHRC1, MYO3B
GO:2000027 | regulation of animal organ morphogenesis 11 2.4 1.0e-02 AGT, CELSR3, MSX1, SFRP2, SIX1, WNT5A, SIX2, SOX8, WNT4, SAPCD2, CTHRC1
GO:0048839 | inner ear development 14 3.1 1.1e-02 JAG1, COL11A1, GSDME, DLX5, KCNK2, MSX1, SIX1, TFAP2A, WNT5A, ZIC1, TBX18, HEY2, CTHRC1, MYO3B
GO:0055001 | muscle cell development 14 3.1 1.1e-02 GPX1, RYR1, SDC1, SIX1, TNNT1, UCHL1, TBX18, HEY2, MEGF10, MYO18B, DNER, ALPK2, WFIKKN1, SGCZ
GO:0048701 | embryonic cranial skeleton morphogenesis 6 1.3 2.2e-02 FOXC2, SIX1, TBX15, TFAP2A, TWIST1, SIX2
GO:0072001 | renal system development 21 4.6 3.1e-03 JAG1, AGT, AKR1B1, CENPF, EMX2, ENPEP, FOXD1, FOXC2, MMP17, SDC1, SIX1, TFAP2A, TP73, WNT5A, TBX18, GCNT3, SIX2, SOX8, WNT4, STRA6, CD24
GO:0090183 | regulation of kidney development 6 1.3 7.2e-03 AGT, FOXD1, SIX1, SIX2, SOX8, WNT4
GO:0001822 | kidney development 19 4.2 1.0e-02 JAG1, AGT, AKR1B1, CENPF, ENPEP, FOXD1, FOXC2, MMP17, SDC1, SIX1, TFAP2A, TP73, WNT5A, GCNT3, SIX2, SOX8, WNT4, STRA6, CD24
GO:1905330 | regulation of morphogenesis of an epithelium 7 1.5 2.7e-02 AGT, SIX1, WNT5A, SIX2, SOX8, WNT4, RNF207
GO:0050921 | positive regulation of chemotaxis 13 2.8 3.4e-03 C3AR1, DSCAM, HSPB1, PGF, THBS4, WNT5A, SCG2, TREM2, CAMK1D, S100A14, TRPV4, SMOC2, IL34
GO:0071622 | regulation of granulocyte chemotaxis 7 1.5 1.1e-02 C3AR1, DPP4, THBS4, CAMK1D, S100A14, TRPV4, IL34
GO:0050920 | regulation of chemotaxis 15 3.3 1.8e-02 C3AR1, DPP4, DSCAM, HSPB1, PGF, THBS4, WNT5A, SCG2, TREM2, SEMA5B, CAMK1D, S100A14, TRPV4, SMOC2, IL34
GO:0002690 | positive regulation of leukocyte chemotaxis 8 1.8 4.7e-02 C3AR1, PGF, THBS4, WNT5A, CAMK1D, S100A14, TRPV4, IL34
GO:0003151 | outflow tract morphogenesis 9 2.0 7.2e-03 JAG1, FOXC2, RYR1, SFRP2, SIX1, TWIST1, WNT5A, DHRS3, HEY2
GO:0048762 | mesenchymal cell differentiation 16 3.5 2.1e-02 JAG1, AGT, COL1A1, FOXC2, LOXL2, MSX1, SFRP2, SIX1, TWIST1, WNT5A, SIX2, HEY2, SOX8, WNT4, SEMA5B, ZNF703
GO:0014706 | striated muscle tissue development 16 3.5 2.2e-02 CENPF, COL11A1, EYA2, FOXC2, KCNK2, MSX1, TP73, TWIST1, WNT5A, TBX18, HEY2, NOX4, MYO18B, MYLK2, ALPK2, SGCZ
GO:0060485 | mesenchyme development 18 3.9 2.9e-02 JAG1, AGT, AMH, COL1A1, FOXD1, FOXC2, LOXL2, MSX1, SFRP2, SIX1, TWIST1, WNT5A, SIX2, HEY2, SOX8, WNT4, SEMA5B, ZNF703
GO:0003007 | heart morphogenesis 15 3.3 4.2e-02 JAG1, COL11A1, FOXC2, MSX1, RYR1, SFRP2, SIX1, TWIST1, WNT5A, DHRS3, HEY2, MYLK2, ALPK2, RBM20, RNF207
GO:0061311 | cell surface receptor signaling pathway involved in heart development 5 1.1 1.3e-02 JAG1, MSX1, WNT5A, HEY2, ALPK2
GO:0120254 | olefinic compound metabolic process 12 2.6 1.9e-02 ABCA4, AKR1B1, ALOX15B, AKR1C1, AKR1C2, GPX1, GRIN1, SRD5A1, PLA2G4C, RDH16, DHRS3, WNT4
GO:0008207 | C21-steroid hormone metabolic process 5 1.1 4.0e-02 AKR1B1, AKR1C1, AKR1C2, SRD5A1, WNT4
GO:0042445 | hormone metabolic process 14 3.1 4.7e-02 AKR1B1, AKR1C1, AKR1C2, DIO2, DPP4, ENPEP, FOXE1, PCSK2, SLC5A5, SRD5A1, RDH16, DHRS3, PCSK1N, WNT4

This just shows the second slot inside the EnrichGT_obj object. The second slot - tinytable_obj is a pure object of tinytable package, you can use any function on it.

For further usage of tinytable package, please refer to https://vincentarelbundock.github.io/tinytable/vignettes/tinytable.html.

See re-enrichment example for further demo.

Quarto full-report

Function egt_generate_quarto_report() can help you convert re-enrichment object to an all-in-one Quarto document containing all enrichment results. You can use RStudio or Positron to knit them (preview) into HTML document.

Ploting functions

HTML tinytable table satisfied most of things, but for others. Though we don’t want this package become complex (i.e., you can simple draw your figure using ggplot2 for enriched tables by yourself.) But we still provide limited figure ploting functions.

Basic result plot

The Dot Plot provide basic viewing of results. So it supports both simple enrichment result data.frame and re-enriched egt_object.

You can adjust this figure by these params:

  • ntop: Show top N in each cluster. In default, for origin enriched result, showing top 15; for re-clustered object, showing top 5 in each cluster.
  • showIDs: bool, show pathway IDs or not. Default is FALSE
  • max_len_descript: the label format length, default as 40.
  • P.adj: If pass an origin data.frame from original enriched result, you can specify the P-adjust value cut off. If is null, default is 0.05. When passing EnrichGT_obj, this filter is previously done by egt_recluster_analysis.
  • low.col: the color for the lowest
  • hi.col: the color for the highest

Ploting ORA result

egt_plot_results(ora_result)
ℹ Use Default P-adjust cut-off 0.05. You can pass `P.adj=xxx` arugument to filter. 
! You are drawing origin results, for better result you can re-cluster it by egt_recluster_analysis()

Ploting GSEA result

egt_plot_results(resGSEA)
ℹ Use Default P-adjust cut-off 0.05. You can pass `P.adj=xxx` arugument to filter. 
! You are drawing origin results, for better result you can re-cluster it by egt_recluster_analysis()

Ploting re-enrichment result

egt_plot_results(re_enrich)

Additional GSEA plots

Since version 0.8.6, EnrichGT provides a function called egt_plot_gsea() to help users to get typical ranking plots. If you pass a pathway name to the first param of this function, egt_plot_gsea() will return a ranking plot of single pathway. For multiple pathway, you need to subset the data.frame result of egt_gsea_analysis().

The param contains:

  • x: A GSEA result object. Can be either:
    • A data frame containing GSEA results (requires columns: pvalue, p.adjust, Description)
    • A character string specifying a single pathway name
  • genes and database should be the same as you doing egt_gsea_analysis()
Why multiple results plotting function needs a data.frame

You can see the result figure, we need the NES and p-values for display.

Single ranking plot

You need to prepare your favourite pathway’s name:

1class(resGSEA$Description[1])
2resGSEA$Description[1]
1
This is a vector.
2
If you need the single-plot, all you pass to egt_plot_gsea() is the name of this pathway, subset from resGSEA.
[1] "character"
[1] "regulation of postsynaptic membrane potential"

And then using egt_plot_gsea() for drawing. The other params should be the same as you provided in origin GSEA analysis.

egt_plot_gsea(resGSEA$Description[1],
              genes = genes_with_weights(genes = DEGexample$...1, 
                                              weights = DEGexample$log2FoldChange),
              database = database_GO_BP(org.Hs.eg.db))
✔ success loaded database, time used : 17.9029018878937 sec.

Table-like visualization GSEA result

Warning

If you want to plot this plot, remember to filter the GSEA results to ~10 to ~20, you can base on NES or p-values. This is to avoid too many loading to this plotting.

You need to subset the origin GSEA result data.frame according to NES or p-val to gain your targets. In this demo, we choose row 1 to row 8.

1class(resGSEA[1:8,])
2resGSEA[1:8,]
1
This is a data.frame. Please subset it to avoid too many results and the waste of time.
2
You need to subset data frame according to NES (suggests: abs(NES)>1) and p-value, too avoiding too many outputs and wasting.
[1] "tbl_df"     "tbl"        "data.frame"
# A tibble: 8 × 7
  ID         Description               ES   NES  pvalue p.adjust core_enrichment
  <chr>      <chr>                  <dbl> <dbl>   <dbl>    <dbl> <chr>          
1 GO:0060078 regulation of postsyn… 0.564  1.94 4.60e-6 0.000188 GRIK3/HCN1/GRM…
2 GO:0007216 G protein-coupled glu… 0.840  1.92 1.31e-4 0.00295  GRIK3/GRM1/GRM…
3 GO:0050907 detection of chemical… 0.767  1.92 1.55e-4 0.00342  OR51E1/CST1/OR…
4 GO:0035249 synaptic transmission… 0.560  1.92 1.87e-5 0.000621 GRIK3/UNC13C/G…
5 GO:0050906 detection of stimulus… 0.594  1.90 4.98e-5 0.00136  OR51E1/CST1/OR…
6 GO:0061982 meiosis I cell cycle … 0.553  1.87 1.09e-4 0.00259  SPATA22/KASH5/…
7 GO:0051966 regulation of synapti… 0.581  1.87 7.66e-5 0.00191  GRIK3/GRM1/CAC…
8 GO:0031577 spindle checkpoint si… 0.627  1.86 5.57e-4 0.00905  SPC24/BIRC5/PL…

And then using egt_plot_gsea() for drawing. The other params should be the same as you provided in origin GSEA analysis.

egt_plot_gsea(resGSEA[1:8,], 
              genes = genes_with_weights(genes = DEGexample$...1, 
                                              weights = DEGexample$log2FoldChange),
              database = database_GO_BP(org.Hs.eg.db))
✔ Use cached database: GO_BP_org.Hs.eg.db

UMAP plot for re-enrichment (no longer supported)

Before version 0.8.6, UMAP plot is provided in re-enriched egt_object, to show the dimensionality reduction view of enriched results.

A word frequency matrix represents the frequency of words or tokens across different documents or text samples. Each row corresponds to a document, and each column represents a word or token, with the cell values indicating the frequency of the respective word in that document.However, high-dimensional data like word frequency matrices can be challenging to interpret directly. To make such data easier to analyze, we can reduce its dimensionality and visualize the patterns or clusters in a 2D or 3D space. UMAP (Uniform Manifold Approximation and Projection) is a powerful, non-linear dimensionality reduction technique widely used for this purpose.

But since 0.8.6, because umap and ggrepel have too many dependencies, and this function is not nesessary in most of cases. We now don’t support it. If you still needs this figure, you can execute following code.

library(umap)
library(ggrepel)
mat<-x@document_term_matrix
umap_result <- umap::umap(mat)
umap_df <- data.frame(ID=rownames(umap_result[["layout"]]),
                      UMAP1 = umap_result$layout[, 1],
                      UMAP2 = umap_result$layout[, 2])
udf<-x@enriched_result |> left_join(umap_df,by="ID")
fig<-ggplot(udf, aes(x = UMAP1, y = UMAP2, color = Cluster)) +
  geom_point(size = 2) +
  geom_text_repel(aes(label = Description),
                  size = 3,
                  max.overlaps = 20,
                  box.padding = 0.3,
                  point.padding = 0.2) +
  labs(title = "Enrichment Results",
        x = "UMAP1", y = "UMAP2") +
  theme_classic()
fig
Back to top