[BioPython] Blastp XML mailfunction

Peter biopython at maubp.freeserve.co.uk
Tue Jun 24 07:11:12 EDT 2008


On Tue, Jun 24, 2008 at 11:58 AM, Joost van Dieten <jdieten at gmail.com> wrote:
>  MY CODE:
>       result_handle = NCBIWWW.qblast('blastp', 'swissprot', sequence,
> entrez_query='man[ORGN]')
>       blast_results = result_handle.read()
>       print result_handle-
>       result_handler = cStringIO.StringIO(blast_results)
>       print result_handler
>       blast_records = NCBIXML.parse(result_handler)
>       blast_record = blast_records.next()

You probably know this, but for anyone trying to cut-and-paste the
code, its much simpler to do this:

result_handle = NCBIWWW.qblast('blastp', 'swissprot', sequence,
entrez_query='man[ORGN]')
blast_records = NCBIXML.parse(result_handle)
blast_record = blast_records.next()

Joost's code is a handy way to print out the raw data before parsing
it, to try and identify any problems by eye.

> This code doesn't seem to work anymore. I got an error that my blast_record
> is empty, but it worked fine 3 weeks ago. Something changed to the NCBIXML
> code??? Any ideas??

Yes, its probably a recent NCBI change, which we've fixed with Bug 2499:
http://bugzilla.open-bio.org/show_bug.cgi?id=2499

If you want to just update the Blast parser, I think you need to
update both NCBIXML.py and Record.py, but a complete install from CVS
might be simpler.

Peter


More information about the BioPython mailing list