Created
August 25, 2023 20:16
-
-
Save slavailn/dcc151273d925947e47237956a46c8d1 to your computer and use it in GitHub Desktop.
Download KEGG pathways with related entrez ids
This file contains 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
library(KEGGREST) | |
library(org.Rn.eg.db) | |
# Download entrez ids and corresponding KEGG pathways followed | |
# by creation of a table where one column is entrez id and another | |
# column is a comma separated list of KEGG pathways | |
# Download pathway to entrez id relationship | |
rno_path_eg <- keggLink("pathway", "rno") | |
names(rno_path_eg) <- gsub("rno:", "", names(rno_path_eg)) | |
rno_path_eg <- gsub("path:", "", rno_path_eg) | |
rno_path_eg <- data.frame(entrez_id = names(rno_path_eg), | |
kegg_id = rno_path_eg) | |
head(rno_path_eg) | |
dim(rno_path_eg) | |
# Create a table, where one column is an entrez id | |
# and the second column are comma separated pathways | |
# where this gene participates | |
rno_path_eg <- aggregate(kegg_id~entrez_id, rno_path_eg, paste, collapse=",") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment