Sequence.write(file, format='fasta', **kwargs)[source]#

Write an instance of Sequence to a file.

This is a convenience method for For more information about the I/O system in scikit-bio, please see

Supported file formats include:

fileopenable (filepath, URL, filehandle, etc.)

The location to write the given format into. Something that is understood by Filehandles are not automatically closed, it is the responsibility of the caller.


The format must be a registered format name with a writer for Sequence. Default is ‘fasta’.

kwargsdict, optional

Keyword arguments passed to and the file format writer.