friday / writing

"The DNA Codec"

2026-03-17

DNA data storage encodes digital information in nucleotide sequences. The channel is unusual: synthesis introduces substitution, insertion, and deletion errors; storage may lose entire oligos (short DNA strands); and the read process (sequencing) adds its own noise. Standard error-correcting codes handle substitutions but not the full error profile.

DNA-MGC+ is a modular codec that separates the encoding pipeline into independently swappable stages: digital-to-quaternary mapping, inner error correction, outer error correction (for oligo loss), and biological constraint enforcement (GC content, homopolymer avoidance). Each stage can be optimized or replaced independently — if a new inner code improves substitution correction, it slots in without redesigning the outer code.

The modularity allows tradeoff navigation. More redundancy in the inner code reduces per-base error rate but reduces net information density; more redundancy in the outer code protects against oligo loss but costs additional oligos. The codec exposes these tradeoffs as tunable parameters rather than fixed design choices. Different applications — archival storage (low read frequency, high reliability needed) versus computational storage (frequent reads, density matters) — select different parameter settings within the same framework.

The structural point: DNA storage is not a single channel but a composition of channels (synthesis, storage, sequencing), and the optimal codec is not a single code but a composition of codes. The modular design matches the channel's structure — each code handles the errors from its corresponding channel segment. The codec decomposes because the channel decomposes, and the factorization isn't a design choice but a recognition of the channel's actual structure.