[Biopython-dev] [Bug 2652] Bio.Fasta.Iterator fails with IndexError when opening empty fasta files

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Nov 11 11:55:07 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2652


biopython-bugzilla at maubp.freeserve.co.uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from biopython-bugzilla at maubp.freeserve.co.uk  2008-11-11 06:55 EST -------
Hi Renato,

This bug in Bio.Fasta with empty files was fixed in Biopython 1.49b, see
Bio/Fasta/__init__.py revision 1.19. 
http://cvs.biopython.org/cgi-bin/viewcvs/viewcvs.cgi/biopython/Bio/Fasta/__init__.py?cvsroot=biopython#rev1.19

I would encourage you to try Biopython 1.49b, but if you have a reason for
running an old version like Biopython 1.45, you could probably update just this
one file instead.  Ask if you would like specific instructions, but essentially
its a one line change, from:

if line[0] == ">" :

to:

if not line or line[0] == ">" :

Please note that Bio.Fasta is considered to be obsolete (and was explicitly
documented as such as of Biopython 1.48), and may one day be deprecated. 
However, given this was the main FASTA parsing code in Biopython for some
years, we're not going to deprecate it just yet, so you should be OK continuing
to use Bio.Fasta in old scripts for a while yet.

For new code, we encourage people to use Bio.SeqIO instead, described in the
current tutorial and on the wiki:
http://biopython.org/DIST/docs/tutorial/Tutorial.html
http://biopython.org/DIST/docs/tutorial/Tutorial.pdf
http://biopython.org/wiki/SeqIO

Peter


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list