categoryCompare2: visNetwork

categoryCompare2: Alternative Visualization

Authored by: Robert M Flight <[email protected]> on 2026-07-04 05:43:04.629882

Introduction

Current high-throughput molecular biology experiments are generating larger and larger amounts of data. Although there are many different methods to analyze individual experiments, methods that allow the comparison of different data sets are sorely lacking. This is important due to the number of experiments that have been carried out on biological systems that may be amenable to either fusion or comparison. Most of the current tools available focus on finding those genes in experiments that are listed as the same, or that can be shown statistically that it is significant that the gene was listed in the results of both experiments.

However, what many of these tools do not do is consider the similarities (and just as importantly, the differences) between experimental results at the categorical level. Categoical data includes any gene annotation, such as Gene Ontologies, KEGG pathways, chromosome location, etc. categoryCompare has been developed to allow the comparison of high-throughput experiments at a categorical level, and to explore those results in an intuitive fashion.

Sample Data

To make the concept more concrete, we will examine data from the microarray data set estrogen available from Bioconductor. This data set contains 8 samples, with 2 levels of estrogen therapy (present vs absent), and two time points (10 and 48 hours). A pre-processed version of the data is available with this package, the commands used to generate it are below. Note: the preprocessed one keeps only the top 100 genes, if you use it the results will be slightly different than those shown in the vignette.

library("affy")
library("hgu95av2.db")
library("genefilter")
library("estrogen")
library("limma")
datadir <- system.file("extdata", package = "estrogen")
pd <- read.AnnotatedDataFrame(
  file.path(datadir, "estrogen.txt"),
  header = TRUE,
  sep = "",
  row.names = 1
)
pData(pd)

Here you can see the descriptions for each of the arrays. First, we will read in the cel files, and then normalize the data using RMA.

currDir <- getwd()
setwd(datadir)
a <- ReadAffy(filenames = rownames(pData(pd)), phenoData = pd, verbose = TRUE)
setwd(currDir)
eData <- rma(a)

To make it easier to conceptualize, we will split the data up into two eSet objects by time, and perform all of the manipulations for calculating significantly differentially expressed genes on each eSet object.

So for the 10 hour samples:

e_file <- system.file(
  "extdata/test_data/estrogen_edata.rds",
  package = "categoryCompare2"
)
eData <- readRDS(e_file)
e10 <- eData[, eData$time.h == 10]
e10 <- nsFilter(
  e10,
  remove.dupEntrez = TRUE,
  var.filter = FALSE,
  feature.exclude = "^AFFX"
)$eset

e10$estrogen <- factor(e10$estrogen)
d10 <- model.matrix(~ 0 + e10$estrogen)
colnames(d10) <- unique(e10$estrogen)
fit10 <- lmFit(e10, d10)
c10 <- makeContrasts(present - absent, levels = d10)
fit10_2 <- contrasts.fit(fit10, c10)
eB10 <- eBayes(fit10_2)
table10 <- topTable(eB10, number = nrow(e10), p.value = 1, adjust.method = "BH")
table10$Entrez <- unlist(mget(
  rownames(table10),
  hgu95av2ENTREZID,
  ifnotfound = NA
))

And the 48 hour samples we do the same thing:

e48 <- eData[, eData$time.h == 48]
e48 <- nsFilter(
  e48,
  remove.dupEntrez = TRUE,
  var.filter = FALSE,
  feature.exclude = "^AFFX"
)$eset

e48$estrogen <- factor(e48$estrogen)
d48 <- model.matrix(~ 0 + e48$estrogen)
colnames(d48) <- unique(e48$estrogen)
fit48 <- lmFit(e48, d48)
c48 <- makeContrasts(present - absent, levels = d48)
fit48_2 <- contrasts.fit(fit48, c48)
eB48 <- eBayes(fit48_2)
table48 <- topTable(eB48, number = nrow(e48), p.value = 1, adjust.method = "BH")
table48$Entrez <- unlist(mget(
  rownames(table48),
  hgu95av2ENTREZID,
  ifnotfound = NA
))

And grab all the genes on the array to have a background set.

gUniverse <- unique(union(table10$Entrez, table48$Entrez))

For both time points we have generated a list of genes that are differentially expressed in the present vs absent samples. To compare the time-points, we could find the common and discordant genes from both experiments, and then try to interpret those lists. This is commonly done in many meta-analysis studies that attempt to combine the results of many different experiments.

An alternative approach, used in categoryCompare, would be to compare the significantly enriched categories from the two gene lists. Currently the package supports two category classes, Gene Ontology, and KEGG pathways. Both are used below.

Note 1: I am not proposing that this is the best way to analyse this particular data, it is a sample data set that merely serves to illustrate the functionality of this package. However, there are many different experiments where this type of approach is definitely appropriate, and it is up to the user to determine if their data fits the analytical paradigm advocated here.

Create Gene List

library("categoryCompare2")
library("GO.db")
library("org.Hs.eg.db")

g10 <- unique(table10$Entrez[table10$adj.P.Val < 0.05])
g48 <- unique(table48$Entrez[table48$adj.P.Val < 0.05])

Create GO Annotation Object

Before we can do our analysis, we need to define the annotation object, which maps the annotations to the features (genes in this case). For a Gene Ontology (GO) based analysis, this would be all the genes annotated to a particular GO term based on inheritance in the GO DAG. We can generate this list using the GOALL column of the org.Hs.eg.db, and then filter to the terms of interest, or use them all.

go_all_gene <- AnnotationDbi::select(
  org.Hs.eg.db,
  keys = gUniverse,
  columns = c("GOALL", "ONTOLOGYALL")
)
## 'select()' returned 1:many mapping between keys and columns
go_all_gene <- go_all_gene[go_all_gene$ONTOLOGYALL == "BP", ]
bp_2_gene <- split(go_all_gene$ENTREZID, go_all_gene$GOALL)

bp_2_gene <- lapply(bp_2_gene, unique)
bp_desc <- AnnotationDbi::select(
  GO.db,
  keys = names(bp_2_gene),
  columns = "TERM",
  keytype = "GOID"
)$TERM
## 'select()' returned 1:1 mapping between keys and columns
names(bp_desc) <- names(bp_2_gene)

bp_annotation <- categoryCompare2::annotation(
  annotation_features = bp_2_gene,
  description = bp_desc,
  annotation_type = "GO.BP"
)

Do Enrichment

Now we can do hypergeometric enrichment with each of the gene lists.

g10_enrich <- hypergeometric_feature_enrichment(
  new(
    "hypergeometric_features",
    significant = g10,
    universe = gUniverse,
    annotation = bp_annotation
  ),
  p_adjust = "BH"
)

g48_enrich <- hypergeometric_feature_enrichment(
  new(
    "hypergeometric_features",
    significant = g48,
    universe = gUniverse,
    annotation = bp_annotation
  ),
  p_adjust = "BH"
)

Combine and Find Significant

bp_combined <- combine_enrichments(g10 = g10_enrich, g48 = g48_enrich)
bp_sig <- get_significant_annotations(
  bp_combined,
  padjust <= 0.001,
  counts >= 2
)
bp_sig@statistics@significant
## Signficance Cutoffs:
##   ~padjust <= 0.001
##   ~counts >= 2
## 
## Counts:
##    g10 g48 counts
## G1   1   1     54
## G2   1   0     45
## G3   0   1     41
## G4   0   0  12944

Generate Graph

bp_graph <- generate_annotation_graph(bp_sig)
bp_graph
## A cc_graph with
## Number of Nodes = 118 
## Number of Edges = 5922 
##    g10 g48 counts
## G1   1   1     46
## G2   1   0     31
## G3   0   1     41
bp_graph <- remove_edges(bp_graph, 0.8)
## Removed 5702 edges from graph
bp_graph
## A cc_graph with
## Number of Nodes = 118 
## Number of Edges = 220 
##    g10 g48 counts
## G1   1   1     46
## G2   1   0     31
## G3   0   1     41
bp_assign <- annotation_combinations(bp_graph)
bp_assign <- assign_colors(bp_assign)

visNetwork Visualization

We can use the DiagrammeR and visNetwork html widgets to create interactive visualizations either in the RStudio viewer, or as panes in the html report.

Find Communities

It is useful to define the annotations in terms of their communities. To do this we run methods that find and then label the communities, before generating the visualization and table.

bp_communities <- assign_communities(bp_graph)
bp_comm_labels <- label_communities(bp_communities, bp_annotation)

Create Stats Table

To provide a list of which GO terms are in each of the communities we found, lets generate a table, with the community labels so it makes it easier to find them in the graph if desired.

bp_table <- table_from_graph(bp_graph, bp_assign, bp_comm_labels)
knitr::kable(bp_table)
name description sig_group g10.p g10.odds g10.expected g10.counts g10.padjust g10.significant g48.p g48.odds g48.expected g48.counts g48.padjust g48.significant group
regulation of cell cycle process NA NA NA NA NA NA NA NA NA NA NA NA 1
GO:0007346 regulation of mitotic cell cycle g10,g48 0.0000000 2.711846e+00 24.5972807 56 0.0000009 686 0.0000000 6.456239 3.4780412 18 0.0000017 97 1
GO:0010564 regulation of cell cycle process g10,g48 0.0000000 2.497727e+00 34.6673084 73 0.0000001 686 0.0000000 5.412050 4.9019372 21 0.0000022 97 1
GO:0044770 cell cycle phase transition g10,g48 0.0000000 3.350240e+00 26.8258934 71 0.0000000 686 0.0000000 8.142832 3.7931657 23 0.0000000 97 1
GO:0044772 mitotic cell cycle phase transition g10,g48 0.0000000 3.217344e+00 21.5432559 56 0.0000000 686 0.0000000 9.788006 3.0462038 22 0.0000000 97 1
GO:1901987 regulation of cell cycle phase transition g10,g48 0.0000000 3.522127e+00 21.6257971 60 0.0000000 686 0.0000000 7.442415 3.0578751 18 0.0000003 97 1
GO:1901990 regulation of mitotic cell cycle phase transition g10,g48 0.0000000 3.428467e+00 16.3431597 45 0.0000001 686 0.0000000 9.431008 2.3109132 17 0.0000000 97 1
negative regulation of cell cycle NA NA NA NA NA NA NA NA NA NA NA NA 2
GO:0000075 cell cycle checkpoint signaling g10,g48 0.0000000 7.170612e+00 8.9144507 41 0.0000000 686 0.0000000 14.570623 1.2604981 14 0.0000000 97 2
GO:0010948 negative regulation of cell cycle process g10,g48 0.0000000 4.626959e+00 14.0320058 48 0.0000000 686 0.0000000 9.511015 1.9841174 15 0.0000003 97 2
GO:0045786 negative regulation of cell cycle g10,g48 0.0000000 3.575258e+00 18.4066899 52 0.0000000 686 0.0000000 7.040924 2.6026952 15 0.0000072 97 2
GO:1901988 negative regulation of cell cycle phase transition g10,g48 0.0000000 5.263971e+00 11.7208519 44 0.0000000 686 0.0000000 10.655497 1.6573216 14 0.0000003 97 2
chromosome segregation NA NA NA NA NA NA NA NA NA NA NA NA 3
GO:0000070 mitotic sister chromatid segregation g10,g48 0.0000000 3.828760e+00 9.9049453 30 0.0000062 686 0.0000000 14.127178 1.4005535 15 0.0000000 97 3
GO:0000819 sister chromatid segregation g10,g48 0.0000000 3.484665e+00 11.7208519 33 0.0000080 686 0.0000000 13.751300 1.6573216 17 0.0000000 97 3
GO:0007059 chromosome segregation g10,g48 0.0000009 2.605517e+00 17.9114427 40 0.0001669 686 0.0000000 9.176897 2.5326675 18 0.0000000 97 3
GO:0098813 nuclear chromosome segregation g10,g48 0.0000005 3.032159e+00 13.0415113 33 0.0000936 686 0.0000000 13.140325 1.8440621 18 0.0000000 97 3
DNA integrity checkpoint signaling NA NA NA NA NA NA NA NA NA NA NA NA 4
GO:0000077 DNA damage checkpoint signaling g10 0.0000000 5.841335e+00 5.1175550 21 0.0000027 686 0.0007468 7.777460 0.7236193 5 0.0522490 97 4
GO:0031570 DNA integrity checkpoint signaling g10 0.0000000 7.331721e+00 5.9429672 28 0.0000000 686 0.0001817 8.139860 0.8403321 6 0.0158355 97 4
cell cycle G2/M phase transition NA NA NA NA NA NA NA NA NA NA NA NA 5
GO:0000086 G2/M transition of mitotic cell cycle g10,g48 0.0000001 4.448654e+00 6.7683793 23 0.0000252 686 0.0000000 18.268633 0.9570449 13 0.0000000 97 5
GO:0010389 regulation of G2/M transition of mitotic cell cycle g10,g48 0.0000004 5.241363e+00 4.7048490 18 0.0000769 686 0.0000000 19.973099 0.6652629 10 0.0000003 97 5
GO:0044839 cell cycle G2/M phase transition g10,g48 0.0000002 4.089642e+00 7.5112502 24 0.0000453 686 0.0000000 16.142857 1.0620864 13 0.0000000 97 5
GO:1902749 regulation of cell cycle G2/M phase transition g10,g48 0.0000024 4.439664e+00 5.2826375 18 0.0003884 686 0.0000000 17.369093 0.7469619 10 0.0000008 97 5
organelle fission NA NA NA NA NA NA NA NA NA NA NA NA 6
GO:0000280 nuclear division g10,g48 0.0000000 2.863669e+00 17.9114427 43 0.0000103 686 0.0000000 9.861694 2.5326675 19 0.0000000 97 6
GO:0048285 organelle fission g10,g48 0.0000000 2.782536e+00 19.6448081 46 0.0000080 686 0.0000000 8.892694 2.7777644 19 0.0000000 97 6
GO:0140014 mitotic nuclear division g10,g48 0.0000004 2.938545e+00 14.1970882 35 0.0000828 686 0.0000000 11.048629 2.0074600 17 0.0000000 97 6
chromosome localization NA NA NA NA NA NA NA NA NA NA NA NA 7
GO:0007080 mitotic metaphase chromosome alignment g48 0.0006140 4.162832e+00 3.0540248 10 0.0350792 686 0.0000002 21.217778 0.4318373 7 0.0000316 97 7
GO:0050000 chromosome localization g48 0.0006900 3.093954e+00 5.3651787 14 0.0379328 686 0.0000008 12.863394 0.7586331 8 0.0001170 97 7
GO:0051310 metaphase chromosome alignment g48 0.0001615 3.673450e+00 4.7048490 14 0.0114866 686 0.0000003 14.978216 0.6652629 8 0.0000434 97 7
positive regulation of mitotic cell cycle NA NA NA NA NA NA NA NA NA NA NA NA 8
GO:0045931 positive regulation of mitotic cell cycle g48 0.0001386 3.203911e+00 6.3556732 17 0.0100169 686 0.0000002 12.251671 0.8986885 9 0.0000388 97 8
GO:1901989 positive regulation of cell cycle phase transition g48 0.0000442 3.769652e+00 5.2826375 16 0.0041347 686 0.0000007 13.094703 0.7469619 8 0.0001049 97 8
GO:1901992 positive regulation of mitotic cell cycle phase transition g48 0.0000198 4.348275e+00 4.4572254 15 0.0020404 686 0.0000002 15.960918 0.6302491 8 0.0000300 97 8
negative regulation of mitotic cell cycle NA NA NA NA NA NA NA NA NA NA NA NA 9
GO:0007093 mitotic cell cycle checkpoint signaling g10,g48 0.0000000 7.218941e+00 6.4382144 30 0.0000000 686 0.0000000 19.402381 0.9103598 13 0.0000000 97 9
GO:0045930 negative regulation of mitotic cell cycle g10,g48 0.0000000 4.354261e+00 10.5652749 35 0.0000000 686 0.0000000 10.899275 1.4939237 13 0.0000007 97 9
GO:1901991 negative regulation of mitotic cell cycle phase transition g10,g48 0.0000000 5.007953e+00 8.1715798 30 0.0000001 686 0.0000000 14.626800 1.1554566 13 0.0000000 97 9
negative regulation of cell cycle G2/M phase transition NA NA NA NA NA NA NA NA NA NA NA NA 10
GO:0010972 negative regulation of G2/M transition of mitotic cell cycle g10,g48 0.0000057 5.872214e+00 3.1365660 13 0.0007811 686 0.0000002 20.530824 0.4435086 7 0.0000378 97 10
GO:0044818 mitotic G2/M transition checkpoint g48 0.0000204 6.196667e+00 2.5587775 11 0.0020839 686 0.0000013 21.597363 0.3618096 6 0.0001892 97 10
GO:1902750 negative regulation of cell cycle G2/M phase transition g48 0.0000109 5.435804e+00 3.3016484 13 0.0013589 686 0.0000003 19.281818 0.4668512 7 0.0000521 97 10
chromosome separation NA NA NA NA NA NA NA NA NA NA NA NA 11
GO:0010965 regulation of mitotic sister chromatid separation g10,g48 0.0000049 5.456897e+00 3.5492720 14 0.0006794 686 0.0000000 28.495298 0.5018650 10 0.0000000 97 11
GO:0051306 mitotic sister chromatid separation g10,g48 0.0000066 5.274306e+00 3.6318133 14 0.0008842 686 0.0000000 27.653820 0.5135363 10 0.0000000 97 11
GO:0051784 negative regulation of nuclear division g10,g48 0.0000036 5.652530e+00 3.4667308 14 0.0005414 686 0.0000000 21.625909 0.4901937 8 0.0000045 97 11
GO:0007094 mitotic spindle assembly checkpoint signaling g48 0.0000091 6.152954e+00 2.8064012 12 0.0011567 686 0.0000000 28.307692 0.3968235 8 0.0000010 97 11
GO:0031577 spindle checkpoint signaling g48 0.0000091 6.152954e+00 2.8064012 12 0.0011567 686 0.0000000 28.307692 0.3968235 8 0.0000010 97 11
GO:0033046 negative regulation of sister chromatid segregation g48 0.0000128 5.884660e+00 2.8889424 12 0.0015257 686 0.0000000 27.255930 0.4084948 8 0.0000012 97 11
GO:0033047 regulation of mitotic sister chromatid segregation g48 0.0000148 5.240979e+00 3.3841896 13 0.0016813 686 0.0000000 26.149858 0.4785224 9 0.0000003 97 11
GO:0033048 negative regulation of mitotic sister chromatid segregation g48 0.0000128 5.884660e+00 2.8889424 12 0.0015257 686 0.0000000 27.255930 0.4084948 8 0.0000012 97 11
GO:0045839 negative regulation of mitotic nuclear division g48 0.0000148 5.240979e+00 3.3841896 13 0.0016813 686 0.0000000 22.283963 0.4785224 8 0.0000037 97 11
GO:0045841 negative regulation of mitotic metaphase/anaphase transition g48 0.0000128 5.884660e+00 2.8889424 12 0.0015257 686 0.0000000 27.255930 0.4084948 8 0.0000012 97 11
GO:0051304 chromosome separation g48 0.0000860 3.950521e+00 4.4572254 14 0.0067753 686 0.0000000 21.342738 0.6302491 10 0.0000002 97 11
GO:0051985 negative regulation of chromosome segregation g48 0.0000178 5.638724e+00 2.9714836 12 0.0019104 686 0.0000000 26.279294 0.4201660 8 0.0000014 97 11
GO:0071173 spindle assembly checkpoint signaling g48 0.0000091 6.152954e+00 2.8064012 12 0.0011567 686 0.0000000 28.307692 0.3968235 8 0.0000010 97 11
GO:0071174 mitotic spindle checkpoint signaling g48 0.0000091 6.152954e+00 2.8064012 12 0.0011567 686 0.0000000 28.307692 0.3968235 8 0.0000010 97 11
GO:1902100 negative regulation of metaphase/anaphase transition of cell cycle g48 0.0000178 5.638724e+00 2.9714836 12 0.0019104 686 0.0000000 26.279294 0.4201660 8 0.0000014 97 11
GO:1905818 regulation of chromosome separation g48 0.0000547 4.159540e+00 4.2921429 14 0.0047122 686 0.0000000 22.364532 0.6069065 10 0.0000001 97 11
GO:1905819 negative regulation of chromosome separation g48 0.0000178 5.638724e+00 2.9714836 12 0.0019104 686 0.0000000 26.279294 0.4201660 8 0.0000014 97 11
GO:2000816 negative regulation of mitotic sister chromatid separation g48 0.0000128 5.884660e+00 2.8889424 12 0.0015257 686 0.0000000 27.255930 0.4084948 8 0.0000012 97 11
regulation of chromosome segregation NA NA NA NA NA NA NA NA NA NA NA NA 12
GO:0007091 metaphase/anaphase transition of mitotic cell cycle g48 0.0000359 3.850365e+00 5.2000963 16 0.0034517 686 0.0000000 20.076476 0.7352906 11 0.0000000 97 12
GO:0030071 regulation of mitotic metaphase/anaphase transition g48 0.0000289 3.934588e+00 5.1175550 16 0.0028472 686 0.0000000 20.472640 0.7236193 11 0.0000000 97 12
GO:0033045 regulation of sister chromatid segregation g48 0.0000385 3.630426e+00 5.7778847 17 0.0036703 686 0.0000000 19.852333 0.8169895 12 0.0000000 97 12
GO:0044784 metaphase/anaphase transition of cell cycle g48 0.0000442 3.769652e+00 5.2826375 16 0.0041347 686 0.0000000 19.695261 0.7469619 11 0.0000001 97 12
GO:0051983 regulation of chromosome segregation g48 0.0003098 2.955502e+00 6.7683793 17 0.0202488 686 0.0000000 18.268633 0.9570449 13 0.0000000 97 12
GO:1902099 regulation of metaphase/anaphase transition of cell cycle g48 0.0000359 3.850365e+00 5.2000963 16 0.0034517 686 0.0000000 20.076476 0.7352906 11 0.0000000 97 12
cell cycle DNA replication initiation NA NA NA NA NA NA NA NA NA NA NA NA 13
GO:1902292 cell cycle DNA replication initiation g10 0.0000038 1.000000e+100 0.4127061 5 0.0005458 686 0.0000152 131.042553 0.0583564 3 0.0018532 97 13
GO:1902315 nuclear cell cycle DNA replication initiation g10 0.0000038 1.000000e+100 0.4127061 5 0.0005458 686 0.0000152 131.042553 0.0583564 3 0.0018532 97 13
GO:1902975 mitotic DNA replication initiation g10 0.0000038 1.000000e+100 0.4127061 5 0.0005458 686 0.0000152 131.042553 0.0583564 3 0.0018532 97 13
positive regulation of chromosome organization NA NA NA NA NA NA NA NA NA NA NA NA 14
GO:0032206 positive regulation of telomere maintenance g10 0.0000053 4.991014e+00 4.0445193 15 0.0007337 686 0.4383822 1.772135 0.5718927 1 1.0000000 97 14
GO:2001252 positive regulation of chromosome organization g10 0.0000018 4.315592e+00 5.6953435 19 0.0003039 686 0.0464502 3.940039 0.8053183 3 0.9030530 97 14
recombinational repair NA NA NA NA NA NA NA NA NA NA NA NA 15
GO:0000724 double-strand break repair via homologous recombination g10,g48 0.0000000 4.297989e+00 8.1715798 27 0.0000044 686 0.0000020 9.231818 1.1554566 9 0.0002923 97 15
GO:0000725 recombinational repair g10,g48 0.0000000 4.402215e+00 8.3366623 28 0.0000017 686 0.0000024 9.028903 1.1787992 9 0.0003422 97 15
positive regulation of chromosome separation NA NA NA NA NA NA NA NA NA NA NA NA 16
GO:1901970 positive regulation of mitotic sister chromatid separation g48 0.0235850 4.466276e+00 1.1555769 4 0.4969177 686 0.0000000 67.631868 0.1633979 6 0.0000014 97 16
GO:1905820 positive regulation of chromosome separation g48 0.0771889 2.789223e+00 1.6508242 4 0.8639754 686 0.0000001 38.618524 0.2334256 6 0.0000137 97 16
DNA-templated DNA replication maintenance of fidelity NA NA NA NA NA NA NA NA NA NA NA NA 17
GO:0031297 replication fork processing g10 0.0000000 9.662556e+00 3.0540248 17 0.0000004 686 0.0089860 7.678348 0.4318373 3 0.3744369 97 17
GO:0045005 DNA-templated DNA replication maintenance of fidelity g10 0.0000000 1.037811e+01 3.4667308 20 0.0000000 686 0.0127326 6.689853 0.4901937 3 0.4369348 97 17
positive regulation of cell cycle NA NA NA NA NA NA NA NA NA NA NA NA 18
GO:0045787 positive regulation of cell cycle g48 0.0012955 1.983376e+00 16.0955360 29 0.0651917 686 0.0000025 6.195564 2.2758994 12 0.0003512 97 18
GO:0090068 positive regulation of cell cycle process g48 0.0001900 2.402710e+00 12.2986404 26 0.0130808 686 0.0000001 8.323229 1.7390206 12 0.0000247 97 18
regulation of nuclear division NA NA NA NA NA NA NA NA NA NA NA NA 19
GO:0007088 regulation of mitotic nuclear division g48 0.0001135 3.134040e+00 6.8509205 18 0.0085352 686 0.0000000 14.464147 0.9687162 11 0.0000008 97 19
GO:0051783 regulation of nuclear division g48 0.0000667 3.165689e+00 7.1810853 19 0.0055230 686 0.0000000 13.696144 1.0154013 11 0.0000011 97 19
cell cycle DNA replication NA NA NA NA NA NA NA NA NA NA NA NA 20
GO:0033260 nuclear DNA replication g10,g48 0.0000000 1.219872e+01 2.2286127 14 0.0000013 686 0.0000000 38.769959 0.3151245 8 0.0000002 97 20
GO:0044786 cell cycle DNA replication g10,g48 0.0000000 1.132589e+01 2.3111539 14 0.0000023 686 0.0000000 36.826966 0.3267958 8 0.0000002 97 20
regulation of DNA biosynthetic process NA NA NA NA NA NA NA NA NA NA NA NA 21
GO:2000278 regulation of DNA biosynthetic process g10 0.0000014 4.942777e+00 4.6223078 17 0.0002540 686 0.0273620 4.914291 0.6535916 3 0.7036507 97 21
GO:2000573 positive regulation of DNA biosynthetic process g10 0.0000000 8.500373e+00 2.8889424 15 0.0000083 686 0.3375069 2.506127 0.4084948 1 1.0000000 97 21
telomere organization NA NA NA NA NA NA NA NA NA NA NA NA 22
GO:0000723 telomere maintenance g10 0.0000000 5.205840e+00 8.5017447 32 0.0000000 686 0.0069456 4.500887 1.2021417 5 0.3080557 97 22
GO:0032200 telomere organization g10 0.0000000 5.429131e+00 9.3271568 36 0.0000000 686 0.0020026 4.995584 1.3188545 6 0.1134279 97 22
microtubule cytoskeleton organization involved in mitosis NA NA NA NA NA NA NA NA NA NA NA NA 23
GO:0007052 mitotic spindle organization g48 0.0000812 3.234388e+00 6.6858380 18 0.0064746 686 0.0000041 10.024319 0.9453736 8 0.0005719 97 23
GO:1902850 microtubule cytoskeleton organization involved in mitosis g48 0.0001018 2.943723e+00 8.0064974 20 0.0077889 686 0.0000002 10.737218 1.1321141 10 0.0000282 97 23
mitotic DNA integrity checkpoint signaling NA NA NA NA NA NA NA NA NA NA NA NA 24
GO:0044773 mitotic DNA damage checkpoint signaling g10 0.0000006 6.885870e+00 3.0540248 14 0.0001168 686 0.0008572 10.662757 0.4318373 4 0.0578134 97 24
GO:0044774 mitotic DNA integrity checkpoint signaling g10 0.0000003 6.795827e+00 3.3016484 15 0.0000600 686 0.0000930 12.700311 0.4668512 5 0.0090100 97 24
other NA NA NA NA NA NA NA NA NA NA NA NA 25
GO:0000076 DNA replication checkpoint signaling g10 0.0000003 1.408469e+01 1.4857418 10 0.0000702 686 0.1906601 5.022672 0.2100830 1 1.0000000 97 25
GO:0006270 DNA replication initiation g10 0.0000000 1.131055e+01 2.1460715 13 0.0000075 686 0.0000106 21.203416 0.3034533 5 0.0013700 97 25
GO:0006271 DNA strand elongation involved in DNA replication g10 0.0000000 7.362481e+01 1.2381182 13 0.0000000 686 0.0006334 21.813830 0.1750692 3 0.0457869 97 25
GO:0006298 mismatch repair g10 0.0000008 8.466988e+00 2.3111539 12 0.0001501 686 0.0418641 6.629960 0.3267958 2 0.8708273 97 25
GO:0006301 DNA damage tolerance g10 0.0000042 1.124963e+01 1.4857418 9 0.0005912 686 0.0182669 10.786842 0.2100830 2 0.5787015 97 25
GO:0009411 response to UV g10 0.0000038 3.575947e+00 7.5937914 22 0.0005458 686 0.0006875 6.231536 1.0737577 6 0.0489284 97 25
GO:0022616 DNA strand elongation g10 0.0000000 1.818507e+01 2.1460715 16 0.0000000 686 0.0032981 11.365865 0.3034533 3 0.1733040 97 25
GO:0042770 signal transduction in response to DNA damage g10 0.0000019 3.213249e+00 10.1525689 27 0.0003039 686 0.0030687 4.562976 1.4355673 6 0.1618977 97 25
GO:0046112 nucleobase biosynthetic process g10 0.0000022 1.265750e+01 1.4032006 9 0.0003622 686 0.1810827 5.337240 0.1984117 1 1.0000000 97 25
GO:0051054 positive regulation of DNA metabolic process g10 0.0000000 3.526730e+00 14.5272530 41 0.0000002 686 0.0043940 3.702498 2.0541451 7 0.2169462 97 25
GO:0071897 DNA biosynthetic process g10 0.0000000 6.756030e+00 8.0890386 36 0.0000000 686 0.0001381 6.942735 1.1437853 7 0.0124572 97 25
GO:0080135 regulation of cellular response to stress g10 0.0000074 2.114673e+00 27.2385994 51 0.0009779 686 0.0146153 2.514762 3.8515221 9 0.4816800 97 25
GO:0090592 DNA synthesis involved in DNA replication g10 0.0000018 1.798230e+01 1.0730357 8 0.0003039 686 0.0004049 26.182979 0.1517266 3 0.0306262 97 25
GO:1901293 nucleoside phosphate biosynthetic process g10 0.0000063 2.470357e+00 17.2511130 37 0.0008517 686 0.0351361 2.601960 2.4392973 6 0.7700521 97 25
GO:1901976 regulation of cell cycle checkpoint g10 0.0000009 7.345097e+00 2.7238599 13 0.0001648 686 0.0000358 15.888975 0.3851522 5 0.0039660 97 25
GO:1903046 meiotic cell cycle process g10 0.0000037 4.069701e+00 5.9429672 19 0.0005458 686 0.0000188 9.750940 0.8403321 7 0.0022174 97 25
GO:0000727 double-strand break repair via break-induced replication g10,g48 0.0000002 7.859794e+01 0.6603297 7 0.0000440 686 0.0000012 88.279570 0.0933702 4 0.0001792 97 25
GO:0006260 DNA replication g10,g48 0.0000000 7.060880e+00 15.2701239 68 0.0000000 686 0.0000000 10.979004 2.1591866 18 0.0000000 97 25
GO:0006261 DNA-templated DNA replication g10,g48 0.0000000 9.273735e+00 8.8319095 47 0.0000000 686 0.0000004 9.618438 1.2488269 10 0.0000646 97 25
GO:0006275 regulation of DNA replication g10,g48 0.0000017 4.133224e+00 6.1905908 20 0.0002931 686 0.0000000 14.410256 0.8753459 10 0.0000027 97 25
GO:0006281 DNA repair g10,g48 0.0000000 3.810011e+00 30.2926242 87 0.0000000 686 0.0000000 5.505968 4.2833594 19 0.0000066 97 25
GO:0006302 double-strand break repair g10,g48 0.0000000 3.487977e+00 14.2796294 40 0.0000004 686 0.0000001 7.790327 2.0191313 13 0.0000165 97 25
GO:0006310 DNA recombination g10,g48 0.0000000 3.774006e+00 14.8574179 44 0.0000000 686 0.0000001 7.457300 2.1008302 13 0.0000256 97 25
GO:0033044 regulation of chromosome organization g10,g48 0.0000000 3.595991e+00 12.8764288 37 0.0000008 686 0.0000000 8.734849 1.8207195 13 0.0000052 97 25
GO:0051052 regulation of DNA metabolic process g10,g48 0.0000000 2.891625e+00 24.2671159 58 0.0000001 686 0.0000002 5.638867 3.4313560 16 0.0000395 97 25
GO:0051276 chromosome organization g10,g48 0.0000000 3.784540e+00 27.0735170 78 0.0000000 686 0.0000000 8.554434 3.8281795 24 0.0000000 97 25
GO:0051301 cell division g10,g48 0.0000002 2.254091e+00 30.6227891 60 0.0000510 686 0.0000000 7.453634 4.3300445 24 0.0000000 97 25
GO:0051321 meiotic cell cycle g10,g48 0.0000019 3.213249e+00 10.1525689 27 0.0003039 686 0.0000015 8.240260 1.4355673 10 0.0002203 97 25
GO:1902969 mitotic DNA replication g10,g48 0.0000000 4.523442e+01 1.2381182 12 0.0000000 686 0.0000000 60.109890 0.1750692 6 0.0000022 97 25
GO:1903047 mitotic cell cycle process g10,g48 0.0000000 3.116521e+00 37.3911683 92 0.0000000 686 0.0000000 9.112955 5.2870894 32 0.0000000 97 25
GO:0000910 cytokinesis g48 0.3664189 1.172532e+00 8.6668271 10 1.0000000 686 0.0000033 8.648438 1.2254843 9 0.0004636 97 25
GO:0051984 positive regulation of chromosome segregation g48 0.0460622 3.434243e+00 1.4032006 4 0.7878137 686 0.0000011 37.146739 0.1984117 5 0.0001664 97 25
GO:0090231 regulation of spindle checkpoint g48 0.0000687 8.167337e+00 1.5682830 8 0.0056208 686 0.0000020 31.832298 0.2217543 5 0.0002923 97 25
GO:2001251 negative regulation of chromosome organization g48 0.0000663 3.617910e+00 5.4477199 16 0.0055225 686 0.0000001 14.635766 0.7703044 9 0.0000114 97 25

Actually Visualize It!

bp_network <- graph_to_visnetwork(bp_graph, bp_assign, bp_comm_labels)
vis_visnetwork(bp_network)

annotation_table <- annotation_gene_table(
  bp_combined,
  graph::nodes(bp_graph),
  use_db = org.Hs.eg.db
)

We will show the table that is generated here for the first 3 GO terms.

This one is not run, below you find the table.

kable_annotation_table(annotation_table, header = 4)
csv_annotation_table(annotation_table, out_file = "bp_annotations.csv")

GO:0000070 - mitotic sister chromatid segregation

ENTREZID SYMBOL GENENAME significant
6990 DYNLT3 dynein light chain Tctex-type 3 g10
3832 KIF11 kinesin family member 11 g10
10615 SPAG5 sperm associated antigen 5 g10
701 BUB1B BUB1 mitotic checkpoint serine/threonine kinase B g10
7283 TUBG1 tubulin gamma 1 g10
81620 CDT1 chromatin licensing and DNA replication factor 1 g10
5901 RAN RAN, member RAS oncogene family g10
4085 MAD2L1 mitotic arrest deficient 2 like 1 g10
57405 SPC25 SPC25 component of NDC80 kinetochore complex g10
7517 XRCC3 X-ray repair cross complementing 3 g10
9735 KNTC1 kinetochore associated 1 g10
26065 LSM14A LSM14A mRNA processing body assembly factor g10
10403 NDC80 NDC80 kinetochore complex component g10
10726 NUDC nuclear distribution C, dynein complex regulator g10
3835 KIF22 kinesin family member 22 g10
2801 GOLGA2 golgin A2 g10
23636 NUP62 nucleoporin 62 g10
8243 SMC1A structural maintenance of chromosomes 1A g10
23212 RRS1 regulator of ribosome synthesis 1 g10
23310 NCAPD3 non-SMC condensin II complex subunit D3 g10
126353 MISP mitotic spindle positioning g10
11130 ZWINT ZW10 interacting kinetochore protein g10,g48
9319 TRIP13 thyroid hormone receptor interactor 13 g10,g48
332 BIRC5 baculoviral IAP repeat containing 5 g10,g48
983 CDK1 cyclin dependent kinase 1 g10,g48
3833 KIFC1 kinesin family member C1 g10,g48
9212 AURKB aurora kinase B g10,g48
11065 UBE2C ubiquitin conjugating enzyme E2 C g10,g48
9700 ESPL1 extra spindle pole bodies like 1, separase g10,g48
1843 DUSP1 dual specificity phosphatase 1 g10,g48
991 CDC20 cell division cycle 20 g48
22974 TPX2 TPX2 microtubule nucleation factor g48
891 CCNB1 cyclin B1 g48
9928 KIF14 kinesin family member 14 g48
11004 KIF2C kinesin family member 2C g48
5347 PLK1 polo like kinase 1 g48

GO:0000070 - mitotic sister chromatid segregation

ENTREZID SYMBOL GENENAME significant
6990 DYNLT3 dynein light chain Tctex-type 3 g10
3832 KIF11 kinesin family member 11 g10
10615 SPAG5 sperm associated antigen 5 g10
701 BUB1B BUB1 mitotic checkpoint serine/threonine kinase B g10
7283 TUBG1 tubulin gamma 1 g10
81620 CDT1 chromatin licensing and DNA replication factor 1 g10
5901 RAN RAN, member RAS oncogene family g10
4085 MAD2L1 mitotic arrest deficient 2 like 1 g10
57405 SPC25 SPC25 component of NDC80 kinetochore complex g10
7517 XRCC3 X-ray repair cross complementing 3 g10
9735 KNTC1 kinetochore associated 1 g10
26065 LSM14A LSM14A mRNA processing body assembly factor g10
10403 NDC80 NDC80 kinetochore complex component g10
10726 NUDC nuclear distribution C, dynein complex regulator g10
3835 KIF22 kinesin family member 22 g10
2801 GOLGA2 golgin A2 g10
23636 NUP62 nucleoporin 62 g10
8243 SMC1A structural maintenance of chromosomes 1A g10
23212 RRS1 regulator of ribosome synthesis 1 g10
23310 NCAPD3 non-SMC condensin II complex subunit D3 g10
126353 MISP mitotic spindle positioning g10
11130 ZWINT ZW10 interacting kinetochore protein g10,g48
9319 TRIP13 thyroid hormone receptor interactor 13 g10,g48
332 BIRC5 baculoviral IAP repeat containing 5 g10,g48
983 CDK1 cyclin dependent kinase 1 g10,g48
3833 KIFC1 kinesin family member C1 g10,g48
9212 AURKB aurora kinase B g10,g48
11065 UBE2C ubiquitin conjugating enzyme E2 C g10,g48
9700 ESPL1 extra spindle pole bodies like 1, separase g10,g48
1843 DUSP1 dual specificity phosphatase 1 g10,g48
991 CDC20 cell division cycle 20 g48
22974 TPX2 TPX2 microtubule nucleation factor g48
891 CCNB1 cyclin B1 g48
9928 KIF14 kinesin family member 14 g48
11004 KIF2C kinesin family member 2C g48
5347 PLK1 polo like kinase 1 g48

GO:0000070 - mitotic sister chromatid segregation

ENTREZID SYMBOL GENENAME significant
6990 DYNLT3 dynein light chain Tctex-type 3 g10
3832 KIF11 kinesin family member 11 g10
10615 SPAG5 sperm associated antigen 5 g10
701 BUB1B BUB1 mitotic checkpoint serine/threonine kinase B g10
7283 TUBG1 tubulin gamma 1 g10
81620 CDT1 chromatin licensing and DNA replication factor 1 g10
5901 RAN RAN, member RAS oncogene family g10
4085 MAD2L1 mitotic arrest deficient 2 like 1 g10
57405 SPC25 SPC25 component of NDC80 kinetochore complex g10
7517 XRCC3 X-ray repair cross complementing 3 g10
9735 KNTC1 kinetochore associated 1 g10
26065 LSM14A LSM14A mRNA processing body assembly factor g10
10403 NDC80 NDC80 kinetochore complex component g10
10726 NUDC nuclear distribution C, dynein complex regulator g10
3835 KIF22 kinesin family member 22 g10
2801 GOLGA2 golgin A2 g10
23636 NUP62 nucleoporin 62 g10
8243 SMC1A structural maintenance of chromosomes 1A g10
23212 RRS1 regulator of ribosome synthesis 1 g10
23310 NCAPD3 non-SMC condensin II complex subunit D3 g10
126353 MISP mitotic spindle positioning g10
11130 ZWINT ZW10 interacting kinetochore protein g10,g48
9319 TRIP13 thyroid hormone receptor interactor 13 g10,g48
332 BIRC5 baculoviral IAP repeat containing 5 g10,g48
983 CDK1 cyclin dependent kinase 1 g10,g48
3833 KIFC1 kinesin family member C1 g10,g48
9212 AURKB aurora kinase B g10,g48
11065 UBE2C ubiquitin conjugating enzyme E2 C g10,g48
9700 ESPL1 extra spindle pole bodies like 1, separase g10,g48
1843 DUSP1 dual specificity phosphatase 1 g10,g48
991 CDC20 cell division cycle 20 g48
22974 TPX2 TPX2 microtubule nucleation factor g48
891 CCNB1 cyclin B1 g48
9928 KIF14 kinesin family member 14 g48
11004 KIF2C kinesin family member 2C g48
5347 PLK1 polo like kinase 1 g48