[Biopython-dev] Bio.SeqIO

Michiel de Hoon mdehoon at c2b2.columbia.edu
Sun Feb 25 11:42:21 UTC 2007

Thanks Peter!

Peter wrote:
> The file format is now a required argument (it can be made into an 
> optional argument in future if we decide to support file format guessing 
> one day).
Looks good! I have just some minor comments:

Currently the format has to be in lower-case. It might be better to make 
the format case-insensitive. So I won't have to remember whether it is 
"fasta", "Fasta", or "FASTA".

Three of the ValueErrors raised by WriteSequences and SequenceIterator 
are actually TypeErrors:

     if isinstance(handle, basestring) :
     if not format :
     if not isinstance(format, basestring) :

The "if not format" is actually not needed, since Python will complain 
already if these functions are called without the correct number of 

For an incorrect format argument, WriteSequences raises an 
AssertionError. A ValueError (as in SequenceIterator) seems more 
appropriate. Also, it might be a good idea to print possible values for 
the format if the user passes an incorrect format.

Btw, the docstring for SequenceIterator mentions guessing the file 
format from the handle if the format is not specified.


More information about the Biopython-dev mailing list