Skip to contents

Get genes and GO terms from OrgDb oject

Usage

get_GO_gene_sets_from_orgdb(
  org_db,
  ontology = "BP",
  gene_id_type = c("ENTREZID", "SYMBOL", "ENSEMBL"),
  as_table = FALSE
)

random_genes(
  org_db,
  n = 1000,
  gene_id_type = c("ENTREZID", "SYMBOL", "ENSEMBL")
)

protein_coding_genes(org_db, gene_id_type = c("ENTREZID", "SYMBOL", "ENSEMBL"))

Arguments

org_db

An OrgDb object.

ontology

"BP", "CC" or "MF".

gene_id_type

Which gene ID type to use?

as_table

Whether to return a list or a two-column data frame?

n

Number of random genes.

Examples

require(org.Hs.eg.db)
#> Loading required package: org.Hs.eg.db
#> Loading required package: AnnotationDbi
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> 
#> Attaching package: ‘BiocGenerics’
#> The following objects are masked from ‘package:stats’:
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from ‘package:base’:
#> 
#>     Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
#>     as.data.frame, basename, cbind, colnames, dirname, do.call,
#>     duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
#>     lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
#>     pmin.int, rank, rbind, rownames, sapply, saveRDS, setdiff, table,
#>     tapply, union, unique, unsplit, which.max, which.min
#> Loading required package: Biobase
#> Welcome to Bioconductor
#> 
#>     Vignettes contain introductory material; view with
#>     'browseVignettes()'. To cite Bioconductor, see
#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
#> Loading required package: IRanges
#> Loading required package: S4Vectors
#> 
#> Attaching package: ‘S4Vectors’
#> The following object is masked from ‘package:utils’:
#> 
#>     findMatches
#> The following objects are masked from ‘package:base’:
#> 
#>     I, expand.grid, unname
gs = get_GO_gene_sets_from_orgdb(org.Hs.eg.db)
#> 'select()' returned 1:many mapping between keys and columns
gs[1:2]
#> $`GO:0000002`
#>  [1] "142"    "291"    "1763"   "1890"   "2021"   "3980"   "4205"   "4358"  
#>  [9] "4976"   "5428"   "6240"   "6742"   "7156"   "7157"   "9093"   "9361"  
#> [17] "10000"  "11232"  "50484"  "55186"  "56652"  "64863"  "80119"  "83667" 
#> [25] "84275"  "84461"  "92667"  "131474" "201973" "219736"
#> 
#> $`GO:0000012`
#>  [1] "142"       "1161"      "2074"      "3981"      "7014"      "7141"     
#>  [7] "7374"      "7515"      "23411"     "54840"     "55247"     "55775"    
#> [13] "200558"    "100133315"
#> 
random_genes(org.Hs.eg.db) |> head()
#> 'select()' returned 1:many mapping between keys and columns
#> [1] "79656"  "80063"  "493861" "1404"   "8407"   "3266"  
protein_coding_genes(org.Hs.eg.db) |> head()
#> 'select()' returned 1:many mapping between keys and columns
#> [1] "1"  "2"  "9"  "10" "12" "13"