[BioPython] Martel.Parser.ParserPositionException:

Peter biopython at maubp.freeserve.co.uk
Sat Apr 16 14:44:01 EDT 2005


Marc Saric wrote:
> Hi all,
> 
> I tried to index the the following Genbank file with this simple script
> (as described in the cookbook) but it failed with the following traceback.
> 
> The file can be found in:
> 
> http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?val=BA000018
> 
> including all features (SNP, CDD, MGC, HPRD, STS)
> 
> I tried with Biopython 1.3, Biopython 1.4b and the Biopython-CVS as of
> 2005-04-15.
> 
> The program
> 
> ===snip===
> #!/usr/bin/env python
> from Bio import GenBank
> 
> dict_file = "ba000018_s_aureus_n315_genome.gb"
> index_file = "ba000018_s_aureus_n315_genome.idx"
> 
> GenBank.index_file(dict_file, index_file)

I have just tried this on Windows 2000 with Python 2.3, and suspect 
the problem may be due to an extra blank line at the very end of the 
file.

I went to the link you gave above, ticked the boxes for SNP, CDD, 
MGC, HPRD, STS and then clicked on the "Send" to file button.  This 
gave me a file that was about 5.6 MB in size, which I called 
ba000018_s_aureus_n315_genome.gb following your example.

Initially I got a very similar error to yours - in my case the exact 
position was 5887555, corresponding to the end of the file. I would 
assume the numerical difference is due to Windows versus Unix new 
line characters.

If I then edited the GenBank file to remove the final blank new 
line, the sample program seemed to work.

This should be a quick an easy thing for you to try, and if it does 
fix the error, I think we will have identified a minor bug...

Peter


More information about the BioPython mailing list