[Biopython] NCBIXML.parse

Peter Cock p.j.a.cock at googlemail.com
Fri May 17 08:55:05 UTC 2013


On Fri, May 17, 2013 at 5:26 AM, Mic <mictadlo at gmail.com> wrote:

> Please find attached the x.blastp.xml file. Do you need more information?
>
>

>>> from Bio.Blast import NCBIXML
>>> with open("x.blastp.xml") as bf:
...     for r in NCBIXML.parse(bf):
...         for a in r.alignments:
...             print r.query, a.hit_id
...
X-snap.4 UniRef90_Q9FX16
(etc)

This matches the first hit in the XML,

          <Hit_num>1</Hit_num>
          <Hit_id>UniRef90_Q9FX16</Hit_id>
          <Hit_def>F12G12.10 protein n=1 Tax=Arabidopsis thaliana
RepID=Q9FX16_ARATH</Hit_def>
          <Hit_accession>UniRef90_Q9FX16</Hit_accession>
          <Hit_len>308</Hit_len>

If you are getting UR090:UniRef90_Q9FX16 then perhaps some other
part of your code is adding the prefix? What else did your code do
(it was incomplete - there were no print statements for example)?

Regards,

Peter



More information about the Biopython mailing list