[BioPython] FASTA parsing errors

Aaron Zschau aaron at ocelot-atroxen.dyndns.org
Tue Aug 3 15:42:57 EDT 2004


I've sent a couple messages to the list about this but I'm not sure if 
they're going through as I haven't seen any replies.  I am trying to 
get a section of my code that worked before the 1.30 revision of 
biopython, based on the cookbook tutorials. My code looks up a gene by 
name in genbank and saves the FASTA version of that data so that the 
protein string can be fed into a BLAST search.  The lookup works fine 
and I get a FASTA file saved just fine, however I then get an error at 
the parse stage at character 0 of the file.

Any help would be greatly appreciated

thanks

Aaron Zschau






#file_for_blast = open(data_path_prefix + file_unique_id + 'fasta', 'r')
file_for_blast = open('/var/www/html/data/a12345.fasta','r')

f_iterator = Fasta.Iterator(file_for_blast)
print "iterator created"
sys.stdout.flush()

f_record = f_iterator.next()
print "f_record created"
sys.stdout.flush()

-----------------------

iterator created
Traceback (most recent call last):
   File "cluster-debug.py", line 119, in ?
     f_record = f_iterator.next()
   File 
"/root/biopython-1.30/build/lib.linux-i586-2.2/Bio/Fasta/__init__.py", 
line 72, in next
     result = self._iterator.next()
   File 
"/root/biopython-1.30/build/lib.linux-i586-2.2/Martel/IterParser.py", 
line 152, in iterateFile
     self.header_parser.parseString(rec)
   File 
"/root/biopython-1.30/build/lib.linux-i586-2.2/Martel/Parser.py", line 
361, in parseString
     self._err_handler.fatalError(ParserIncompleteException(pos))
   File "/usr/lib/python2.2/site-packages/_xmlplus/sax/handler.py", line 
38, in fatalError
     raise exception
Martel.Parser.ParserIncompleteException: error parsing at or beyond 
character 0 (unparsed text remains)



More information about the BioPython mailing list