[BioPython] Problems with NCBIXML.py

Bruno Santos bsantos at biocant.pt
Tue Oct 23 17:17:24 UTC 2007


I have manually checked the file and I didn't found any problem.
Sorry about the three times it was my mistake because I send the message
before register and then I thought I had to send it again.
This is getting stranger every time I ran the script it gave me a different
error. Now I get this one at the first run:

Traceback (most recent call last):
  File
"C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Documents and Settings\POSTO_21\Os meus documentos\Meta
Genómica\BLAST.py", line 17, in <module>
    for blast_record in blast_records:
  File "C:\Python25\lib\site-packages\Bio\Blast\NCBIXML.py", line 583, in
parse
    expat_parser.Parse("", True) # End of XML record
ExpatError: unclosed token: line 2826, column 8

Now if I run the script without first close it I get the following error:
Traceback (most recent call last):
  File
"C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Documents and Settings\POSTO_21\Os meus documentos\Meta
Genómica\BLAST.py", line 17, in <module>
    for blast_record in blast_records:
  File "C:\Python25\lib\site-packages\Bio\Blast\NCBIXML.py", line 583, in
parse
    expat_parser.Parse("", True) # End of XML record
ExpatError: no element found: line 2823, column 81

Now if I execute the close operation on both files in the interactive window
and run the script again I get:

Traceback (most recent call last):
  File
"C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Documents and Settings\POSTO_21\Os meus documentos\Meta
Genómica\BLAST.py", line 17, in <module>
    for blast_record in blast_records:
  File "C:\Python25\lib\site-packages\Bio\Blast\NCBIXML.py", line 583, in
parse
    expat_parser.Parse("", True) # End of XML record
ExpatError: no element found: line 2827, column 0

I have upload my script, the FASTA file I'm using and the XML can anyone
give a look?

XML File: http://www.drivehq.com/folder/p2731454.aspx
Script: http://www.drivehq.com/folder/p2731447.aspx
FASTA File: http://www.drivehq.com/folder/p2731426.aspx


Unidade de Bioinformática  

3060-197 Cantanhede  
Tel: 231 410 892
http://bioinformatics.biocant.pt

-----Mensagem original-----
De: Peter [mailto:biopython at maubp.freeserve.co.uk] 
Enviada: terça-feira, 23 de Outubro de 2007 17:10
Para: Bruno Santos
Cc: biopython at biopython.org
Assunto: Re: [BioPython] Problems with NCBIXML.py

Bruno Santos wrote:
> I am trying to build a simple script that given a multi FASTA sequence
file
> perform a web BLAST and replace the name of the sequence by the hit with
the
> lowest E-Value.
> 
> But now I’m getting an exception that I don’t now why it’s happening:
> 
> Traceback (most recent call last):
> ...
> 
>     for blast_record in blast_records:
> 
>   File "C:\Python25\lib\site-packages\Bio\Blast\NCBIXML.py", line 592, in
> parse
> 
>     expat_parser.Parse(text, False)
> 
> ExpatError: mismatched tag: line 2823, column 362

That sounds like an error in the XML file - have a look at this 
particular XML file by hand in a text editor; maybe its only a partial 
download, or an HTML error page or something.

Peter







More information about the Biopython mailing list