Skip to content
@deckyard/abif

The format

The layout follows Applied Biosystems' "ABIF File Format Specification" (2009). Every number is big-endian.

Header and directory

BytesHolds
0-3ABIF
4-5the version: 101 for 1.01, 300 for 3.00
6-33the directory's own entry: name tdir, number 1, type 1023, element size 28, the entry count, the space reserved for the directory, its offset
34-127reserved

The directory's reserved space can be larger than its entries: a 310 file reserves 3584 bytes for 113 entries. Only the counted entries are read.

Each directory entry is 28 bytes:

BytesHolds
0-3the tag name, four ASCII characters
4-7the tag number
8-9the element type
10-11the element size
12-15the element count
16-19the data size, count times element size
20-23the data's offset; data of 4 bytes or less is stored here instead
24-27reserved (3500 HID files fill it)

Element types

CodeTypeSizeRead as
1byte1unsigned
2char1bytes: text or small numbers
3word2unsigned
4short2signed
5long4signed
7float4IEEE 754
8double8IEEE 754
10date4year (signed 16-bit), month, day
11time4hour, minute, second, hundredths
12thumb10two signed 32-bit fields, two bytes
13bool1zero is false
18pString1a length byte, then the text
19cString1the text, then a NUL
1024 and upuseranyraw bytes

Codes 6, 9, 14 to 17, 20, 128, 256 and 384 are obsolete types the specification names but does not support; they read as raw bytes, as does any other code.

Common tags

TagHolds
DATA 1-4, 105+raw traces, one per dye
DATA 5-8electrophoresis voltage, current, laser power and oven temperature during the run
DATA 9-12, 205+analysed traces
Dye# 1the number of dyes
DyeN n, DyeW ndye n's name and wavelength
PBAS 1, 2bases, as edited and as called
PCON 1, 2quality values, as edited and as called
PLOC 1, 2peak locations, as edited and as called
FWO_ 1the base order of the four traces, such as GATC
SMPL 1sample name
TUBE 1well
LANE 1lane or capillary
MCHN 1, MODL 1instrument name, model
RUND / RUNT 1-4run start, run stop, collection start, collection stop
RunN 1, RMdN 1run name, run module
DySN 1, GTyp 1dye set, polymer
StdF 1size standard (fragment runs)
Scal 1the rescaling divisor of the colour data

3500 HID files

HID files are version 3.00. Beside the usual types they use codes 28 to 34 (element size 1) for the traces, peak tables, size-standard fit, most dye names and the model: encrypted blocks of 8 bytes, deterministic, so equal plaintexts give equal ciphertexts. Data handles (bytes 24-27 of an entry) are filled. The plain tags - sample, well, instrument, run times, size standard, wavelengths, audit XML - read as in any ABIF file.