This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is there any tutorial to access Gene Ontology (GO) terms in R?

Hi, I was wondering if we can access GO terms in R using QuickGO or other tools. I have a huge list of UniprotKB for which I need to create a data set of GO terms and further visualize it. QuickGO seems a good way, however, I could not find a tutorial for a newbie like me. Kindly let me know if there are any. Thank you.

gene ontology r

Do you want to just access the GO terms and genes, or did you want to run GSEA or enrichment analysis on the terms?

I am only looking to access the list of GO terms for a list of UniprotKBs now. No enrichment analysis. However, I am planning to have a frequency of certain genes associated to a specific GO terms. Thank you.

I prefer the biomaRt package for this. Here's a random example of grabbing the GO terms associated with a few human genes.

library("biomaRt")

ensembl <- useEnsembl(biomart="genes", dataset="hsapiens_gene_ensembl")

go_terms <- getBM(
  mart=ensembl, attributes=c("hgnc_symbol", "uniprot_gn_id", "uniprot_gn_symbol", "go_id", "namespace_1003", "name_1006"),
  filters="hgnc_symbol", values=c("CD3D", "CD4", "CD8A"))

> head(go_terms)
  hgnc_symbol uniprot_gn_id uniprot_gn_symbol      go_id     namespace_1003
1        CD3D        P04234              CD3D GO:0016020 cellular_component
2        CD3D        P04234              CD3D GO:0007166 biological_process
3        CD3D        P04234              CD3D GO:0004888 molecular_function
4        CD3D        P04234              CD3D GO:0042101 cellular_component
5        CD3D        P04234              CD3D GO:0005737 cellular_component
6        CD3D        P04234              CD3D GO:0016021 cellular_component
                                  name_1006
1                                  membrane
2   cell surface receptor signaling pathway
3 transmembrane signaling receptor activity
4                   T cell receptor complex
5                                 cytoplasm
6            integral component of membrane

See their documentation for more info.

Thank you for the reply. Would it work if I have a random list of UniprotKB IDs from different organisms? Thank you.

You would need to search separately for each species.

I am sorry for the late reply. I have a long list of UniprotKBs coming from multiple species. I just downloaded the CSV file from Uniprot website. Thank you.

0 answers

No answers yet.

Log in to answer this question.