Skip to contents

Update entries in the gs_description column of msigdbr results to use terms from the Gene Ontology Consortium.

Usage

update_GO_names(
  x,
  version = packageVersion("msigdbr"),
  capitalize = FALSE,
  obo_file
)

Arguments

x

object of class data.frame produced by link[msigdbr]{msigdbr} or msigdbr2 containing columns gs_description and gs_subcat.

version

character; specifies the version of msigdbr to use. Defaults to the current version.

capitalize

logical; whether to capitalize the first letter of each description if the first word does not contain a mix of capital and lowercase letters. Improves appearance of plots, such as those produced by enrichmat.

obo_file

character; optional path to the OBO file that should be used to update Gene Ontology term descriptions. Only provide when the appropriate OBO file cannot be extracted from the MSigDB Release Notes (See Details).

Value

Object of class data.frame. The same as x, but with updated descriptions.

Details

This function assumes that the phrase "GO-basic obo file released on" is present in the MSigDB release notes for that version and is followed by a date. This date will replace "RELEASE_DATE" in "http://release.geneontology.org/RELEASE_DATE/ontology/go-basic.obo".

References

Ashburner, M., et al. (2000). Gene ontology: tool for the unification of biology. The Gene Ontology Consortium. Nature genetics, 25(1), 25--29. https://doi.org/10.1038/75556

Gene Ontology Consortium (2021). The Gene Ontology resource: enriching a GOld mine. Nucleic acids research, 49(D1), D325--D334. https://doi.org/10.1093/nar/gkaa1113

Author

Tyler Sagendorf

Examples

x <- msigdbr2(species = "Homo sapiens",
              genes = "gene_symbol",
              gs_subcat = "GO:MF")
#> Searching MSigDB 7.5.1 Release Notes for OBO file date:
#> Error in obo_file(version = version): argument "obo_file" is missing, with no default
set.seed(9900)
idx <- sample(1:nrow(x), size = 6) # random indices to illustrate changes
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'nrow': object 'x' not found
x$gs_description[idx] # before
#> Error in eval(expr, envir, enclos): object 'x' not found

y <- update_GO_names(x, capitalize = TRUE)
#> Error in eval(expr, envir, enclos): object 'x' not found
y$gs_description[idx] # after
#> Error in eval(expr, envir, enclos): object 'y' not found