| Title: | Random GO Database |
|---|---|
| Description: | The Gene Ontology (GO) Consortium <https://geneontology.org/> organizes genes into hierarchical categories based on biological process (BP), molecular function (MF) and cellular component (CC, i.e., subcellular localization). Tools such as 'GoMiner' (see Zeeberg, B.R., Feng, W., Wang, G. et al. (2003) <doi:10.1186/gb-2003-4-4-r28>) can leverage GO to perform ontological analysis of microarray and proteomics studies, typically generating a list of significant functional categories. The significance is traditionally determined by randomizing the input gene list to computing the false discovery rate (FDR) of the enrichment p-value for each category. We explore here the novel alternative of randomizing the GO database rather than the gene list. |
| Authors: | Barry Zeeberg [aut, cre] |
| Maintainer: | Barry Zeeberg <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.1 |
| Built: | 2026-05-10 08:27:25 UTC |
| Source: | https://github.com/cran/randomGODB |
add the leaf category name to the list of ancestor categories
addName2List(GOBPANCESTOR)addName2List(GOBPANCESTOR)
GOBPANCESTOR |
GO.db data set |
returns an augmented list of ancestor categories
BP_ANCESTOR<-addName2List(as.list(GO.db::GOBPANCESTOR))BP_ANCESTOR<-addName2List(as.list(GO.db::GOBPANCESTOR))
compute distribution of GO category sizes, and fraction of a leaf's ancestors containing a bait gene
characterizeDB( GOGOA3, ontology = "biological_process", ngene = 2, GOBPCHILDREN, GOBPANCESTOR, hitters = "all", verbose = TRUE )characterizeDB( GOGOA3, ontology = "biological_process", ngene = 2, GOBPCHILDREN, GOBPANCESTOR, hitters = "all", verbose = TRUE )
GOGOA3 |
return value of minimalistGODB::buildGODatabase() |
ontology |
character c("biological_process","molecular_function","cellular_component") |
ngene |
integer number of genes to examine within range of 'hitters' |
GOBPCHILDREN |
GO.db data set |
GOBPANCESTOR |
GO.db data set |
hitters |
character c("big","mid","lo","all") designate which portion of gene table to look at |
verbose |
BOOLEAN if TRUE print out some information |
returns the sorted number of GO category sizes, and also has side effect of printing out some information
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) ontology<-"biological_process" # t<-characterizeDB(GOGOA3,ontology,ngene=3,GO.db::GOBPCHILDREN,GO.db::GOBPANCESTOR,hitters="all") if (requireNamespace("GO.db", quietly = TRUE)) { ch<-GO.db::GOBPCHILDREN } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } if (requireNamespace("GO.db", quietly = TRUE)) { GO.db::GOBPANCESTOR } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } t<-characterizeDB(GOGOA3,ontology,ngene=3,ch,an,hitters="all") ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) ontology<-"biological_process" # t<-characterizeDB(GOGOA3,ontology,ngene=3,GO.db::GOBPCHILDREN,GO.db::GOBPANCESTOR,hitters="all") if (requireNamespace("GO.db", quietly = TRUE)) { ch<-GO.db::GOBPCHILDREN } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } if (requireNamespace("GO.db", quietly = TRUE)) { GO.db::GOBPANCESTOR } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } t<-characterizeDB(GOGOA3,ontology,ngene=3,ch,an,hitters="all") ## End(Not run)
compare pairs of GO_HGNC in 2 databases
compare2DB(GOGOA3, GOGOA3R, verbose = TRUE)compare2DB(GOGOA3, GOGOA3R, verbose = TRUE)
GOGOA3 |
return value of minimalistGODB::buildGODatabase() |
GOGOA3R |
a supposedly randomized version of GOGOA3 |
verbose |
Boolean if TRUE print out some information |
returns no values, but has side effect of printing information
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) GOGOA3R<-randomGODB(GOGOA3) compare2DB(GOGOA3,GOGOA3R) ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) GOGOA3R<-randomGODB(GOGOA3) compare2DB(GOGOA3,GOGOA3R) ## End(Not run)
display some gene and category stats
DBstats(DB, title = NULL, ontology = "biological_process", verbose = TRUE)DBstats(DB, title = NULL, ontology = "biological_process", verbose = TRUE)
DB |
GOGOA3 or a randomized version of it |
title |
character if not null, title for output |
ontology |
character c("biological_process","molecular_function","cellular_component") |
verbose |
Boolean if TRUE print out some information |
returns no values, but prints out some stats
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) DBstats(GOGOA3,ontology="biological_process") ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) DBstats(GOGOA3,ontology="biological_process") ## End(Not run)
analysis of fraction of ancestor categories to which a leaf gene maps
fractAncest( genes, GOGOA3, ontology = "biological_process", GOBPCHILDREN, GOBPANCESTOR, verbose = TRUE )fractAncest( genes, GOGOA3, ontology = "biological_process", GOBPCHILDREN, GOBPANCESTOR, verbose = TRUE )
genes |
character vector list of gene names |
GOGOA3 |
return value of minimalistGODB::buildGODatabase() |
ontology |
character c("biological_process","molecular_function","cellular_component") |
GOBPCHILDREN |
GO.db data set |
GOBPANCESTOR |
GO.db data set |
verbose |
Boolean if TRUE print out some information |
returns no values, but has side effect of printing out some results
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) ontology<-"biological_process" genes<-c("CDC45","CELF2") #fractAncest(genes,GOGOA3,ontology,GO.db::GOBPCHILDREN,GO.db::GOBPANCESTOR) if (requireNamespace("GO.db", quietly = TRUE)) { ch<-GO.db::GOBPCHILDREN } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } if (requireNamespace("GO.db", quietly = TRUE)) { an<-GO.db::GOBPANCESTOR } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } fractAncest(genes,GOGOA3,ontology,ch,an) ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) ontology<-"biological_process" genes<-c("CDC45","CELF2") #fractAncest(genes,GOGOA3,ontology,GO.db::GOBPCHILDREN,GO.db::GOBPANCESTOR) if (requireNamespace("GO.db", quietly = TRUE)) { ch<-GO.db::GOBPCHILDREN } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } if (requireNamespace("GO.db", quietly = TRUE)) { an<-GO.db::GOBPANCESTOR } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } fractAncest(genes,GOGOA3,ontology,ch,an) ## End(Not run)
compute number of GOGOA3 mappings for genes in geneList
geneListDistHitters(geneList, GOGOA3, ontologies = NULL, verbose = TRUE)geneListDistHitters(geneList, GOGOA3, ontologies = NULL, verbose = TRUE)
geneList |
character vector listg of gene names |
GOGOA3 |
return value of minimalistGODB::buildGODatabase() |
ontologies |
character c("biological_process","molecular_function","cellular_component") |
verbose |
Boolean if TRUE print out some information |
returns no value, but has side effect of printing information
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) geneList<-GOGOA3$ontologies[["biological_process"]][1:10,"HGNC"] geneListDistHitters(geneList,GOGOA3) ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) geneList<-GOGOA3$ontologies[["biological_process"]][1:10,"HGNC"] geneListDistHitters(geneList,GOGOA3) ## End(Not run)
pick genes of a size range and submit to fractAncest()
hitters( GOGOA3, ontology, hitters, ngene, GOBPCHILDREN, GOBPANCESTOR, verbose = TRUE )hitters( GOGOA3, ontology, hitters, ngene, GOBPCHILDREN, GOBPANCESTOR, verbose = TRUE )
GOGOA3 |
return value of minimalistGODB::buildGODatabase() |
ontology |
character c("biological_process","molecular_function","cellular_component") |
hitters |
character c("big","mid","lo","all") designate which portion of gene table to look at |
ngene |
integer number of genes to examine within range of 'hitters' |
GOBPCHILDREN |
GO.db data set |
GOBPANCESTOR |
GO.db data set |
verbose |
Boolean if TRUE print out some information |
returns no values, but has side effect of printing out some information
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) # hitters(GOGOA3,ontology="biological_process",hitters="all", # 5,GO.db::GOBPCHILDREN,GO.db::GOBPANCESTOR) if (requireNamespace("GO.db", quietly = TRUE)) { ch<-GO.db::GOBPCHILDREN } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } if (requireNamespace("GO.db", quietly = TRUE)) { an<-GO.db::GOBPANCESTOR } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } hitters(GOGOA3,ontology="biological_process",hitters="all", 5,Gch,an) ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) # hitters(GOGOA3,ontology="biological_process",hitters="all", # 5,GO.db::GOBPCHILDREN,GO.db::GOBPANCESTOR) if (requireNamespace("GO.db", quietly = TRUE)) { ch<-GO.db::GOBPCHILDREN } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } if (requireNamespace("GO.db", quietly = TRUE)) { an<-GO.db::GOBPANCESTOR } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } hitters(GOGOA3,ontology="biological_process",hitters="all", 5,Gch,an) ## End(Not run)
retrieve leaf nodes
leafList(GOBPCHILDREN)leafList(GOBPCHILDREN)
GOBPCHILDREN |
GO.db dataset |
returns a list of leaf nodes
# BP_LEAF<-leafList(GO.db::GOBPCHILDREN if (requireNamespace("GO.db", quietly = TRUE)) { ch<-GO.db::GOBPCHILDREN } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } BP_LEAF<-leafList(ch)# BP_LEAF<-leafList(GO.db::GOBPCHILDREN if (requireNamespace("GO.db", quietly = TRUE)) { ch<-GO.db::GOBPCHILDREN } else { stop("Install 'GO.db' from BioConductor to use this function.", call. = FALSE) } BP_LEAF<-leafList(ch)
characterize number of mappings per gene
mapPerGene(GOGOA3, ontology, verbose = TRUE)mapPerGene(GOGOA3, ontology, verbose = TRUE)
GOGOA3 |
return value of minimalistGODB::buildGODatabase() |
ontology |
character c("biological_process","molecular_function","cellular_component") |
verbose |
Boolean if TRUE print out some information |
returns no values, but has side effect of printing out information
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) mapPerGene(GOGOA3,ontology="biological_process") ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) mapPerGene(GOGOA3,ontology="biological_process") ## End(Not run)
adds secondary components to database like GOGOA3$genes etc
postProcess(l)postProcess(l)
l |
return value of randomGODB2() |
returns a database like GOGOA3
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) pp<-postProcess(randomGODB(GOGOA3)) ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) pp<-postProcess(randomGODB(GOGOA3)) ## End(Not run)
driver to construct a randomized version of GOGOA3
randomGODB(GOGOA3, verbose = TRUE)randomGODB(GOGOA3, verbose = TRUE)
GOGOA3 |
return value of minimalistGODB::buildGODatabase() |
verbose |
Boolean if TRUE print out some information |
The results of characterizeDB() show that a gene mapping to a leaf node maps to only around 10% of the ancestors. So I do not need to use a more sophisticated method to generate a random database. That is, I do not need to maintain a consistency between leaf and ancestor mappings. Therefore a very simple randomization
simply scrambling the genes in an ontology of GOGOA3 will suffice.
description
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) GOGOA3R<-randomGODB(GOGOA3) ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) GOGOA3R<-randomGODB(GOGOA3) ## End(Not run)
characterize size of GO categories
sizeGOcats(GOGOA3, ontology, verbose = TRUE)sizeGOcats(GOGOA3, ontology, verbose = TRUE)
GOGOA3 |
return value of minimalistGODB::buildGODatabase() |
ontology |
character c("biological_process","molecular_function","cellular_component") |
verbose |
Boolean if TRUE print out some information |
returns no values, but has side effect of printing out information
## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) sizeGOcats(GOGOA3,ontology="biological_process") ## End(Not run)## Not run: # GOGOA3.RData is too large to include in the R package # so I need to load it from a file that is not in the package. # Since this is in a file in my own file system, I could not # include this as a regular example in the package. # This example is given in full detail in the package vignette. # You can generate GOGOA3.RData using the package 'minimalistGODB' # or you can retrieve it from https://github.com/barryzee/GO/databases dir<-"/Users/barryzeeberg/personal/GODB_RDATA/goa_human/" load(sprintf("%s/%s",dir,"GOGOA3_goa_human.RData")) sizeGOcats(GOGOA3,ontology="biological_process") ## End(Not run)