Introduction
A .2bit file stores several DNA sequences, up to 4 Gb in total, in a
compact form that can be read at random. It also records which stretches are unknown and
which are masked. The format comes from the UCSC Genome Browser project.
Structure
The file is binary. A 16-byte header holds a signature, 0x1A412743, a
version number (zero), the number of sequences and a reserved field. The signature is
written in the byte order of the machine that made the file, so a reader swaps bytes
when it sees the swapped value.
The header is followed by an index with the name and file offset of each sequence, and then by the sequence records. Each record holds the number of bases, lists of blocks of unknown bases and of masked bases, and the DNA packed at two bits per base: T is 00, C is 01, A is 10 and G is 11.
Not described
This page is a first outline.
Known, not yet covered
- Reference: the full field-by-field layout.
- Viewer: the site has no viewer for this format.
Links
Software
- faToTwoBit – UCSC command that writes .2bit files from FASTA
- twoBitToFa – UCSC command that writes sequences out as FASTA
- twoBitInfo – UCSC command that reports what a .2bit file holds
Reference
- UCSC data file formats – the Genome Browser’s description of the .2bit layout