[BioPython] ExPASy support is not broken.
Jeffrey Chang
jchang@smi.stanford.edu
Wed, 13 Feb 2002 09:34:12 -0800
Some of the queries that return lots of results are implemented that
way. For example, look at Bio.Medline.PubMed.query_pubmed. It can
return values a chunk at a time through a callback. However, in
general, this isn't implemented for small queries.
There functionality in Bio.Tools.MultiProc.copen that can help you run
queries in a separate process.
Python can use threads, but it's not enabled by default (it slows down
the interpreter), so we have avoided using it for Biopython.
Jeff
On Wed, Feb 13, 2002 at 04:03:15PM +0100, Bram Stolk wrote:
> 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"
> ------------------------------------------------------------------------------
> _______________________________________________
> BioPython mailing list - BioPython@biopython.org
> http://biopython.org/mailman/listinfo/biopython