Learn R Programming

goat (version 1.1.2)

load_genesets_go_fromfile: construct a geneset table from gene2go and OBO files

Description

This function is used to load Gene Ontology (GO) genesets from files that you manually downloaded from the links below. This enables the use of the latest data from GO (in contrast, Bioconductor GO data may lag behind current data considerably). To construct genesets from available raw data, download the "gene2go" file (the gene annotations) from below NCBI link and download the GO OBO (ontology terms and relations to respective parent/child terms) from below geneontology.org link. Provide the full path to the downloaded file to this function. Both "gzipped" and "uncompressed" files are supported.

We encourage you to rename the files after your downloaded them such that the date of download in incorporated; this ensures you can always keep track of the GO database version that was used! For example, rename the downloaded "gene2go.gz" file to "gene2go_2024-01-31.gz".

Download link for gene2go file; https://ftp.ncbi.nih.gov/gene/DATA/gene2go.gz

Download link for gene ontology OBO file; http://current.geneontology.org/ontology/go.obo

Usage

load_genesets_go_fromfile(
  file_gene2go,
  file_goobo,
  include_child_annotations = TRUE,
  taxid_filter = 9606
)

Value

table with columns; source (character), source_version (character), id (character), name (character), genes (list), ngenes (int)

Arguments

file_gene2go

full path to the gene2go file from NCBI. Also works with a gzipped file; gene2go.gz

file_goobo

full path to the OBO file from geneontology.org. Also works with a gzipped file; obo.gz

include_child_annotations

boolean; include annotations against child terms? In most situations, TRUE (default) is the desired setting

taxid_filter

return gene annotations only for the specified taxonomy identifier (integer value). Typical options are 9606 (Human, the default) or 10090 (mouse). Importantly, select the taxonomy/organism that is also in your input gene list (which typically contains human Entrez gene identifiers)

Examples

Run this code
  # TODO: update the filenames to your downloaded files
  file_gene2go = "C:/DATA/gene2go_2024-01-01.gz"
  file_goobo = "C:/DATA/go_2024-01-01.obo"
  if(file.exists(file_gene2go) && file.exists(file_goobo)) {
    genesets_asis = load_genesets_go_fromfile(file_gene2go, file_goobo)
  }

Run the code above in your browser using DataLab