[BioPython] ExPASy support is not broken.

Bram Stolk bram@sara.nl
Wed, 13 Feb 2002 16:03:15 +0100


Iddo,


Thanks.
You are so right.
It works now for me!

Has anyone investigated a non-blocking interface to these databases?
Something with callbacks?

do_query(request, handler_func) or something...

I'm not sure python does multi-threading which would be required
to do these kind of things I guess.

thanks,

  Bram

On Wed, 13 Feb 2002 16:12:31 +0200 (GMT+0200)
Iddo Friedberg <idoerg@cc.huji.ac.il> wrote:

> Hi Bram,
> 
> On Wed, 13 Feb 2002, Bram Stolk wrote:
> 
> : Hello,
> :
> : Could it be that ExPASy support in biopython is broken?
> : The example for the tutorial does not work for me.
> : Neither with the latest released version of biopython, nor
> : with the CVS version of biopython.
> :
> :
> : Python 2.0 (#6, Nov 21 2000, 16:23:30) [C] on irix646
> : Type "copyright", "credits" or "license" for more information.
> : >>> from Bio.WWW import ExPASy
> : >>> ids=['O23729','O23730','O23731']
> : >>> results = ExPASy.get_sprot_raw(id)
> 
> That won't work. Actually, you are supposed to get a:
> NameError: name 'id' is not defined
> 
> according to the code snippet you placed. However, I assume a certain
> brevity on your part, and the real reason that it won't work is that
> get_sprot_raw only accepts a single id string at a time. So in order to
> retrieve several ids you need to loop over the ids list, as described in:
> 
> http://www.bioinformatics.org/bradstuff/bp/tut/Tutorial003.html#toc13
> 
> And then loop over the results with a swissprot parser (described on same
> page).
> 
> I just checked the code there myself, using the latest release, and it
> still works. Amazing.
> 
> Off topic, but sometimes causes problems:
> One thing which you might need to pay attention to, is the use of proxies,
> in case you use them.
> 
> Before starting up your python interpreter (or script) you need to have
> the environmental varible http_proxy defined e.g. in csh:
> 
> % setenv http_proxy "http://slowest.proxy.com:8080"
> 
> Yours,
> 
> Iddo
> 
> --
> 
> Iddo Friedberg                                  | Tel: +972-2-6757374
> Dept. of Molecular Genetics and Biotechnology   | Fax: +972-2-6757308
> The Hebrew University - Hadassah Medical School | email: idoerg@cc.huji.ac.il
> POB 12272, Jerusalem 91120                      |
> Israel                                          |
> http://bioinfo.md.huji.ac.il/marg/people-home/iddo/
> 
> 


-- 
------------------------------------------------------------------------------
 Bram Stolk, VR Specialist.
 SARA Academic Computing Services Amsterdam, PO Box 94613, 1090 GP  AMSTERDAM
 email: bram@sara.nl   Phone +31-20-5923059  Fax +31-20-6683167

 "I heard if you play the NT-4.0-CD backwards, you get a satanic message."
 "Thats nothing, if you play it forward, it installs NT-4.0"
------------------------------------------------------------------------------