categoryCompare2: visNetwork

categoryCompare2: Alternative Visualization

Authored by: Robert M Flight <[email protected]> on 2026-11-30 14:37:55.087844

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     50
## G2   1   0     51
## G3   0   1     44
## G4   0   0  12799

Generate Graph

bp_graph <- generate_annotation_graph(bp_sig)
bp_graph
## A cc_graph with
## Number of Nodes = 122 
## Number of Edges = 5978 
##    g10 g48 counts
## G1   1   1     42
## G2   1   0     36
## G3   0   1     44
bp_graph <- remove_edges(bp_graph, 0.8)
## Removed 5756 edges from graph
bp_graph
## A cc_graph with
## Number of Nodes = 122 
## Number of Edges = 222 
##    g10 g48 counts
## G1   1   1     42
## G2   1   0     36
## G3   0   1     44
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.673490e+00 24.4226580 55 0.0000017 684 0.0000000 6.488324 3.4634471 18 0.0000018 97 1
GO:0010564 regulation of cell cycle process g10,g48 0.0000000 2.474008e+00 34.4400871 72 0.0000003 684 0.0000000 5.435376 4.8840474 21 0.0000023 97 1
GO:0044770 cell cycle phase transition g10,g48 0.0000000 3.312742e+00 27.0718954 71 0.0000000 684 0.0000000 8.037118 3.8391431 23 0.0000000 97 1
GO:0044772 mitotic cell cycle phase transition g10,g48 0.0000000 3.237154e+00 21.8562092 57 0.0000000 684 0.0000000 9.603636 3.0994916 22 0.0000000 97 1
GO:1901987 regulation of cell cycle phase transition g10,g48 0.0000000 3.447002e+00 21.6078431 59 0.0000000 684 0.0000000 7.428036 3.0642702 18 0.0000004 97 1
GO:1901990 regulation of mitotic cell cycle phase transition g10,g48 0.0000000 3.394915e+00 16.4749455 45 0.0000001 684 0.0000000 9.320810 2.3363592 17 0.0000001 97 1
cell cycle G2/M phase transition NA NA NA NA NA NA NA NA NA NA NA NA 2
GO:0000086 G2/M transition of mitotic cell cycle g10,g48 0.0000003 4.308782e+00 6.6230937 22 0.0000689 684 0.0000000 16.810381 0.9392399 12 0.0000001 97 2
GO:0010389 regulation of G2/M transition of mitotic cell cycle g10,g48 0.0000011 5.057208e+00 4.5533769 17 0.0002119 684 0.0000000 18.051136 0.6457274 9 0.0000027 97 2
GO:0044839 cell cycle G2/M phase transition g10,g48 0.0000006 3.960391e+00 7.3681917 23 0.0001178 684 0.0000000 14.829030 1.0449044 12 0.0000002 97 2
GO:1902749 regulation of cell cycle G2/M phase transition g10,g48 0.0000070 4.266567e+00 5.1328976 17 0.0009113 684 0.0000000 15.653516 0.7279109 9 0.0000071 97 2
GO:0010972 negative regulation of G2/M transition of mitotic cell cycle g48 0.0000184 5.620536e+00 2.9803922 12 0.0019160 684 0.0000033 17.879121 0.4226580 6 0.0004777 97 2
GO:1902750 negative regulation of cell cycle G2/M phase transition g48 0.0000340 5.186813e+00 3.1459695 12 0.0031907 684 0.0000046 16.757555 0.4461389 6 0.0006498 97 2
negative regulation of cell cycle NA NA NA NA NA NA NA NA NA NA NA NA 3
GO:0000075 cell cycle checkpoint signaling g10,g48 0.0000000 6.939144e+00 9.1067538 41 0.0000000 684 0.0000000 14.177460 1.2914549 14 0.0000000 97 3
GO:0010948 negative regulation of cell cycle process g10,g48 0.0000000 4.463612e+00 14.4052288 48 0.0000000 684 0.0000000 9.210769 2.0428468 15 0.0000005 97 3
GO:0045786 negative regulation of cell cycle g10,g48 0.0000000 3.521804e+00 18.6274510 52 0.0000000 684 0.0000000 6.929443 2.6416122 15 0.0000090 97 3
GO:1901988 negative regulation of cell cycle phase transition g10,g48 0.0000000 5.038971e+00 12.0871460 44 0.0000000 684 0.0000000 10.264878 1.7141128 14 0.0000004 97 3
chromosome segregation NA NA NA NA NA NA NA NA NA NA NA NA 4
GO:0000070 mitotic sister chromatid segregation g10,g48 0.0000000 3.816514e+00 9.9346405 30 0.0000065 684 0.0000000 14.041812 1.4088598 15 0.0000000 97 4
GO:0000819 sister chromatid segregation g10,g48 0.0000000 3.473513e+00 11.7559913 33 0.0000087 684 0.0000000 13.668000 1.6671508 17 0.0000000 97 4
GO:0007059 chromosome segregation g10,g48 0.0000026 2.513718e+00 17.9651416 39 0.0004004 684 0.0000000 9.120794 2.5476882 18 0.0000000 97 4
GO:0098813 nuclear chromosome segregation g10,g48 0.0000009 2.927125e+00 13.4117647 33 0.0001834 684 0.0000000 12.691456 1.9019608 18 0.0000000 97 4
DNA integrity checkpoint signaling NA NA NA NA NA NA NA NA NA NA NA NA 5
GO:0000077 DNA damage checkpoint signaling g10 0.0000000 5.550352e+00 5.2984749 21 0.0000053 684 0.0008869 7.466839 0.7513919 5 0.0591778 97 5
GO:0031570 DNA integrity checkpoint signaling g10 0.0000000 7.145122e+00 6.0435730 28 0.0000000 684 0.0002024 7.969165 0.8570564 6 0.0174657 97 5
organelle fission NA NA NA NA NA NA NA NA NA NA NA NA 6
GO:0000280 nuclear division g10,g48 0.0000001 2.821284e+00 18.1307190 43 0.0000147 684 0.0000000 9.700962 2.5711692 19 0.0000000 97 6
GO:0048285 organelle fission g10,g48 0.0000001 2.729829e+00 19.9520697 46 0.0000126 684 0.0000000 8.715466 2.8294602 19 0.0000000 97 6
GO:0140014 mitotic nuclear division g10,g48 0.0000004 2.951033e+00 14.1568627 35 0.0000809 684 0.0000000 11.054140 2.0076253 17 0.0000000 97 6
negative regulation of mitotic cell cycle NA NA NA NA NA NA NA NA NA NA NA NA 7
GO:0007093 mitotic cell cycle checkpoint signaling g10,g48 0.0000000 6.802960e+00 6.4575163 29 0.0000000 684 0.0000000 17.324064 0.9157589 12 0.0000000 97 7
GO:0045930 negative regulation of mitotic cell cycle g10,g48 0.0000000 4.164583e+00 10.5969499 34 0.0000002 684 0.0000000 9.795943 1.5027838 12 0.0000056 97 7
GO:1901991 negative regulation of mitotic cell cycle phase transition g10,g48 0.0000000 4.681282e+00 8.2788671 29 0.0000004 684 0.0000000 12.957754 1.1740499 12 0.0000005 97 7
chromosome localization NA NA NA NA NA NA NA NA NA NA NA NA 8
GO:0007080 mitotic metaphase chromosome alignment g48 0.0006286 4.149357e+00 3.0631808 10 0.0350693 684 0.0000002 21.090741 0.4343985 7 0.0000338 97 8
GO:0050000 chromosome localization g48 0.0009769 2.966770e+00 5.5468410 14 0.0501777 684 0.0000010 12.349648 0.7866134 8 0.0001571 97 8
GO:0051310 metaphase chromosome alignment g48 0.0002033 3.577883e+00 4.8017429 14 0.0133580 684 0.0000003 14.588764 0.6809489 8 0.0000536 97 8
positive regulation of mitotic cell cycle NA NA NA NA NA NA NA NA NA NA NA NA 9
GO:0045931 positive regulation of mitotic cell cycle g48 0.0001437 3.193553e+00 6.3747277 17 0.0101610 684 0.0000002 12.177975 0.9040184 9 0.0000420 97 9
GO:1901989 positive regulation of cell cycle phase transition g48 0.0000459 3.757485e+00 5.2984749 16 0.0040660 684 0.0000007 13.016051 0.7513919 8 0.0001125 97 9
GO:1901992 positive regulation of mitotic cell cycle phase transition g48 0.0000205 4.334253e+00 4.4705882 15 0.0020426 684 0.0000002 15.865168 0.6339869 8 0.0000323 97 9
chromosome separation NA NA NA NA NA NA NA NA NA NA NA NA 10
GO:0010965 regulation of mitotic sister chromatid separation g10,g48 0.0000069 5.257313e+00 3.6427015 14 0.0008962 684 0.0000000 27.488168 0.5165819 10 0.0000000 97 10
GO:0051784 negative regulation of nuclear division g10,g48 0.0000051 5.439321e+00 3.5599129 14 0.0006885 684 0.0000000 20.879615 0.5048414 8 0.0000058 97 10
GO:0007094 mitotic spindle assembly checkpoint signaling g48 0.0000132 5.865683e+00 2.8976035 12 0.0015417 684 0.0000000 27.092801 0.4109175 8 0.0000014 97 10
GO:0031577 spindle checkpoint signaling g48 0.0000132 5.865683e+00 2.8976035 12 0.0015417 684 0.0000000 27.092801 0.4109175 8 0.0000014 97 10
GO:0033046 negative regulation of sister chromatid segregation g48 0.0000184 5.620536e+00 2.9803922 12 0.0019160 684 0.0000000 26.121990 0.4226580 8 0.0000016 97 10
GO:0033047 regulation of mitotic sister chromatid segregation g48 0.0000204 5.043271e+00 3.4771242 13 0.0020426 684 0.0000000 25.202479 0.4931009 9 0.0000004 97 10
GO:0033048 negative regulation of mitotic sister chromatid segregation g48 0.0000184 5.620536e+00 2.9803922 12 0.0019160 684 0.0000000 26.121990 0.4226580 8 0.0000016 97 10
GO:0045839 negative regulation of mitotic nuclear division g48 0.0000204 5.043271e+00 3.4771242 13 0.0020426 684 0.0000000 21.496365 0.4931009 8 0.0000050 97 10
GO:0045841 negative regulation of mitotic metaphase/anaphase transition g48 0.0000184 5.620536e+00 2.9803922 12 0.0019160 684 0.0000000 26.121990 0.4226580 8 0.0000016 97 10
GO:0051304 chromosome separation g48 0.0001102 3.841209e+00 4.5533769 14 0.0081019 684 0.0000000 20.740741 0.6457274 10 0.0000002 97 10
GO:0051306 mitotic sister chromatid separation g48 0.0000092 5.087049e+00 3.7254902 14 0.0011344 684 0.0000000 26.699507 0.5283224 10 0.0000000 97 10
GO:0051985 negative regulation of chromosome segregation g48 0.0000251 5.395000e+00 3.0631808 12 0.0024109 684 0.0000000 25.218132 0.4343985 8 0.0000019 97 10
GO:0071173 spindle assembly checkpoint signaling g48 0.0000132 5.865683e+00 2.8976035 12 0.0015417 684 0.0000000 27.092801 0.4109175 8 0.0000014 97 10
GO:0071174 mitotic spindle checkpoint signaling g48 0.0000132 5.865683e+00 2.8976035 12 0.0015417 684 0.0000000 27.092801 0.4109175 8 0.0000014 97 10
GO:1902100 negative regulation of metaphase/anaphase transition of cell cycle g48 0.0000251 5.395000e+00 3.0631808 12 0.0024109 684 0.0000000 25.218132 0.4343985 8 0.0000019 97 10
GO:1905818 regulation of chromosome separation g48 0.0000565 4.146111e+00 4.3050109 14 0.0047205 684 0.0000000 22.230432 0.6105059 10 0.0000001 97 10
GO:1905819 negative regulation of chromosome separation g48 0.0000251 5.395000e+00 3.0631808 12 0.0024109 684 0.0000000 25.218132 0.4343985 8 0.0000019 97 10
GO:2000816 negative regulation of mitotic sister chromatid separation g48 0.0000184 5.620536e+00 2.9803922 12 0.0019160 684 0.0000000 26.121990 0.4226580 8 0.0000016 97 10
regulation of chromosome segregation NA NA NA NA NA NA NA NA NA NA NA NA 11
GO:0007091 metaphase/anaphase transition of mitotic cell cycle g48 0.0000459 3.757485e+00 5.2984749 16 0.0040660 684 0.0000000 19.577008 0.7513919 11 0.0000001 97 11
GO:0030071 regulation of mitotic metaphase/anaphase transition g48 0.0000372 3.837941e+00 5.2156863 16 0.0034642 684 0.0000000 19.955948 0.7396514 11 0.0000001 97 11
GO:0033045 regulation of sister chromatid segregation g48 0.0000486 3.551224e+00 5.8779956 17 0.0042199 684 0.0000000 19.396211 0.8335754 12 0.0000000 97 11
GO:0044784 metaphase/anaphase transition of cell cycle g48 0.0000563 3.680313e+00 5.3812636 16 0.0047205 684 0.0000000 19.212102 0.7631324 11 0.0000001 97 11
GO:0051983 regulation of chromosome segregation g48 0.0003208 2.945935e+00 6.7886710 17 0.0203524 684 0.0000000 18.158730 0.9627209 13 0.0000000 97 11
GO:1902099 regulation of metaphase/anaphase transition of cell cycle g48 0.0000459 3.757485e+00 5.2984749 16 0.0040660 684 0.0000000 19.577008 0.7513919 11 0.0000001 97 11
cell cycle DNA replication initiation NA NA NA NA NA NA NA NA NA NA NA NA 12
GO:1902292 cell cycle DNA replication initiation g10 0.0000038 1.000000e+100 0.4139434 5 0.0005581 684 0.0000154 130.260638 0.0587025 3 0.0019385 97 12
GO:1902315 nuclear cell cycle DNA replication initiation g10 0.0000038 1.000000e+100 0.4139434 5 0.0005581 684 0.0000154 130.260638 0.0587025 3 0.0019385 97 12
GO:1902975 mitotic DNA replication initiation g10 0.0000038 1.000000e+100 0.4139434 5 0.0005581 684 0.0000154 130.260638 0.0587025 3 0.0019385 97 12
recombinational repair NA NA NA NA NA NA NA NA NA NA NA NA 13
GO:0000724 double-strand break repair via homologous recombination g10,g48 0.0000000 4.224995e+00 8.2788671 27 0.0000058 684 0.0000023 9.074176 1.1740499 9 0.0003538 97 13
GO:0000725 recombinational repair g10,g48 0.0000000 4.328279e+00 8.4444444 28 0.0000023 684 0.0000027 8.876833 1.1975309 9 0.0004035 97 13
nucleoside monophosphate metabolic process NA NA NA NA NA NA NA NA NA NA NA NA 14
GO:0009123 nucleoside monophosphate metabolic process g10 0.0000015 4.926883e+00 4.6361656 17 0.0002583 684 0.0277790 4.884785 0.6574679 3 0.7148526 97 14
GO:0009124 nucleoside monophosphate biosynthetic process g10 0.0000009 6.576866e+00 3.1459695 14 0.0001834 684 0.0098309 7.413374 0.4461389 3 0.4001594 97 14
regulation of nuclear division NA NA NA NA NA NA NA NA NA NA NA NA 15
GO:0007088 regulation of mitotic nuclear division g48 0.0001179 3.123909e+00 6.8714597 18 0.0086200 684 0.0000000 14.377099 0.9744614 11 0.0000009 97 15
GO:0051783 regulation of nuclear division g48 0.0000694 3.155462e+00 7.2026144 19 0.0055083 684 0.0000000 13.613678 1.0214234 11 0.0000014 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.0238200 4.451765e+00 1.1590414 4 0.4950375 684 0.0000000 67.228022 0.1643670 6 0.0000016 97 16
GO:1905820 positive regulation of chromosome separation g48 0.0664654 2.965882e+00 1.5729847 4 0.8621211 684 0.0000001 41.345731 0.2230695 6 0.0000105 97 16
positive regulation of chromosome organization NA NA NA NA NA NA NA NA NA NA NA NA 17
GO:0032206 positive regulation of telomere maintenance g10 0.0000041 5.126376e+00 3.9738562 15 0.0005833 684 0.4336293 1.799202 0.5635439 1 1.0000000 97 17
GO:2001252 positive regulation of chromosome organization g10 0.0000015 4.390087e+00 5.6296296 19 0.0002583 684 0.0454547 3.977087 0.7983539 3 0.8929163 97 17
DNA-templated DNA replication maintenance of fidelity NA NA NA NA NA NA NA NA NA NA NA NA 18
GO:0031297 replication fork processing g10 0.0000000 9.631634e+00 3.0631808 17 0.0000004 684 0.0091314 7.632353 0.4343985 3 0.3776242 97 18
GO:0045005 DNA-templated DNA replication maintenance of fidelity g10 0.0000000 1.034502e+01 3.4771242 20 0.0000000 684 0.0129354 6.649755 0.4931009 3 0.4371461 97 18
positive regulation of cell cycle NA NA NA NA NA NA NA NA NA NA NA NA 19
GO:0045787 positive regulation of cell cycle g48 0.0012495 1.989146e+00 16.0610022 29 0.0622038 684 0.0000025 6.192372 2.2776567 12 0.0003786 97 19
GO:0090068 positive regulation of cell cycle process g48 0.0001588 2.435153e+00 12.1699346 26 0.0109936 684 0.0000001 8.397386 1.7258533 12 0.0000228 97 19
microtubule cytoskeleton organization involved in mitosis NA NA NA NA NA NA NA NA NA NA NA NA 20
GO:0007052 mitotic spindle organization g48 0.0000495 3.251948e+00 7.0370370 19 0.0042449 684 0.0000062 9.441704 0.9979424 8 0.0008674 97 20
GO:1902850 microtubule cytoskeleton organization involved in mitosis g48 0.0000734 2.931624e+00 8.4444444 21 0.0057212 684 0.0000003 10.086207 1.1975309 10 0.0000463 97 20
pyrimidine-containing compound biosynthetic process NA NA NA NA NA NA NA NA NA NA NA NA 21
GO:0006221 pyrimidine nucleotide biosynthetic process g10 0.0000018 8.830822e+00 2.0697168 11 0.0002946 684 0.0001869 16.679980 0.2935125 4 0.0162382 97 21
GO:0072528 pyrimidine-containing compound biosynthetic process g10 0.0000020 7.500000e+00 2.4836601 12 0.0003299 684 0.0003871 13.464020 0.3522150 4 0.0311254 97 21
cell cycle DNA replication NA NA NA NA NA NA NA NA NA NA NA NA 22
GO:0033260 nuclear DNA replication g10,g48 0.0000000 1.215959e+01 2.2352941 14 0.0000014 684 0.0000000 38.538143 0.3169935 8 0.0000002 97 22
GO:0044786 cell cycle DNA replication g10,g48 0.0000000 1.128955e+01 2.3180828 14 0.0000024 684 0.0000000 36.606742 0.3287340 8 0.0000003 97 22
cell division NA NA NA NA NA NA NA NA NA NA NA NA 23
GO:0000910 cytokinesis g48 0.3699842 1.168671e+00 8.6928105 10 1.0000000 684 0.0000035 8.596236 1.2327524 9 0.0004972 97 23
GO:0051301 cell division g48 0.0292249 1.646837e+00 13.5773420 21 0.5846781 684 0.0000031 6.697978 1.9254418 11 0.0004517 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.0000009 6.576866e+00 3.1459695 14 0.0001834 684 0.0009705 10.285895 0.4461389 4 0.0628136 97 24
GO:0044774 mitotic DNA integrity checkpoint signaling g10 0.0000013 6.312955e+00 3.2287582 14 0.0002424 684 0.0010718 9.990783 0.4578794 4 0.0686812 97 24
telomere organization NA NA NA NA NA NA NA NA NA NA NA NA 25
GO:0000723 telomere maintenance g10 0.0000000 5.189320e+00 8.5272331 32 0.0000000 684 0.0071162 4.473713 1.2092714 5 0.3080659 97 25
GO:0032200 telomere organization g10 0.0000000 5.411977e+00 9.3551198 36 0.0000000 684 0.0020626 4.965390 1.3266763 6 0.1145870 97 25
DNA replication NA NA NA NA NA NA NA NA NA NA NA NA 26
GO:0006260 DNA replication g10,g48 0.0000000 7.195462e+00 14.4052288 65 0.0000000 684 0.0000000 11.697663 2.0428468 18 0.0000000 97 26
GO:0006261 DNA-templated DNA replication g10,g48 0.0000000 9.245055e+00 8.8583878 47 0.0000000 684 0.0000004 9.560374 1.2562334 10 0.0000709 97 26
regulation of DNA biosynthetic process NA NA NA NA NA NA NA NA NA NA NA NA 27
GO:2000278 regulation of DNA biosynthetic process g10 0.0000011 5.057208e+00 4.5533769 17 0.0002119 684 0.0265111 4.979337 0.6457274 3 0.6904615 97 27
GO:2000573 positive regulation of DNA biosynthetic process g10 0.0000000 8.473094e+00 2.8976035 15 0.0000087 684 0.3391356 2.491115 0.4109175 1 1.0000000 97 27
other NA NA NA NA NA NA NA NA NA NA NA NA 28
GO:0000076 DNA replication checkpoint signaling g10 0.0000002 1.604705e+01 1.4074074 10 0.0000380 684 0.1820591 5.305339 0.1995885 1 1.0000000 97 28
GO:0000731 DNA synthesis involved in DNA repair g10 0.0000064 1.957829e+01 0.9106754 7 0.0008390 684 1.0000000 0.000000 0.1291455 0 1.0000000 97 28
GO:0006270 DNA replication initiation g10 0.0000000 1.127422e+01 2.1525054 13 0.0000077 684 0.0000109 21.076605 0.3052530 5 0.0014226 97 28
GO:0006271 DNA strand elongation involved in DNA replication g10 0.0000000 7.338897e+01 1.2418301 13 0.0000000 684 0.0006443 21.683511 0.1761075 3 0.0463359 97 28
GO:0006298 mismatch repair g10 0.0000008 8.439732e+00 2.3180828 12 0.0001731 684 0.0423132 6.590283 0.3287340 2 0.8721367 97 28
GO:0006301 DNA damage tolerance g10 0.0000043 1.121333e+01 1.4901961 9 0.0005931 684 0.0184709 10.722368 0.2113290 2 0.5692558 97 28
GO:0006325 chromatin organization g10 0.0000011 2.018669e+00 38.7450980 69 0.0002119 684 0.0472495 1.934197 5.4945534 10 0.9060713 97 28
GO:0009411 response to UV g10 0.0000040 3.564437e+00 7.6165577 22 0.0005729 684 0.0007090 6.193969 1.0801259 6 0.0501478 97 28
GO:0022616 DNA strand elongation g10 0.0000000 1.812695e+01 2.1525054 16 0.0000000 684 0.0033533 11.297872 0.3052530 3 0.1715612 97 28
GO:0042770 signal transduction in response to DNA damage g10 0.0000027 3.136707e+00 10.3485839 27 0.0004162 684 0.0034223 4.458029 1.4675623 6 0.1744039 97 28
GO:0046112 nucleobase biosynthetic process g10 0.0000023 1.261667e+01 1.4074074 9 0.0003629 684 0.1820591 5.305339 0.1995885 1 1.0000000 97 28
GO:0051054 positive regulation of DNA metabolic process g10 0.0000000 3.542211e+00 14.4880174 41 0.0000002 684 0.0043975 3.702315 2.0545873 7 0.2147976 97 28
GO:0071897 DNA biosynthetic process g10 0.0000000 6.872764e+00 7.7821351 35 0.0000000 684 0.0001100 7.221711 1.1036069 7 0.0103961 97 28
GO:0090592 DNA synthesis involved in DNA replication g10 0.0000019 1.792426e+01 1.0762527 8 0.0003113 684 0.0004120 26.026596 0.1526265 3 0.0319328 97 28
GO:1901293 nucleoside phosphate biosynthetic process g10 0.0000076 2.447803e+00 17.3856209 37 0.0009695 684 0.0367232 2.573045 2.4655047 6 0.7922410 97 28
GO:1901976 regulation of cell cycle checkpoint g10 0.0000020 6.654112e+00 2.8976035 13 0.0003299 684 0.0000494 14.737319 0.4109175 5 0.0054640 97 28
GO:1903046 meiotic cell cycle process g10 0.0000059 3.908052e+00 6.1263617 19 0.0007926 684 0.0000234 9.400663 0.8687969 7 0.0027803 97 28
GO:0000727 double-strand break repair via break-induced replication g10,g48 0.0000002 7.834417e+01 0.6623094 7 0.0000445 684 0.0000012 87.752688 0.0939240 4 0.0001880 97 28
GO:0006275 regulation of DNA replication g10,g48 0.0000014 4.196787e+00 6.1263617 20 0.0002509 684 0.0000000 14.549210 0.8687969 10 0.0000027 97 28
GO:0006281 DNA repair g10,g48 0.0000000 3.765826e+00 28.3137255 81 0.0000000 684 0.0000001 5.514065 4.0152505 18 0.0000131 97 28
GO:0006302 double-strand break repair g10,g48 0.0000000 3.450450e+00 14.4052288 40 0.0000005 684 0.0000001 7.693878 2.0428468 13 0.0000189 97 28
GO:0006310 DNA recombination g10,g48 0.0000000 3.777657e+00 14.1568627 42 0.0000000 684 0.0000007 7.108546 2.0076253 12 0.0001066 97 28
GO:0033044 regulation of chromosome organization g10,g48 0.0000000 3.554173e+00 12.9978214 37 0.0000010 684 0.0000000 8.620453 1.8432583 13 0.0000062 97 28
GO:0051052 regulation of DNA metabolic process g10,g48 0.0000000 2.907840e+00 24.1742919 58 0.0000001 684 0.0000002 5.646090 3.4282256 16 0.0000411 97 28
GO:0051276 chromosome organization g10,g48 0.0000000 3.757288e+00 27.2374728 78 0.0000000 684 0.0000000 8.472490 3.8626241 24 0.0000000 97 28
GO:1902969 mitotic DNA replication g10,g48 0.0000000 4.508929e+01 1.2418301 12 0.0000000 684 0.0000000 59.750916 0.1761075 6 0.0000024 97 28
GO:1903047 mitotic cell cycle process g10,g48 0.0000000 3.139428e+00 38.0827887 94 0.0000000 684 0.0000000 8.899497 5.4006294 32 0.0000000 97 28
GO:0031100 animal organ regeneration g48 0.0012191 3.732938e+00 3.3115468 10 0.0611620 684 0.0000062 15.767938 0.4696199 6 0.0008674 97 28
GO:0051984 positive regulation of chromosome segregation g48 0.0379623 3.708823e+00 1.3246187 4 0.6712894 684 0.0000008 40.286561 0.1878480 5 0.0001267 97 28
GO:0090231 regulation of spindle checkpoint g48 0.0001086 7.461538e+00 1.6557734 8 0.0080323 684 0.0000027 29.528986 0.2348100 5 0.0004035 97 28
GO:2001251 negative regulation of chromosome organization g48 0.0000834 3.535048e+00 5.5468410 16 0.0064264 684 0.0000001 14.295259 0.7866134 9 0.0000133 97 28

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