Search
Question: Accessing KEGG (errors w/ KEGGREST)
0
gravatar for sampsonj74
20 months ago by
sampsonj740
sampsonj740 wrote:

Dear All-

I am trying to access the KEGG database from R.  I downloaded KEGGREST (as I've never done this before, I'm more than willing to use any package, but this seemed best). However, I copied/pasted a couple sample commands from their reference file and received errors. Did I make a mistake...is there a better way to access KEGG from R.

Josh

 

################################################################################################

library("KEGGREST")

keggList("pathway","hsa")
keggFind("genes", c("shiga", "toxin")) 

################################################################################################

 

> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] KEGGREST_1.8.1       BiocInstaller_1.18.5 randomForest_4.6-12 

loaded via a namespace (and not attached):
 [1] zlibbioc_1.14.0     httr_1.2.1          R6_2.2.0            IRanges_2.2.9       XVector_0.8.0       parallel_3.2.1      tools_3.2.1         curl_2.3           
 [9] Biostrings_2.36.4   S4Vectors_0.6.6     BiocGenerics_0.14.0 stats4_3.2.1        png_0.1-7          
> library("KEGGREST")

> keggList("pathway","hsa")
Error in .getUrl(url, .listParser, nameColumn = 1, valueColumn = 2) : 
  invalid request, server returned Success: (200) OK (http://rest.kegg.jp/list/pathway/hsa)
> keggFind("genes", c("shiga", "toxin"))
Error in .getUrl(url, .listParser, nameColumn = 1, valueColumn = 2) : 
  invalid request, server returned Success: (200) OK (http://rest.kegg.jp/find/genes/shiga+toxin)

ADD COMMENTlink modified 20 months ago by Gordon Smyth35k • written 20 months ago by sampsonj740
0
gravatar for Gordon Smyth
20 months ago by
Gordon Smyth35k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth35k wrote:

You can access KEGG using basic R commands. For example:

> Pathways <- read.table("http://rest.kegg.jp/list/pathway/hsa", quote="", sep="\t")
> head(Pathways)
             V1                                                              V2
1 path:hsa00010             Glycolysis / Gluconeogenesis - Homo sapiens (human)
2 path:hsa00020                Citrate cycle (TCA cycle) - Homo sapiens (human)
3 path:hsa00030                Pentose phosphate pathway - Homo sapiens (human)
4 path:hsa00040 Pentose and glucuronate interconversions - Homo sapiens (human)
5 path:hsa00051          Fructose and mannose metabolism - Homo sapiens (human)
6 path:hsa00052                     Galactose metabolism - Homo sapiens (human)

will read all the human KEGG pathway IDs and names into a data.frame.

 

ADD COMMENTlink modified 20 months ago • written 20 months ago by Gordon Smyth35k

Gordon-

Thank you very much! This is quite helpful.

Josh

ADD REPLYlink written 20 months ago by sampsonj740
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 232 users visited in the last hour