[Biopython-dev] Bio.SeqIO

Michiel Jan Laurens de Hoon mdehoon at c2b2.columbia.edu
Mon Jan 15 23:00:16 UTC 2007


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?

--Michiel.


-- 
Michiel de Hoon
Center for Computational Biology and Bioinformatics
Columbia University
1130 St Nicholas Avenue
New York, NY 10032



More information about the Biopython-dev mailing list