Created
November 26, 2024 10:33
-
-
Save ATpoint/e4bcf1a74ea731e23feb02da6e282c02 to your computer and use it in GitHub Desktop.
Get GO terms using annotation packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Retrieve GO terms in R using AnnotationDbi and org.Mm.eg.db | |
| library(org.Mm.eg.db) | |
| library(AnnotationDbi) | |
| all_go <- AnnotationDbi::select( | |
| org.Mm.eg.db, | |
| keys = keys(org.Mm.eg.db, keytype = "ENTREZID"), | |
| columns = c("GO", "ONTOLOGY", "ENSEMBL"), | |
| keytype = "ENTREZID" | |
| ) | |
| all_go$TERM <- Term(all_go$GO) | |
| go <- data.frame(term = all_go$TERM, id = all_go$GO, ontology = all_go$ONTOLOGY, gene_id = all_go$ENSEMBL) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment