[BioPython] ExPASy support broken?

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


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/