[Biopython-dev] SProt and new lines issue

Peter biopython-dev at maubp.freeserve.co.uk
Sat Mar 10 14:03:10 UTC 2007


Michiel Jan Laurens de Hoon wrote:
> Some files have been added or removed from Biopython recently, so it 
> may be useful to checkout a fresh copy of Biopython from CVS. The 
> Biopython tests in CVS all pass, so things are looking good.

I just got a fresh copy of CVS on my Windows machine, and discovered
that test_SeqIO fails on a SwissProt file (however test_SProt is OK),
specifically:

biopython/Tests/SwissProt/sp007

It turns out that test_SeqIO opens file in mode "rU" (reading, universal
newline mode) while test_SProt opens files in normal read mode.  For
some reason the sp007 file causes trouble in universal newline mode.

Making test_SProt also use "rU" shows the same error as seen in test_SeqIO.

I can "fix" the (Windows only?) error by either opening the files in
normal read mode, or by running unix2dos on the input file.  Very odd.

This also suggests the example file sp007 is not stored in CVS as a text 
file, but as a binary file.

Peter

P.S. I did some work on test_SProt to compare the results of its
RecordParser() and SeqenceParser() and to do a basic test of the 
Iterator() - we should add a multi-record example test case too.




More information about the Biopython-dev mailing list