Metabolomics Society Forum

Software => R => XCMS => Topic started by: AmSidebottomIU on June 24, 2011, 09:28:06 AM

Title: KEGG searching
Post by: AmSidebottomIU on June 24, 2011, 09:28:06 AM
Hello,

I was wondering if there is a way to search the KEGG database similar to the search scripts for METLIN through XCMS?  And if not, (I am also new to the KEGG database) how can you search KEGG by molecular weight?  I have been searching and no luck- thank you for any help!

Ashley
Title: Re: KEGG searching
Post by: hpbenton on June 26, 2011, 07:13:38 AM
Hi Ashley,

I've been working on doing a cool little function for this for some time however there is a package called KEGGSOAP downloadable from bioconductor http://http://www.bioconductor.org/packages/2.4/bioc/html/KEGGSOAP.html.
If you load up KEGGSOAP and use the following code it should work (required internet connection):

Code: [Select]
library(KEGGSOAP)

search.compounds.by.mass(89.0932, 0.1)
## [1] "cpd:C00041" "cpd:C00099" "cpd:C00133" "cpd:C00213" "cpd:C01401" "cpd:C01444" "cpd:C01537" "cpd:C02116"
## [9] "cpd:C06383" "cpd:C11488"

bget("-f m cpd:C00041") ## gives the mol file for plotting the molecule with RCDK ([url]http://cran.r-project.org/web/packages/rcdk/index.html[/url])

molD<-bget("cpd:C00041") ## this will give you the full listing
molName<-strsplit(strsplit(molD, "n")[[1]][2],  "\s+", perl=T)[[1]][2]
molName
##[1] "L-Alanine;"

This can be a very messy way but it gets the job done. If you're going to put this into a for loop be careful of the multiple results returned. I'm pretty sure that the results are returned in order for the original mass. Also remember KEGG searches neutral masses!!

The method that I working on in xcms will hopefully get a better name and have a choice between the different results. I'll spend some time and get the function working and into the next release of xcms. I'll update here when I do.

Paul

EDIT:
Just reread your Q and thought you might also want this
http://http://www.genome.jp/ligand-bin/result?db=compound&pid=130909468912976&show=weight,structure&q=89%20-%2090

This search is done from the http://http://www.genome.jp/kegg/ligand.html page about half way down it says "Search COMPOUND" then use the drop down box to get "Exact mass"
Title: Re: KEGG searching
Post by: AmSidebottomIU on June 27, 2011, 08:57:49 AM
Hey Paul,

Thank you for the reply ,it was extremely helpful.  I haven't gotten the KEGGSOAP to function properly, but I'll mess around with it a little bit more.  I look forward to the XCMS update, thanks again!

Ashley
Title: Re: KEGG searching
Post by: hpbenton on July 09, 2011, 08:14:28 AM
Quote
KEGGSOAP to function properly

Whats the error message or is it just not working?? Let me know.  ;)