[Biopython-dev] KEGG API Wrapper

Kevin Wu kjwu at ucsd.edu
Wed Oct 24 22:38:04 UTC 2012


Hi All,

Thanks for the comments, I've written a bit of documentation on the entire
KEGG module and have attached those relevant pages to the email. There
didn't seem like an appropriate place for examples, so I just added a new
chapter. I've also committed the updated file to github.

I did leave out the parsers due to the fact that the current parsers only
cover a small portion of possible responses from the api. Also, I'm not
confident that the some of the parsers correctly retrieves all the fields.
However, I've written a really general parser that does a rough job of
retrieving fields if it's a database format returned since I find myself
reusing the code for all database formats. It's possible to modify this to
correctly account for the different fields, but would probably take a bit
of work to manually figure each field out. Otherwise it also parses the
tsv/flat file returned.

Also, @zach, thanks for checking it out and testing it!

Thanks All!
Kevin

On Wed, Oct 17, 2012 at 4:09 AM, Peter Cock <p.j.a.cock at googlemail.com>wrote:

> On Wed, Oct 17, 2012 at 12:55 AM, Zachary Charlop-Powers
> <zcharlop at mail.rockefeller.edu> wrote:
> > Kevin,
> > Michiel,
> >
> > I just tested Kevin's code for a few simple queries and it worked great.
> I
> > have always liked KEGG's organization of data and really appreciate this
> > RESTful interface to their data; in some ways I think it easier to use
> the
> > web interfaces for KEGG than it is for NCBI. Plus the KEGG coverage of
> > metabolic networks is awesome.  I found the examples in Kevin's test
> script
> > to be fairly self-explanatory but a simple-spelled out example in the
> > Tutorial would be nice.
> >
> > One thought, though, is that you can retrieve MANY different types of
> data
> > from the KEGG Rest API - which means that the user will probably have to
> > parse the data his/herself. Data retrieved with "list" can return lists
> of
> > genes or compounds or organism and after a  cursory look  these are each
> > formatted differently. Also true with the 'find' command. So I think you
> > were right to leave out parsers because i think they will be a moving
> target
> > highly dependent on the query.
> >
> > Thank You Kevin,
> > zach cp
>
> Good point about decoupling the web API wrapper and the parsers -
> how the Bio.Entrez module and Bio.TogoWS handle this is to return
> handles for web results, which you can then parse with an appropriate
> parser (e.g. SeqIO for GenBank files, Medline parser, etc).
>
> Note that this is a little more fiddly under Python 3 due to the text
> mode distinction between unicode and binary... just something to
> keep in the back of your mind.
>
> Peter
> _______________________________________________
> Biopython-dev mailing list
> Biopython-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython-dev
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KEGG documentation.pdf
Type: application/pdf
Size: 128597 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/biopython-dev/attachments/20121024/3f7b7063/attachment-0002.pdf>


More information about the Biopython-dev mailing list