[Biopython-dev] Bio.SeqIO.FASTA fix

Michael Hoffman hoffman at ebi.ac.uk
Mon Mar 1 08:27:19 EST 2004


Bio.SeqIO.FASTA.FastaReader.next() will return a SeqRecord that has
the id attribute set to either a list or a string depending on how
many words are in the definition line (list if there is one word;
string if there is more than one word!). This is a fix so that it will
always be a string.

OK to check in?

Index: FASTA.py
===================================================================
RCS file: /home/repository/biopython/biopython/Bio/SeqIO/FASTA.py,v
retrieving revision 1.6
diff -u -r1.6 FASTA.py
--- FASTA.py    11 Apr 2003 20:04:54 -0000      1.6
+++ FASTA.py    1 Mar 2004 13:34:58 -0000
@@ -32,7 +32,7 @@
         # description.  If there's only one word, it's the id.
         x = string.split(line[1:].rstrip(), None, 1)
         if len(x) == 1:
-            id = x
+            id = x[0]
             desc = ""
         else:
             id, desc = x
-- 
Michael Hoffman <hoffman at ebi.ac.uk>
European Bioinformatics Institute



More information about the Biopython-dev mailing list