The SFF file consists of a global header section followed by pairs of read-header and read-data sections with one pair for each sequence.  Values are stored in big-endian order.

SFF Global Header Section

FieldTypeDescription
magicuint320x2E736666 (".sff")
versionuint32As of the writing of this documentation, version is 1
index_offsetuint64Not used (value is 0)
index_lengthuint32Not used (value is 0)
n_readsuint32The number of reads in the file
gheader_lengthuint16Number of bytes in this global header (includes eight-byte padding)
key_lengthuint16Length of the key sequence used with these reads
flow_lengthuint16Number of nucleotide flows used in the experiment
flowgram_formatuint8Specifies the manner in which signal values are encoded. Currently only one method is defined and so the only legal value is 1.
Important note: unfortunately, the files we use for tests do not follow this convention. For all of the test cases you can assume that the value of flowgram_format is 0.
flow_sequencechar[TS:flow_length]A character array withith entry specifying theith nucleotide flowed.
key_sequencechar[TS:key_length]A character array withith entry specifying theith nucleotide of the sequence key.
eight_byte_paduint8[TS:?]If the number of bytes in the header is not divisible by 8, zero-valued bytes are added to pad the length out such that it is divisible by 8

SFF Read Header Section

FieldTypeDescription
rheader_lengthuint16Number of bytes in this read header (includes eight-byte padding)
name_lengthuint16Number of characters in the name of the read.  Note the read name is not null-terminated.
n_basesuint32Number of bases in the read
clip_qual_leftuint16If any clipping has been applied, the 1-indexed coordinate of the first base after the clipped region is stored here.  If no clipping has been applied this field will be zero.
clip_qual_rightuint16If any clipping at the end of the read has been applied, this field contains the 1-indexed coordinate of the last base before the clipped region.  If no end-clipping is applied this field is zero.
clip_adapter_leftuint16Similar to clip_qual_left - identifies adapter clipping, if applied.
clip_adapter_rightuint16Similar to clip_qual_right - identifies adapter clipping, if applied.
namechar[TS:name_length]The read name.  This string is not null-terminated.
eight_byte_paduint8[TS:?]If the number of bytes in the read header is not divisible by 8, zero-valued bytes are added to pad the length out such that it is divisible by 8

SFF Read Data Section

FieldTypeDescription
flowgramuint?[TS:flow_length]The type used for this field depends on the flowgram_format value in the global header.  Currently only one code is defined (1), which uses uint16 as the basic type for this field.  This encoding specifies that signal values are stored as round(signal * 100).
flow_indexuint8[TS:n_bases]This array identifies for each called base the flow that resulted in the base call.  The values are 1-indexed and they are each stored relative to the previous value in the array.
baseschar[TS:n_bases]The called bases.
qualityuint8[TS:n_bases]The quality score associated with each base call, in -10*log10 probability scale.
eight_byte_paduint8[TS:?]If the number of bytes in the header is not divisible by 8, zero-valued bytes are added to pad the length out such that it is divisible by 8