Download all KEGG pathway KGML files for SPIA analysis

[This article was first published on One Tip Per Day, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Most people know KEGG pathway, but not everyone knows that it costs at least $2000 to subscribe its database. If you want to save the cost a bit, you can manually download the KEGG pathway KGML files and install in SPIA. Here I have a workaround to download all KEGG pathway files using their REST API.
## Claim: this is my personal trick. I recommend people to subscribe their KEGG FTP download to support the authors.

# change folder to the folder where your SPIA installed
cd /Library/Frameworks/R.framework/Versions/3.4/Resources/library/SPIA
# download all XML files for all human pathway
curl -s http://rest.kegg.jp/list/pathway/hsa | awk ‘{split($1,a,”:”); print “curl -s http://rest.kegg.jp/get/”a[2]”/kgml -o extdata/keggxml/hsa/”a[2]”.xml”}’ | bash

# then switch to R console
setwd(“/Library/Frameworks/R.framework/Versions/3.4/Resources/library/SPIA”)
library(SPIA)
makeSPIAdata(kgml.path=system.file(“extdata/keggxml/hsa”,package=”SPIA”),organism=”hsa”,out.path=”./extdata”)

Done!

To leave a comment for the author, please follow the link and comment on their blog: One Tip Per Day.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)