[BioPython] Help a clueless newbie with BLAST queries?

Jeffrey Chang jchang@SMI.Stanford.EDU
Sat, 2 Jun 2001 16:51:03 -0700 (PDT)


> 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.

Instead of copying, try to do:
results = b_results.read()
save_file.write(results)
...
b_parser.parse_str(results)



> 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...

Jeff