Retrieve the GO terms associated to a gene

get_gene_go_terms(
  gene,
  raw = getOption("gemma.raw", FALSE),
  memoised = getOption("gemma.memoised", FALSE),
  file = getOption("gemma.file", NA_character_),
  overwrite = getOption("gemma.overwrite", FALSE)
)

Arguments

gene

An ensembl gene identifier which typically starts with ensg or an ncbi gene identifier or an official gene symbol approved by hgnc

raw

TRUE to receive results as-is from Gemma, or FALSE to enable parsing. Raw results usually contain additional fields and flags that are omitted in the parsed results.

memoised

Whether or not to save to cache for future calls with the same inputs and use the result saved in cache if a result is already saved. Doing options(gemma.memoised = TRUE) will ensure that the cache is always used. Use forget_gemma_memoised to clear the cache.

file

The name of a file to save the results to, or NULL to not write results to a file. If raw == TRUE, the output will be the raw endpoint from the API, likely a JSON or a gzip file. Otherwise, it will be a RDS file.

overwrite

Whether or not to overwrite if a file exists at the specified filename.

Value

A data table with information about the GO terms assigned to the queried gene. A list if raw = TRUE. A 404 error if the given identifier does not map to any object.

The fields of the output data.table are:

  • term.name: Name of the term

  • term.ID: ID of the term

  • term.URI: URI of the term

Examples

get_gene_go_terms(3091)
#>                                                                term.name
#>                                                                   <char>
#>   1:                                       sequence-specific DNA binding
#>   2:                                                body fluid secretion
#>   3: positive regulation of G protein-coupled receptor signaling pathway
#>   4:                    positive regulation of epithelial cell migration
#>   5:                                                 glucose homeostasis
#>  ---                                                                    
#> 618:                                                      tube formation
#> 619:                        cellular response to monosaccharide stimulus
#> 620:                          cellular response to carbohydrate stimulus
#> 621:                              regulation of T cell apoptotic process
#> 622:                     negative regulation of T cell apoptotic process
#>         term.ID                                  term.URI
#>          <char>                                    <char>
#>   1: GO:0043565 http://purl.obolibrary.org/obo/GO_0043565
#>   2: GO:0007589 http://purl.obolibrary.org/obo/GO_0007589
#>   3: GO:0045745 http://purl.obolibrary.org/obo/GO_0045745
#>   4: GO:0010634 http://purl.obolibrary.org/obo/GO_0010634
#>   5: GO:0042593 http://purl.obolibrary.org/obo/GO_0042593
#>  ---                                                     
#> 618: GO:0035148 http://purl.obolibrary.org/obo/GO_0035148
#> 619: GO:0071326 http://purl.obolibrary.org/obo/GO_0071326
#> 620: GO:0071322 http://purl.obolibrary.org/obo/GO_0071322
#> 621: GO:0070232 http://purl.obolibrary.org/obo/GO_0070232
#> 622: GO:0070233 http://purl.obolibrary.org/obo/GO_0070233