[BioPython] FASTA parsing errors

Jeffrey Chang jeffrey_chang at stanfordalumni.org
Tue Aug 3 16:23:33 EDT 2004


Hi Aaron,

Can you send the file that is generating the error?  I believe it is 
called /var/www/html/data/a12345.fasta.  In general, the fasta parser 
should be well-tested.  It works on a test file in fasta format that I 
have here.  It would help most if someone could look at your file to 
see what's going on.

Thanks,
Jeff


On Aug 3, 2004, at 3:42 PM, Aaron Zschau wrote:

> 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)
>
> _______________________________________________
> BioPython mailing list  -  BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython



More information about the BioPython mailing list