biopython v1.71.0 Bio.SeqIO.Interfaces.SequentialSequenceWriter

Base class for sequence writers. This class should be subclassed.

It is intended for sequential file formats with an (optional) header, repeated records, and an (optional) footer.

In this case (as with interlaced file formats), the user may simply call the write_file() method and be done.

However, they may also call the write_header(), followed by multiple calls to write_record() and/or write_records() followed finally by write_footer().

Users must call write_header() and write_footer() even when the file format concerned doesn’t have a header or footer. This is to try and make life as easy as possible when switching the output format.

Note that write_header() cannot require any assumptions about the number of records.

Link to this section Summary

Functions

Initialize the class

Use this to write an entire file containing the given records

Write a single record to the output file

Write multiple record to the output file

Link to this section Functions

Initialize the class.

Use this to write an entire file containing the given records.

records - A list or iterator returning SeqRecord objects

This method can only be called once. Returns the number of records written.

Write a single record to the output file.

record - a SeqRecord object

Once you have called write_header() you can call write_record() and/or write_records() as many times as needed. Then call write_footer() and close().

Link to this function write_records()

Write multiple record to the output file.

records - A list or iterator returning SeqRecord objects

Once you have called write_header() you can call write_record() and/or write_records() as many times as needed. Then call write_footer() and close().

Returns the number of records written.