[BioPython] Help a clueless newbie with BLAST queries?

Jeffrey Chang jchang@SMI.Stanford.EDU
Sun, 03 Jun 2001 22:58:26 -0700


>>> 1)The parser (b_parser) craps out with an "unexpected end of stream"
>>> 
>>> save_handle = copy.deepcopy(b_results)
>>> print 'writing from handle copy to output file\n'
>>> save_file.write(save_handle.read())
>> 
>> You can't actually copy a handle like this.  Since you're already reading
>> the contents of the handle, the blast parser has nothing left to read and
>> complains.
> 
> I wasn't too sure about that section - I literally cut-and-pasted it from
> the tutorial because the comment in the tutorial said I'd want to. :-)

Hmmm...  the tutorial will have to be fixed.


>>> 2)I can't seem to get the optional settings to work (I'm trying to limit
>>> the number of 'hits' returned from the BLAST search).  Setting
>>> alignment=10 and descriptions=10 in the NCBIWWW.blast instantiation
>>> seems
>>> to be ignored, and trying to set an "expect" value causes the script to
>>> die with "no PID found".
>> 
>> I'll look into this... may take longer...
> 
> I'm beginning to wonder if NCBI changed the layout yet again...

Yep.  The format changed on us again.  I've updated the code to work with
the new format.  I've checked it into CVS, and it should propogate to the
anonymous server in a few hours.  Please try this and let me know if it
works for you.

The server now also respects the optional parameters.


> Oh, and a quick question about setting the expect value - when I set it, am
> I setting it to a string or a numeric value?  (i.e. should I do expect='0' or
> expect=0 [both gave me the "no PID found" error, but that doesn't change
> the fact that I'm not really sure what I'm doing anway...)?  For that matter
> what do I specifically set it to if I want lower than what the NCBI results
> show as being "e-175", for example?)

Either one.  It likes a string value, but numeric ones get translated via
the str function.

Jeff