[Biopython-dev] Bio.SeqIO

Peter biopython-dev at maubp.freeserve.co.uk
Tue Jan 16 11:10:21 UTC 2007


Michiel Jan Laurens de Hoon wrote:
> Peter wrote:
>> WriteSequences, once known as SequencesToFile - takes a SeqRecord 
>> iterator or list, and output handle, and a format string.  Intended for 
>> use on a whole file at once (i.e. the general case where there may be 
>> headers/footers etc).  This does not let you do incremental writes one 
>> for each record (which would be possible for some formats like GenBank 
>> or fasta)
> 
> At the end of WriteSequences, the file is closed:
> 
> def WriteSequences(sequences, handle, format) :
>      ...
>      handle.close() #just in case the writer object forgot
> 
> Why would it be a problem if the handle is not closed?

OK, I've fixed that.

That issue was on my mind too - in particular it would stop Bio.SeqIO 
from creating concatenated phylip alignments which are used in 
bootstrapping.  Reading this sort of file is a different issue, which I 
am also currently thinking about.

Peter



More information about the Biopython-dev mailing list